Create or update a subscription by its id in your system
const url = 'https://api.motenya.app/v1/products/example/sync/subscriptions/erp/C-1042';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"contactId":"example","clientId":"example","catalogItemId":"example","storeId":"example","planName":"example","status":"trialing","amount":"149.90","currency":"RON","interval":"day","intervalCount":1,"seats":1,"startedAt":"2026-11-21T09:30:00Z","trialEndsAt":"2026-11-21T09:30:00Z","currentPeriodEnd":"2026-11-21T09:30:00Z","canceledAt":"2026-11-21T09:30:00Z","endsAt":"2026-11-21T09:30:00Z","custom":"example","storeExternalId":"example","contactExternalId":"example","clientExternalId":"example","catalogItemExternalId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.motenya.app/v1/products/example/sync/subscriptions/erp/C-1042 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "contactId": "example", "clientId": "example", "catalogItemId": "example", "storeId": "example", "planName": "example", "status": "trialing", "amount": "149.90", "currency": "RON", "interval": "day", "intervalCount": 1, "seats": 1, "startedAt": "2026-11-21T09:30:00Z", "trialEndsAt": "2026-11-21T09:30:00Z", "currentPeriodEnd": "2026-11-21T09:30:00Z", "canceledAt": "2026-11-21T09:30:00Z", "endsAt": "2026-11-21T09:30:00Z", "custom": "example", "storeExternalId": "example", "contactExternalId": "example", "clientExternalId": "example", "catalogItemExternalId": "example" }'Idempotent: the first call creates it, later calls with the same source and external id update the fields sent. References to other records can use their ids in the same source (…ExternalId).
Requires crm:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The system the record comes from, named by you: e.g. magento2:casa-verde, stripe, erp.
Example
erpThe system the record comes from, named by you: e.g. magento2:casa-verde, stripe, erp.
The record’s id in that system.
Example
C-1042The record’s id in that system.
Request Bodyrequired
Section titled “Request Bodyrequired”object
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
False when an existing record was updated (found by external id, or matched).
object
object
object
Amount per month, for MRR.
object
Example
{ "record": { "status": "trialing", "interval": "day" }}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