When a request fails, success is false and an errors list says what went wrong. The HTTP status is never 200. Check success on every response before you treat a record as saved.
{
"success": false,
"errors": [
"Unable to find record"
]
}
Most entries in errors are plain messages. A few are objects with a code you can match on instead of the text, and data that describes the record involved.
{
"success": false,
"errors": [
{
"code": "record_not_found",
"data": {
"modelName": "Customer",
"externalId": "CUST-1001"
}
}
]
}
When a request refers to a record that has to exist first, such as the parent of a customer, the response can include a missingRecords list. Each entry names the kind of record and the id you used for it. Create those records, then send the original request again.
{
"success": false,
"errors": [
{
"code": "record_not_found",
"data": {
"modelName": "Customer",
"externalId": "PARENT-1001"
}
}
],
"missingRecords": [
{
"model": "Customer",
"externalId": "PARENT-1001"
}
]
}
The messages below are quoted exactly, so you can search this page for the text you received.