Connect a shop, a SmartBill account or an Intercom workspace
const url = 'https://api.motenya.app/v1/products/example/integrations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"magento2","name":"example","baseUrl":"example","credentials":{"additionalProperty":"example"},"replyChannelAddress":"example","historyMode":"none","historyMonths":1}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "magento2", "name": "example", "baseUrl": "example", "credentials": { "additionalProperty": "example" }, "replyChannelAddress": "example", "historyMode": "none", "historyMonths": 1 }'The shop is checked first. Its websites become stores, and the first sync starts: the catalog, customers and orders changed within the history chosen, then every 15 minutes. A SmartBill account’s company becomes a store; its invoices are imported (POST …/integrations/{id}/invoices) and checked for payment daily. An Intercom workspace brings its contacts into the CRM and its conversations in as tickets, with their whole thread, then keeps them up to date every 15 minutes until you switch over; give the email channel they reply from as replyChannelAddress.
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
Intercom, and required there: the inbound address of the product’s email channel that imported tickets reply from.
Shops and help desks. How far back the first sync reaches: none (changes from now on), months (the last historyMonths), full. none when omitted.
With months: 1–120, 12 when omitted.
Responses
Section titled “Responses”Success
object
error stops syncing until the address or credentials are fixed.
Which credentials are stored, e.g. “accessToken …a1b2”. They are never returned.
The source its records sync under; look them up with GET /sync/{type}/{source}/{externalId}.
Intercom: the email channel imported tickets reply from.
object
object
object
object
Smartbill only: the daily check of the imported invoices still unpaid or partly paid.
object
object
Invoices asked about.
Whose payment status changed.
SmartBill had no such invoice.
object
Invoices asked about.
Whose payment status changed.
SmartBill had no such invoice.
Example
{ "type": "magento2", "status": "active", "historyMode": "none", "phase": "history", "runningEntity": "catalog_item", "counts": [ { "entity": "catalog_item" } ], "lastRecordError": { "entity": "catalog_item" }}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