Core concepts
Errors and troubleshooting
One error shape everywhere. Branch on code, show message, and quote request_id when you contact support.
Every error has the same body, whatever went wrong:
{
"error": {
"code": "validation_failed",
"message": "The request is not valid",
"details": {
"fields": [{ "field": "lines.0.quantity", "problems": ["quantity must not be less than 1"] }]
},
"request_id": "0193a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
}
}
codeis stable: branch on it. Codes are never renamed or reused.messageis for people. It may change, so don't parse it.detailsis optional extra context, such as field errors or what is still refundable.request_ididentifies the request in our logs. Include it when you contact support. To use your own id, send anX-Request-Idheader (up to 128 ofA–Z a–z 0–9 . _ : -); Cartirra uses it as therequest_id.
Status codes
| Status | Meaning | What to do |
|---|---|---|
400 | The request is malformed or fails validation | Fix the request; don't retry as-is |
401 | Missing, invalid or wrong kind of key | Check the key and the header format |
403 | The key isn't allowed to do this | Check the permission, or that live mode is on |
404 | Not found, or not in this business and mode | Check the id and that you're using the right mode's key |
409 | Conflicts with the current state | Read the resource again, then decide |
410 | Gone (for example an expired checkout session) | Create a new one |
422 | Understood, but breaks a business rule | Read code and message; change the request |
429 | Too many requests | Wait for Retry-After seconds, then retry |
5xx | Something failed on our side | Retry with backoff, using the same Idempotency-Key |
Common codes
| Code | Status | Meaning |
|---|---|---|
validation_failed | 400 | A field is missing or invalid; see details.fields |
invalid_amount | 400 | An amount isn't a valid decimal string |
unauthenticated | 401 | No usable key (see Authentication) |
credential_not_accepted | 401 | A public key or sign-in token on a secret-key route |
permission_denied | 403 | The key can't call this route |
live_mode_not_enabled | 403 | Live key before go-live |
not_found | 404 | No such resource for this business and mode |
order_not_cancellable | 409 | Only unpaid orders can be cancelled; refund paid ones |
invalid_status_transition | 409 | The order can't move to that status from where it is |
checkout_session_completed | 409 | The session already became an order |
checkout_session_expired | 410 | The session expired; create a new one |
currency_mismatch | 422 | The amount's currency differs from the order's |
minimum_order_not_met | 422 | The items total is below your minimum order; details has the minimum and how much is missing |
payment_method_not_available | 422 | For example, marking pay on delivery collected on an order paid another way |
payment_link_inactive / payment_link_expired / payment_link_used_up | 410 | The payment link no longer takes orders |
bill_not_open | 409 | The bill is closed or voided |
bill_edit_not_allowed | 409 | Payments have started: only a manager can change the bill, and not below what's paid |
bill_has_pending_payments | 409 | Guests are still paying: wait, or close with force |
table_name_taken | 409 | The store already has a table with that name |
pay_at_table_not_enabled | 403 | Pay at table is off at this store: turn it on with PUT /v1/stores/{store_id}/pay-at-table |
refund_not_allowed | 409 | Nothing (or not that much) left to refund |
insufficient_balance | 422 | Not enough available balance for this refund |
idempotency_key_reused | 422 | The key was used for a different request |
idempotency_request_in_progress | 409 | The first request with this key is still running |
rate_limited | 429 | See Rate limits |
internal | 500 | Our fault. Retry with the same Idempotency-Key |
The full list is the code enum of the Error schema in the OpenAPI document.
Troubleshooting
Everything returns 404. You're probably using a test key on live ids or the other way round. The key decides the mode.
401 with a key that worked yesterday. The key was regenerated, or its rotation overlap ended. Check Developers → API keys.
A retry created a duplicate. Send an Idempotency-Key, and reuse the same key for every retry of that action. See Idempotency.
Amounts are off by a factor of 100. Amounts are decimal strings in the currency's main unit ("4500.00" is ₦4,500), not minor units.