Integrations
An integration pulls a shop’s catalog, customers and orders into a product’s CRM, first the history you choose and then every 15 minutes. A SmartBill integration works differently: its invoices are imported, then checked for payment every day (see SmartBill). Integrations are set up in the admin under Customers → Integrations, or through the API.
| Platform | type |
Credentials |
|---|---|---|
| Magento 2 / Adobe Commerce | magento2 |
{ "accessToken" }: an integration’s access token (System → Extensions → Integrations). On 2.4.4 and later, allow OAuth access tokens as bearer tokens (Stores → Configuration → Services → OAuth). |
| Magento 1 / OpenMage | magento1 |
{ "apiUser", "apiKey", "currency" }: a SOAP/XML-RPC API user (System → Web Services), and the shop’s currency, which its API cannot tell. |
| SmartBill Cloud | smartbill |
{ "username", "token", "cif" }: the account’s login email, its API token (Contul meu → Integrari → API), and the company’s CIF. No baseUrl. |
| Intercom | intercom |
{ "accessToken" }: an access token that can read conversations, contacts and admins. baseUrl is the workspace’s region (see Intercom); replyChannelAddress is required. |
Connecting
Section titled “Connecting”curl -X POST "https://api.motenya.app/v1/products/$PRODUCT/integrations" \ -H "Authorization: Bearer $MOTENYA_KEY" -H "Content-Type: application/json" \ -d '{ "type": "magento2", "name": "Casa Verde RO", "baseUrl": "https://casa-verde.ro", "credentials": { "accessToken": "…" }, "historyMode": "months", "historyMonths": 12 }'The shop is contacted first; a refusal comes back as CONNECTION_REFUSED (credentials) or CONNECTION_FAILED (anything else), with a message saying what to check. POST …/integrations/test runs the same check without saving. Credentials are stored encrypted and never returned; credentialsHint shows which ones are stored.
Each website of the shop becomes a store. historyMode sets how far back the first sync reaches: none (only changes from now on), months (the last historyMonths, 12 by default) or full.
What it brings in
Section titled “What it brings in”- Catalog: products, with their SKU and price.
- Customers: each one a client (a company when their default billing address names one) with their person as a contact. Someone already in the CRM with the same email is the same person.
- Orders: with their store, buyer, status, payment status (from the order’s totals), totals, addresses and lines. Guest orders find or create the contact by email.
Records keep the shop’s ids under the integration’s source (magento2:<integration id>), so GET …/sync/orders/{source}/{orderId} finds an order by its Magento id.
Status
Section titled “Status”An integration reports phase (history until the first sync finishes, then live), counts of records synced and refused, the last refused record, and syncedUntil: everything changed in the shop before it is in the CRM.
When the shop does not answer or asks to slow down, the integration retries in five minutes and says so in lastError. When it refuses the credentials, the integration’s status becomes error and it waits: replace the credentials or the address (PATCH …/integrations/{id}) and it starts again. POST …/integrations/{id}/sync runs it now. Deleting an integration keeps what it synced.
Managing integrations needs crm:configure; reading them, crm:read.
SmartBill
Section titled “SmartBill”SmartBill’s API cannot list or search invoices: it only answers, for one invoice at a time, how much of it is paid. So the invoices come from an export, and Motenya keeps their payment status current.
- Connect with
type: "smartbill". The credentials are checked by reading the account’s invoice series. The company becomes a store (platformsmartbill). - Import the invoices, up to 100 per call. In the admin, the integration’s Import invoices button reads a CSV exported from SmartBill and maps its columns.
curl -X POST "https://api.motenya.app/v1/products/$PRODUCT/integrations/$ID/invoices" \ -H "Authorization: Bearer $MOTENYA_KEY" -H "Content-Type: application/json" \ -d '{ "invoices": [ { "series": "FAC", "number": "0142", "issuedAt": "2026-10-01", "dueAt": "2026-10-15", "clientName": "Brutăria Lungu SRL", "clientVatNumber": "RO998877", "total": "119.00", "tax": "19.00", "paidAmount": "0" } ] }'Each invoice becomes an order of the company store, numbered SERIES-NUMBER and kept under the integration’s source by that id, with its client (matched by VAT number, else by name; with clientEmail, also a contact). Its payment status comes from paidAmount: paid in full, partly, or not at all (no paidAmount counts as not paid). Credit notes (a total of zero or less) count as paid. Each row succeeds or fails on its own, and importing the same invoices again updates them; an invoice the CRM already has as paid stays paid. Importing needs crm:write.
- The daily check asks SmartBill about every imported invoice still unpaid or partly paid, and updates its payment status (and the paid date, for revenue). SmartBill allows 30 calls per 10 seconds per token, so the check is paced and a large backlog may take several minutes; if SmartBill asks it to slow down, it resumes 15 minutes later.
paymentCheckon the integration reports the pass under way and the last one: invoices checked, changed, and not found in SmartBill (deleted there, or mistyped in the export).POST …/integrations/{id}/syncruns a check now.
Intercom
Section titled “Intercom”An Intercom integration moves a help desk over: Intercom’s contacts become CRM contacts, and its conversations become tickets with their whole thread, from the history you choose. It keeps them up to date every 15 minutes for as long as it stays connected, so you can switch over when you’re ready, or keep answering in Intercom and use Motenya for the CRM.
curl -X POST "https://api.motenya.app/v1/products/$PRODUCT/integrations" \ -H "Authorization: Bearer $MOTENYA_KEY" -H "Content-Type: application/json" \ -d '{ "type": "intercom", "name": "Intercom", "credentials": { "accessToken": "…" }, "replyChannelAddress": "support@casa-verde.in.motenya.app", "historyMode": "full" }'- Token: in Intercom, Settings → Integrations → Developer Hub, create an app and copy its access token. It needs to read conversations, contacts and admins.
- Region:
baseUrlishttps://api.intercom.io(US, the default),https://api.eu.intercom.ioorhttps://api.au.intercom.io. - Reply channel: the inbound address of one of the product’s email channels. Replies to imported tickets go out from it.
What comes over:
- Contacts and leads with an email become CRM contacts, under the integration’s
source. - Conversations become tickets: the customer’s messages, the team’s replies and internal notes, with their original times and attachments (copied, up to 25 MB each). Each Intercom teammate is matched to a Motenya teammate by email; anyone unmatched keeps their name on their messages. Open, snoozed and closed conversations keep their state, assignee, priority and tags. Nothing is emailed, and old messages don’t show as unread.
- Every sync adds new conversations, and new messages to tickets already imported. A ticket takes Intercom’s latest state, assignee, priority and tags when Intercom changed it after anyone in Motenya did; a ticket marked spam or ignored in Motenya stays so. Nothing that comes over this way is emailed or shows as unread, and auto-close never emails a customer about a ticket whose last reply came from Intercom.
- Long threads keep their newest 500 messages. A file Intercom no longer serves is kept as unavailable.
- If a sync stops (the token was revoked, the reply channel removed), the integration shows the error; fix it and it carries on from where it was.
Progress counts customer and conversation records. Imported tickets show where they came from in importedFrom (intercom:<integration id>, lowercase).
Intercom’s newer Tickets (as opposed to conversations) aren’t brought over yet. To move from another help desk, use POST …/tickets/import (see Moving to Motenya).