Errors

Errors

Every error shares the same structure, a stable code and a readable message.

Error structure

json
{
  "error": {
    "code": "validation_failed",
    "message": "The request contains invalid fields.",
    "details": [
      {
        "field": "type",
        "code": "invalid_value",
        "message": "Must be one of: company, private."
      }
    ]
  }
}

code is stable for your code. message is for humans and may change. details appears on validation errors per field. Optionally request_id is included.

HTTP status codes

StatusMeaning
200OK
201Created
204Deleted or success with no body (e.g. product delete)
401Missing or invalid API key
403Key missing required scope or module access
404Object missing or not in your environment
409Conflict (e.g. actor or module precondition)
422Validation failed, bad Content-Type or invalid JSON
429Too many requests — see Rate limits
500Server error. Try again later

Error codes

Common codes:

CodeMeaning
validation_failedValidation failed; see details per field
invalid_content_typeContent-Type is not application/json where required
not_found / *_not_foundResource not found
rate_limitedRate limit exceeded (429)
actor_requiredConflict: actor required
online_payments_disabledConflict: online payments disabled
incasso_disabledConflict: incasso disabled
mandate_already_verifiedConflict: mandate already verified

How to handle errors

  • Branch on error.code, never on message.
  • On 422, show details to your user — that is what they are for.
  • On 500 or timeout: retry with the same Idempotency-Key.