Error format and error codes

Integrations should be able to understand and resolve errors quickly.

Error format

{
  "type": "https://docs.ordinavo.de/errors/validation_failed",
  "title": "Validation failed",
  "status": 400,
  "code": "validation_failed",
  "detail": "One or more fields are invalid.",
  "traceId": "00-85f1ac0ed64147f499c20e04af2a1c19",
  "errors": {
    "location.postalCode": [
      "Postal code is required."
    ],
    "preferredTimeWindows[0].from": [
      "Start time must be before end time."
    ]
  }
}

Error codes

CodeDescription
invalid_requestThe request is syntactically invalid.
validation_failedRequired fields are missing or values are invalid.
unauthorizedAuthentication is missing or invalid.
forbiddenThe integration is not allowed to perform this action.
not_foundThe requested resource was not found.
conflictThe request conflicts with the current state.
idempotency_conflictThe idempotency key was already used with different content.
rate_limitedThe rate limit was exceeded.
unsupported_service_typeThe specified service type is not enabled.
internal_errorAn internal error occurred.

Status codes

200 OK 201 Created 202 Accepted 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 409 Conflict 422 Unprocessable Entity 429 Too Many Requests 500 Internal Server Error