Create or update up to 100 records of any type in one call
const url = 'https://api.motenya.app/v1/products/example/sync/batch';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"source":"erp","records":[{"entity":"store","externalId":"C-1042","data":{"name":"example","currency":"RON","baseUrl":"example","platform":"manual"}}]}'};
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/sync/batch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "source": "erp", "records": [ { "entity": "store", "externalId": "C-1042", "data": { "name": "example", "currency": "RON", "baseUrl": "example", "platform": "manual" } } ] }'Records are applied in order, each on its own: a failing record is rolled back and reported, and the rest still go through, so a record can name one sent earlier in the same batch. Use it to import history page by page. Store records need crm:configure.
Requires crm:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The system the record comes from, named by you: e.g. magento2:casa-verde, stripe, erp.
Example
erpApplied in order, each on its own: a record can name one sent earlier in the batch.
object
The record’s id in that system.
Example
C-1042object
ISO 4217 code, e.g. RON or EUR.
Example
RONobject
The record’s id in that system.
Example
C-1042object
Primary first; normalized to lowercase. Unique within the product.
Custom field values keyed by field key; null clears one. See GET /products/{productId}/custom-fields.
Clients (by their ids in the same source) to link the contact to.
object
The record’s id in that system.
Example
C-1042object
object
ISO 3166-1 alpha-2, e.g. RO.
Custom field values keyed by field key; null clears one. See GET /products/{productId}/custom-fields.
object
The record’s id in that system.
Example
C-1042object
A decimal amount as a string, e.g. “149.90”.
Example
149.90ISO 4217 code, e.g. RON or EUR.
Example
RONSet for something billed on a schedule (a plan).
Sold only in this store; null for every store.
Custom field values keyed by field key; null clears one. See GET /products/{productId}/custom-fields.
The store, by its id in the same source.
object
The record’s id in that system.
Example
C-1042object
Required unless the order bills a subscription; null takes a subscription’s invoice out of its store.
The order or invoice number; unique per store, or among orders without a store.
Makes the order a subscription’s invoice. On create, fills the customer, store, currency and a line for the plan unless given.
The billing period a subscription invoice covers.
Example
2026-11-21T09:30:00ZISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZThe store’s own status code, kept as is.
Null or omitted: not tracked, which counts as paid in lifetime value and revenue.
Now, when paid without one; unpaid or void clears it.
Example
2026-11-21T09:30:00ZISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZDefaults to the subscription’s or the store’s currency.
Example
RONA decimal amount as a string, e.g. “149.90”.
Example
149.90A decimal amount as a string, e.g. “149.90”.
Example
149.90A decimal amount as a string, e.g. “149.90”.
Example
149.90A decimal amount as a string, e.g. “149.90”.
Example
149.90A decimal amount as a string, e.g. “149.90”.
Example
149.90object
ISO 3166-1 alpha-2, e.g. RO.
object
ISO 3166-1 alpha-2, e.g. RO.
ISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00Zobject
A decimal amount as a string, e.g. “149.90”.
Example
149.90Defaults to quantity × unit price.
Example
149.90object
Custom field values keyed by field key; null clears one. See GET /products/{productId}/custom-fields.
object
The catalog item, by its id in the same source.
A decimal amount as a string, e.g. “149.90”.
Example
149.90A decimal amount as a string, e.g. “149.90”.
Example
149.90object
The store, by its id in the same source.
The contact, by its id in the same source.
The client, by its id in the same source.
The subscription it bills, by its id in the same source.
For buyers without an id (guest checkout): the contact with this email, created when new.
Replaces the shipments this source sent for the order; others’ stay.
object
ISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZThe record’s id in that system.
Example
C-1042object
ISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZReplaces the invoices and credit memos this source sent for the order; others’ stay.
object
A decimal amount as a string, e.g. “149.90”.
Example
149.90ISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZThe record’s id in that system.
Example
C-1042object
The record’s id in that system.
Example
C-1042object
A decimal amount as a string, e.g. “149.90”.
Example
149.90ISO 4217 code, e.g. RON or EUR.
Example
RONISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZWhen the current paid period ends (the renewal).
Example
2026-11-21T09:30:00ZISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZWhen access ends; leave unset while it renews.
Example
2026-11-21T09:30:00ZCustom field values keyed by field key; null clears one. See GET /products/{productId}/custom-fields.
The store, by its id in the same source.
The contact, by its id in the same source.
The client, by its id in the same source.
The plan, by its id in the same source.
Responses
Section titled “Responses”Success
object
object
Example generated
[ { "index": 1, "entity": "example", "externalId": "example", "ok": true, "id": "example", "created": true, "userErrors": [ { "code": "example", "message": "example", "field": [ "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