Check a shop’s or SmartBill account’s credentials without saving them
const url = 'https://api.motenya.app/v1/products/example/integrations/test';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"magento2","baseUrl":"example","credentials":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.motenya.app/v1/products/example/integrations/test \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "magento2", "baseUrl": "example", "credentials": { "additionalProperty": "example" } }'Returns the shop’s websites (a SmartBill company and its invoice series) when it answers; CONNECTION_REFUSED or CONNECTION_FAILED otherwise.
Requires crm:configure.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The shop’s https address. Not needed for smartbill. intercom: the workspace’s API region, https://api.intercom.io (default), https://api.eu.intercom.io or https://api.au.intercom.io.
Magento2: { "accessToken" }. magento1: { "apiUser", "apiKey", "currency" } (the shop’s ISO 4217 currency, which its API cannot tell). smartbill: { "username", "token", "cif" } (the SmartBill login email, its API token, and the company’s CIF). intercom: { "accessToken" } (one that can read conversations, contacts and admins).
object
Responses
Section titled “Responses”Success
object
object
Smartbill: the account’s invoice series.
Example generated
{ "name": "example", "websites": [ { "externalId": "example", "name": "example", "currency": "example", "baseUrl": "example" } ], "invoiceSeries": [ "example" ]}Invalid request
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing, invalid, revoked or expired API key
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing scope, API turned off, published article without publish scope, or account suspended
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Not found, or outside the knowledge bases this key may use
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Slug or translation already exists
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rejected by validation (e.g. unknown language or category)
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rate limited; see Retry-After
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Internal error