Errors
Status codes and the shape of every error.
Errors use HTTP status codes and a JSON body. message is written for people: you can show it to customers as it is.
{
"statusCode": 400,
"error": "Bad Request",
"message": "Pick a day in the next 30 days"
}A body that doesn't fit the endpoint's schema says which fields are wrong:
{
"statusCode": 400,
"message": "Validation failed",
"issues": {
"formErrors": [],
"fieldErrors": {
"customerPhone": ["Enter a valid phone number"],
"lines": ["Add at least one item"]
}
}
}Status codes
| Status | Meaning | What to do |
|---|---|---|
200 OK, 201 Created | It worked. | |
400 Bad Request | The request is wrong: a missing field, a sold-out item, a time no longer free. | Show message, or the field errors next to their fields. |
401 Unauthorized | No key, or not a current one. | Check the key in Settings › Developers. |
403 Forbidden | The key is not allowed on this site. | Add the site under Allowed sites. |
404 Not Found | No such product, order or service, or the store is closed. | |
409 Conflict | A request with the same Idempotency-Key is still running. | Wait a moment and retry. |
429 Too Many Requests | Too many requests in a minute. | Back off and retry: see Rate limits. |
5xx | Something went wrong on Cashiar's side. | Retry with the same Idempotency-Key. |