OneBasket

Errors

The HTTP status codes the Storefront API returns and the format of error responses.

The Storefront API uses standard HTTP status codes. Error responses use the problem details format defined by RFC 7807.

Status codes

StatusMeaningWhat to do
200 OKThe request succeeded.
201 CreatedThe resource was created.
202 AcceptedThe request was accepted and is being processed. The body contains a notificationId.Poll the notification.
204 No ContentThe request succeeded and there is no body.
400 Bad RequestThe request is invalid. The errors field lists the invalid fields.Correct the request. Do not retry it unchanged.
401 UnauthorizedThe API key or the bearer token is missing or invalid.See Authentication.
404 Not FoundThe resource does not exist in this store.Check the id and the API key.
500 Internal Server ErrorOneBasket failed to process the request.Retry with a delay. Contact Stadion support if it continues.

Error response format

400 Bad Request
{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "Bad request",
  "status": 400,
  "detail": "One or more validation errors occurred.",
  "instance": "/kiosks",
  "errors": {
    "pageSize": ["The value must be greater than 0."]
  }
}
FieldTypeDescription
typestringA URI that identifies the problem type.
titlestringA short summary of the problem type.
statusnumberThe HTTP status code.
detailstringAn explanation of this occurrence of the problem.
instancestringA URI that identifies this occurrence of the problem.
errorsobjectOn 400 responses only. Keyed by field name.

The values in the example above are illustrative. Build your error handling on status and on the keys of errors, not on the text of title or detail.

Failures of asynchronous requests

An asynchronous request can be accepted and still fail later, for example when a provider rejects a product because it is out of stock. That failure is not reported as an HTTP error. It is reported as a notification with status: "failed". See Asynchronous operations.

Retries

  • Retry 500 responses and network failures with an increasing delay between attempts.
  • Do not retry 400, 401 or 404 responses without changing the request.
  • Before you retry a request that changes a basket, read the basket first. The first attempt may have succeeded.

On this page