Skip to Content
Errors

Errors

Error responses use the Problem Details format (RFC 9457).

When a call fails, the API returns an HTTP status code and a body in the standard Problem Details format (RFC 9457). The content type is application/problem+json.

HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
X-Request-Id: 01JD3W6Y7P4T

{
  "type": "https://docs.ajour.dk/errors/date-range-too-long",
  "title": "Date range is too long",
  "status": 422,
  "detail": "Sales lines allow at most 92 days. You asked for 120.",
  "requestId": "01JD3W6Y7P4T",
  "errors": { "to": ["Must be at most 92 days after from."] }
}
FieldMeaning
typeA link to a page that explains the error. Use it in your code to tell errors apart. It does not change.
titleA short summary of the error type.
statusThe HTTP status code.
detailWhat went wrong in this request. The text can change. Do not use it in your code.
requestIdThe same id as the X-Request-Id header. Send it to Ajour support when you report a problem.
errorsOnly for invalid parameters: messages per parameter.

Error types

StatusTypeWhen
400invalid-parameterA parameter has the wrong format or an unknown value.
400impersonation-not-allowedThe request has the Impersonation-Company-Id header.
400key-in-urlAn API key was found in the URL.
401unauthorizedThe key is missing, wrong, revoked or expired.
403missing-scopeThe key does not have the scope the call needs.
403company-inactiveThe company's Ajour account is not active.
403report-needs-all-locationsThe report needs a key for all locations.
404not-foundThe item does not exist, or the location is outside the key.
422validation-failedto is before from.
422date-range-too-longThe period is longer than the endpoint allows.
422location-requiredA key for several locations must name one locationId for a report.
429rate-limitedToo many requests. Wait for Retry-After seconds.
503report-timeoutA report took longer than 90 seconds.

Which errors to retry

  • Retry 429 after the Retry-After seconds.
  • Retry 503 with a shorter period.
  • Retry network errors and other 5xx errors with a growing wait, for example 1, 2, 4 and 8 seconds.
  • Do not retry 400, 401, 403, 404 or 422. Fix the request first.

On this page