Errors and retries
A refusal is never a bare status code. It is a structured object on the answer's errors list, with a class, a code inside the class, a retry verdict and words you can show. This guide is the grammar and the one retry rule.
The shape
{
"data": null,
"errors": [
{
"message": "That record could not be found.",
"extensions": {
"major": "NOT_FOUND",
"minor": "CONSTRUCT",
"retryable": false,
"severity": "needs_decision",
"why": "No record with that reference exists in this organization.",
"next": "It may have been removed, or it is outside this organization."
}
}
],
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Each refusal has two parts. message is the refusal in plain words. extensions carries the code: major names the class, minor the code inside it, and retryable says whether what you asked for can still succeed. detail appears there when the refusal has more to say. severity, why and next appear there when the platform has words for the code: how serious it is, why it happened, and what to do. Read the code from extensions — the error itself carries message only. The answer still carries extensions.at with its callId — quote it when a refusal needs a look.
The 12 classes
VALIDATION · AUTHN · AUTHZ · NOT_FOUND · CONFLICT · RATE_LIMIT · PAYMENT · FULFILLMENT · TAX · FISCAL · INTEGRATION · INTERNAL — 113 codes in all, every one on the errors pages with what happened, why, what to do, and whether to retry.
Four codes every call can answer
VALIDATION/INVALID— the request itself is not acceptable: a missing field, a bad value, an unknown filter field. Fix the request.AUTHN/REQUIRED— no session token, or an expired one. Exchange the key again (Authentication and key hygiene).AUTHZ/FORBIDDEN— the key's scope does not allow this operation. A wider scope is a new key.RATE_LIMIT/THROTTLED— too many calls in the window; retryable after the wait it names (Rate limits).
Beyond the four: an operation that takes an id can answer NOT_FOUND; a change can answer CONFLICT — the record's state, or an edit made in the meantime, does not allow it — and VALIDATION/VERSION_REQUIRED when the envelope named no version. Each operation page lists exactly the codes it can answer.
The one retry rule
retryable says whether the refusal is final. When it is false, the call cannot succeed as it stands. Change something first: the values, the record's state, or who is calling. Retrying a false refusal unchanged only repeats it.
When it is true, what you asked for can still succeed, after the thing the refusal names has changed. next says what that is. There are three kinds:
- Time. The platform was busy, or you sent too fast. Wait, then send the same call again. A
RATE_LIMIT/THROTTLEDrefusal names how long indetail.retryAfterSeconds. - Something the call depends on. A rate, a source or a step is missing or not finished.
CONFLICT/NO_EFFECTIVE_RATEis one such code. Do whatnextsays, then send the same call again. - The record itself.
CONFLICT/REVISION_STALEsays the record changed after you read it. Never send a call that carries a revision again unchanged. The revision it carries is no longer the record's, so the platform refuses the same call every time. Read the record again. Apply your change to what you read. Send the call with the new revision. A stock movement carries no revision. Send it again as it is.
No answer is not a refusal
A call can end with no answer: a timeout, or a dropped connection. You then do not know whether the change landed. Read first. Send the change again only when the read shows it did not land. A create that landed and is sent again can make a second record.
Sign-in refusals say one thing
A failed key exchange answers AUTHN/LOGIN_FAILED whatever the cause: an unknown, expired or retired key, and an organization the key does not reach, all read the same. Nothing leaks about which keys exist, so do not branch on the cause — check the secret and the organization, and mint a new key if in doubt.
Every code's verdict
The retry verdict of every code, as the platform answers it — the same table the errors pages carry, in one place:
| Code | Retry | What happened |
|---|---|---|
VALIDATION/INVALID | no | Something in the request is not valid. |
VALIDATION/UNKNOWN_FIELD | no | The request named a field this system does not recognize. |
VALIDATION/VERSION_MISMATCH | no | The app version does not match the server. |
VALIDATION/VERSION_DISCONTINUED | no | This app version is no longer supported. |
VALIDATION/VERSION_REQUIRED | no | The request did not say which app version it came from. |
VALIDATION/EMPTY_SCOPE | no | The selection matched nothing to count. |
VALIDATION/UNSUPPORTED | no | That option is recognized but not available yet. |
VALIDATION/UNSUPPORTED_CURRENCY | no | That currency is not supported for selling yet. |
VALIDATION/CURRENCY_NOT_ALLOWED | no | That currency is not in the organization’s allowed list. |
VALIDATION/DRY_RUN_UNSUPPORTED | no | This operation cannot be tried dry. |
VALIDATION/IDENTITY | no | The subject identity could not be verified. |
VALIDATION/COUPON_INELIGIBLE | no | This coupon does not apply to this order. |
AUTHN/REQUIRED | no | Sign in to do this. |
AUTHN/SESSION_EXPIRED | no | Your session has ended. |
AUTHN/LOGIN_FAILED | no | The sign-in was not accepted. |
AUTHN/DEVICE_SESSION_INVALID | no | This device is no longer signed in or registered. |
AUTHZ/FORBIDDEN | no | Your role does not allow this action. |
AUTHZ/APPROVAL_REQUIRED | no | This action needs approval. |
AUTHZ/INSUFFICIENT | no | Approving this needs a higher authority level than yours. |
AUTHZ/SELF_APPROVAL | no | You cannot approve your own request. |
AUTHZ/INVALID_PAIRING | no | That pairing code was not accepted. |
AUTHZ/PAIRING_EXPIRED | yes | That pairing code has expired. |
NOT_FOUND/CONSTRUCT | no | That record could not be found. |
NOT_FOUND/IDENTIFIER | no | Nothing matches that identifier. |
NOT_FOUND/BOOKMARK | no | That bookmark no longer exists. |
NOT_FOUND/REACTION | no | That reaction is not yours to remove. |
NOT_FOUND/APPDATA | no | That saved setting does not exist. |
NOT_FOUND/MESSAGE | no | That message could not be found in your inbox. |
NOT_FOUND/NOTIFICATION | no | That notice could not be found. |
NOT_FOUND/MAIL | no | No mail sent to you answers that reference. |
NOT_FOUND/COUPON | no | No active coupon matches that code. |
CONFLICT/FSM_TRANSITION_INVALID | no | The record is in a status that does not allow that change. |
CONFLICT/IMMUTABLE | no | That part of the record can never be changed. |
CONFLICT/REFERENCED | no | Other records still point at this one. |
CONFLICT/INCOMPLETE | yes | The work is not finished yet. |
CONFLICT/REF_STATE | no | A record this depends on is not in a usable state. |
CONFLICT/REVISION_STALE | yes | Someone else changed this record while you were working. |
CONFLICT/RECONCILE | yes | The system is reconciling this record. |
CONFLICT/IDENTITY_TAKEN | no | That value is already used by another record. |
CONFLICT/UNSELECTED | no | This organization has not selected that catalog item. |
CONFLICT/CURRENCY_FLOOR | no | This change would leave products without a price in the organization currency. |
CONFLICT/SKU_TAKEN | no | That SKU has already been used and can never be reused. |
CONFLICT/PRICE_WINDOW_OVERLAP | no | The dates overlap an already-scheduled price. |
CONFLICT/RATE_WINDOW_OVERLAP | no | The dates overlap an already-scheduled tax rate. |
CONFLICT/INSUFFICIENT_STOCK | no | There is not enough stock at that location for this move. |
CONFLICT/DISCREPANCY | no | The received quantities do not match what was shipped. |
CONFLICT/IN_PROGRESS | no | Something else is already in progress on this record. |
CONFLICT/REJECTED | no | The approval for this was rejected. |
CONFLICT/UNRESOLVED | no | An open discrepancy must be resolved before this can complete. |
CONFLICT/NO_SOURCE | yes | No location is available to source this from. |
CONFLICT/SOURCING_FAILED | yes | The sourcing step could not complete. |
CONFLICT/VARIANCE_REVIEW | no | The count variance is over the review threshold. |
CONFLICT/THREE_WAY_MATCH | no | The received quantity exceeds what the purchase order allows. |
CONFLICT/CREDIT_MISMATCH | yes | The recorded vendor credit does not match the expected amount. |
CONFLICT/EXPIRED | no | An attached document is outside its validity window. |
CONFLICT/UNSETTLED | no | There is an outstanding balance on this. |
CONFLICT/RECOGNIZED | no | This invoice already has recognized revenue. |
CONFLICT/SETTLED | no | The amount on this note has already settled. |
CONFLICT/SAGA_LOCKED | yes | Another operation is holding this record. |
CONFLICT/SEARCH_JOB_ACTIVE | yes | A search is already running for this session. |
CONFLICT/EXPORT_JOB_ACTIVE | yes | An export is already running for this session. |
CONFLICT/FILL_DRAFT_ACTIVE | yes | A draft is already being made for you. |
CONFLICT/STEP_FAILED | no | A step in this operation failed and it is being rolled back. |
CONFLICT/OVER_RETURNABLE | no | The return quantity exceeds what is left to return on this order line. |
CONFLICT/NOT_RETURNABLE | no | That order line is marked final sale or non-returnable. |
CONFLICT/OVER_SHORT_REVIEW | no | The till over/short amount is over the review threshold. |
CONFLICT/DOUBLE_BOOKED | no | That time is fully booked on a requested resource. |
CONFLICT/OVER_TENDERED | no | The amount exceeds what this order can take. |
CONFLICT/TENDERED | no | Money is already held on this order. |
CONFLICT/FX_WINDOW_OVERLAP | no | The dates overlap an already-scheduled exchange rate. |
CONFLICT/POLICY_WINDOW_OVERLAP | no | The dates overlap an already-scheduled policy value. |
CONFLICT/NO_EFFECTIVE_RATE | yes | No exchange rate covers that currency pair right now. |
CONFLICT/BACKORDER | yes | There is not enough stock available to start picking. |
CONFLICT/PACK_VERIFY | no | Pack verification did not pass. |
CONFLICT/COUPON_CODE_TAKEN | no | Another active coupon already uses that code. |
CONFLICT/COUPON_EXPIRED | no | That coupon is outside its validity window. |
CONFLICT/BOOKMARK_EXISTS | no | This is already bookmarked. |
CONFLICT/REACTION_EXISTS | no | You already reacted with that emoji on this note. |
CONFLICT/BOOKMARK_CAP | no | You have reached the bookmark limit. |
CONFLICT/TRAINING_CAP | no | This training limit has been reached. |
CONFLICT/TRAINING_ATTEMPT_OPEN | no | You already have an open sitting for this course. |
CONFLICT/TRAINING_TOO_FEW_QUESTIONS | no | This course has too few questions to test yet. |
CONFLICT/TRAINING_PRACTICE_NOT_OPEN | no | No practice is open for this course. |
CONFLICT/APPDATA_CAP | no | This app has reached its saved-settings limit. |
CONFLICT/COUPON_EXHAUSTED | no | That coupon has reached its redemption limit. |
CONFLICT/INSTRUMENT_CODE_TAKEN | no | That code has already been used by a gift card or credit and can never be reused. |
CONFLICT/NOT_RELOADABLE | no | That instrument cannot be reloaded. |
CONFLICT/INSUFFICIENT_BALANCE | no | The amount exceeds the available balance. |
CONFLICT/BALANCE_OUTSTANDING | no | There is still a balance on this. |
CONFLICT/INSUFFICIENT_POINTS | no | The member does not have enough points for that. |
CONFLICT/MEMBER_EXISTS | no | That email is already enrolled in this program. |
CONFLICT/REFERRAL_CODE_TAKEN | no | An active affiliate already uses that referral code. |
CONFLICT/LIST_PRICE_WINDOW_OVERLAP | no | The dates overlap an already-scheduled price list entry. |
CONFLICT/CREDIT_LIMIT | no | This charge would exceed the customer credit limit. |
CONFLICT/ORDER_MINIMUM | no | The order is below this customer minimum order value. |
CONFLICT/INSUFFICIENT_AR_BALANCE | no | The amount exceeds the customer outstanding balance. |
CONFLICT/ERASE_FAILED | yes | The erasure could not finish in one go — the customer is not yet marked erased. |
PAYMENT/AUTH_DECLINED | yes | The payment was declined. |
PAYMENT/CAPTURE_FAILED | yes | The payment capture failed but the authorization still stands. |
PAYMENT/SETTLEMENT_FAILED | yes | The payment is captured and safe, but settlement did not reconcile. |
PAYMENT/REFUND_FAILED | yes | The refund could not be processed. |
PAYMENT/READER_UNAVAILABLE | yes | The card reader is busy or offline. |
FULFILLMENT/FAILED | yes | The fulfillment step could not complete. |
RATE_LIMIT/THROTTLED | yes | Too many requests in a short time. |
RATE_LIMIT/LOGIN_LOCKED | yes | Too many failed sign-in attempts. |
INTEGRATION/UNAVAILABLE | yes | An outside service is temporarily unavailable. |
INTEGRATION/TIMEOUT | yes | An outside service did not answer in time. |
INTEGRATION/REPLY_TOO_LONG | no | The reply ran past the length one request may carry. |
FISCAL/CLEARANCE_FAILED | no | The tax authority declined to authorize this sale. |
FISCAL/CLEARANCE_TIMEOUT | yes | The tax authority did not answer in time. |
FISCAL/REGIME_UNCONFIGURED | no | No certified fiscal provider is configured for this regime. |
INTERNAL/UNEXPECTED | no | An unexpected error occurred. |
INTERNAL/WALL | no | This request took longer than the service allows. |