Upsert custom data records
Creates or updates a batch of custom data records for the definition id_definition. When the definition declares unique_keys, records matching an existing combination are upserted in place; otherwise each record is inserted. Processing is asynchronous.
Relation fields — Fields linked to a system schema (e.g. contacts) accept two formats:
- Direct identifier (legacy): pass the canonical id (e.g.
id_contactfor contacts) as a number. - Resolver object
{ "by": "<identifier>", "value": <value> }: lets the API resolve the target server-side. Forcontacts, supportedbyvalues areid_contact,email, andid_customer(the customer id from your shop, mapped toid_customer_shop). The server resolves and stores the canonical id; you do not need to look upid_contactupfront.
Parameters
Header Parameters
[Authentication] Required API key.
"^[a-zA-Z0-9-]{20,64}$"Path Parameters
The ID of the custom data definition where the data will be saved or updated.
Request Body
Responses
Objects have been sent to the processing queue. Partially invalid objects are rejected and returned in rejected_items.
Upsert custom data records Creates or updates a batch of custom data records for the definition id_definition. When the definition declares unique_keys, records matching an existing combination are upserted in place; otherwise each record is inserted. Processing is asynchronous. Relation fields — Fields linked to a system schema (e.g. contacts) accept two formats: - Direct identifier (legacy): pass the canonical id (e.g. id_contact for contacts) as a number. - Resolver object { "by": "<identifier>", "value": <value> }: lets the API resolve the target server-side. For contacts, supported by values are id_contact, email, and id_customer (the customer id from your shop, mapped to id_customer_shop). The server resolves and stores the canonical id; you do not need to look up id_contact upfront. POST /v1/custom-data-records/{id_definition} saveCustomDataRecords Custom data records spm-api-key [Authentication] Required API key. id_definition The ID of the custom data definition where the data will be saved or updated. Array of custom data records to create or update. Each object must include all required fields. Objects have been sent to the processing queue. Partially invalid objects are rejected and returned in rejected_items. All objects are invalid, or the request body is not an array, or the array exceeds the maximum allowed size Server error - Internal processing failure