Errors

Structure and meaning of error responses.

Every error comes with the matching HTTP status and the content type application/problem+json following RFC 9457.

{
  "type": "https://docs.hfoods.de/en/docs/developers/errors#validation",
  "title": "Invalid input",
  "status": 422,
  "code": "validation_failed",
  "detail": "At least one field is invalid.",
  "requestId": "req_8f3a2c",
  "errors": [
    { "field": "/items/0/quantity", "code": "too_small", "message": "The quantity must be at least 1." }
  ]
}
  • code is meant for your program. It never changes within a major version.
  • title and detail are meant for humans and may change. Do not parse them.
  • requestId is also sent in the Request-Id header. Include it when you contact support.

Status codes

StatusMeaningRetry?
400The request is malformed.No, fix it first
401Missing or invalid key.No
403The key is not allowed to do this.No
404Not found, or it does not belong to your key.No
409The current state does not allow the action, or the Idempotency-Key was used with a different body.No
422The input is invalid.No, fix it first
429Too many requests.Yes, after Retry-After seconds
500, 502, 503Error on the hfoods side.Yes, with increasing delays and the same Idempotency-Key

Validation

With status 422, errors contains one entry per invalid field. field is a JSON Pointer to the location in your request.

On this page