Errors

The error object, the shared codes with what to do for each, and what to send us when you ask for help.

On this page

An error is an HTTP status and a JSON object whose code never changes its meaning.

The error object

FieldMeaning
codeA stable code for the cause. Act on code.
messageA sentence to read in your logs. It can change, so do not show it to the people who use your software and do not match on it.
fieldsOn a 400, each field that is wrong and why. Absent otherwise.
requestIdThe identifier of this request. Quote it when you ask us for help.

Every answer, an error or not, also carries the header X-RDC-Request-Id with the same value.

The shared codes

Every product answers these. The last column says whether to send the request again.

StatusCodeMeaningRetry
400invalid_requestThe request cannot be read or breaks the contract: malformed JSON, a missing or unknown field, a wrong type. fields names each one.No. Fix the request.
401unauthorizedThe token is missing, expired or not ours.After you get a new token.
403forbiddenThe token does not give access to this company or operation.No.
404<thing>_not_foundThe record does not exist for this company.No.
409revision_conflictexpectedRevision is older than the record.Read the record again, then send a new operation.
409operation_reusedThis operationId was sent before with another body.No.
422A code of the product, such as blocked_by_checksThe request is well formed and a rule of the product refuses it.No. The code says what to change.
429rate_limitedToo many requests. Retry-After gives the seconds.Yes, after the pause.
503unavailableThe service cannot answer now.Yes, with the same operationId.

Codes of a product

A product adds codes for its own rules, always at 422 or as <thing>_not_found at 404. They are listed on the Errors page of the product docs, after the shared table. A product never renames a shared code or gives it another meaning.

A validation answer

A request that cannot be read or breaks the contract answers 400. fields names each field that is wrong, so one answer lists every problem.

Answer 400 invalid_request

{
  "code": "invalid_request",
  "message": "The request breaks the contract.",
  "fields": [
    {
      "field": "lines[0].quantity",
      "problem": "must be a decimal string such as \"24\""
    },
    {
      "field": "occurredAt",
      "problem": "is required"
    }
  ],
  "requestId": "req_8Kq2mT4vXz9N"
}

  • code is invalid_request: fix the request. Sending it again unchanged gives the same answer.
  • fields[].field is the path of the field, and problem says what is wrong with it.
  • requestId is the identifier to send us.

A conflict answer

When the record has changed since you read it, the change is answered with 409 revision_conflict. Nothing was applied.

Answer 409 revision_conflict

{
  "code": "revision_conflict",
  "message": "The balance changed after revision 6.",
  "requestId": "req_3Hd7vB1pLw5R"
}

  • Read the record again: its revision is now newer than the one you sent.
  • Decide whether your change still applies, then send it as a new operation, with a new operationId.

What to send us when you ask for help

  • The requestId of the answer.
  • The operationId of the change, if there was one.
  • The time, with the time zone.

In the product docs