CartirraAPI
Get API keys

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"
  }
}
  • code is stable: branch on it. Codes are never renamed or reused.
  • message is for people. It may change, so don't parse it.
  • details is optional extra context, such as field errors or what is still refundable.
  • request_id identifies the request in our logs. Include it when you contact support. To use your own id, send an X-Request-Id header (up to 128 of A–Z a–z 0–9 . _ : -); Cartirra uses it as the request_id.

Status codes

StatusMeaningWhat to do
400The request is malformed or fails validationFix the request; don't retry as-is
401Missing, invalid or wrong kind of keyCheck the key and the header format
403The key isn't allowed to do thisCheck the permission, or that live mode is on
404Not found, or not in this business and modeCheck the id and that you're using the right mode's key
409Conflicts with the current stateRead the resource again, then decide
410Gone (for example an expired checkout session)Create a new one
422Understood, but breaks a business ruleRead code and message; change the request
429Too many requestsWait for Retry-After seconds, then retry
5xxSomething failed on our sideRetry with backoff, using the same Idempotency-Key

Common codes

CodeStatusMeaning
validation_failed400A field is missing or invalid; see details.fields
invalid_amount400An amount isn't a valid decimal string
unauthenticated401No usable key (see Authentication)
credential_not_accepted401A public key or sign-in token on a secret-key route
permission_denied403The key can't call this route
live_mode_not_enabled403Live key before go-live
not_found404No such resource for this business and mode
order_not_cancellable409Only unpaid orders can be cancelled; refund paid ones
invalid_status_transition409The order can't move to that status from where it is
checkout_session_completed409The session already became an order
checkout_session_expired410The session expired; create a new one
currency_mismatch422The amount's currency differs from the order's
minimum_order_not_met422The items total is below your minimum order; details has the minimum and how much is missing
payment_method_not_available422For example, marking pay on delivery collected on an order paid another way
payment_link_inactive / payment_link_expired / payment_link_used_up410The payment link no longer takes orders
bill_not_open409The bill is closed or voided
bill_edit_not_allowed409Payments have started: only a manager can change the bill, and not below what's paid
bill_has_pending_payments409Guests are still paying: wait, or close with force
table_name_taken409The store already has a table with that name
pay_at_table_not_enabled403Pay at table is off at this store: turn it on with PUT /v1/stores/{store_id}/pay-at-table
refund_not_allowed409Nothing (or not that much) left to refund
insufficient_balance422Not enough available balance for this refund
idempotency_key_reused422The key was used for a different request
idempotency_request_in_progress409The first request with this key is still running
rate_limited429See Rate limits
internal500Our 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.