Errors and retries
Understand what went wrong, what to fix, and when to try again.
Start with the HTTP status to decide what to do next, then read the error body
for details. Store API errors use the same JSON structure. OAuth protocol
endpoints use OAuth error responses described in OAuth authorization.
Validation errors also
include an errors object listing every field that needs fixing.
{
"type": "validation_error",
"code": "validation_failed",
"message": "The selected product variant id is invalid.",
"status": 422,
"param": "product_variant_id",
"request_id": "01992a65-e064-71ba-b38f-902b7966a6be",
"docs_url": "https://sell.app/docs/api/errors#validation-failed",
"errors": {
"product_variant_id": [
"The selected product variant id is invalid."
]
}
}Use type to group errors and code to choose a specific handling path in your
code. Read message for an explanation, but do not depend on its exact wording.
param names the first invalid field for a validation error and is otherwise
null. Keep request_id when asking support to investigate.
Error codes
| Status | Code | What it means | What to do |
|---|---|---|---|
400 | idempotency_key_required | A side-effecting mutation has no key. | Add a unique Idempotency-Key. |
400 | invalid_idempotency_key | The key is longer than 255 characters or contains control characters. | Send a shorter key made of printable characters, such as a UUID. |
400 | bad_request | The server could not understand the request. | Correct the request syntax or required headers. Do not retry unchanged input. |
401 | unauthenticated | The bearer key is missing, malformed, revoked, or unknown. | Add, replace, or correctly format the bearer key. |
403 | forbidden | The key's abilities or your store role don't allow the operation. | Check token abilities, store membership, and staff permissions. |
404 | resource_not_found | The route or resource isn't in the selected store. | Verify the path, resource ID, and the slug in X-STORE. |
409 | conflict | The request conflicts with the resource's current state. | Retrieve the resource again and check whether your change still makes sense. |
409 | idempotency_key_mismatch | The key was used with different input. | Create a new key for the new intent. |
409 | idempotency_in_progress | The first request is still running. | Wait briefly, then retry the identical request. |
410 | cursor_expired | A signed event cursor is outside the 30-day retention window. | Restart without the expired cursor and continue ordinary polling. |
410 | endpoint_gone | The operation was retired, or the export expired. | Use the replacement operation, or create a new export. |
422 | validation_failed | One or more fields are invalid. | Correct every field in errors; do not retry the same payload. |
429 | rate_limit_exceeded | Too many requests in the current minute. | Wait for Retry-After, then retry with exponential backoff and jitter. |
Other 4xx | request_failed | The request failed with no more specific code. | Read message, fix the request, then send it again. |
5xx | api_error | SellApp could not complete the operation. | Retry reads and idempotent writes within a finite budget. Keep the request ID. |
A 429 includes Retry-After; X-RateLimit-Reset gives the Unix reset time.
idempotency_key_required
The operation requires an Idempotency-Key header and the request had none.
Nothing was changed, so add a new key and send the request again.
invalid_idempotency_key
The Idempotency-Key header is longer than 255 characters or contains control
characters, such as a line break. Nothing was changed. Send the request again
with a valid key, such as a UUID.
bad_request
The server could not understand the request. A common
cause is omitting a header required by that route.
unauthenticated
The bearer key is missing, malformed, revoked, or unknown.
forbidden
The key is valid, but its abilities or the account's store permissions do not
authorize the operation.
resource_not_found
The route or resource was not found in the selected store. A resource belonging
to another store also looks missing; this keeps that store's information private.
conflict
The request conflicts with the resource's current state. Retrieve it again and
make the change only if it is still allowed.
idempotency_key_mismatch
An earlier request to the same operation used this key with different input,
such as another body, query string, or resource ID in the path. This request
was not applied. Use a new key if you meant a new change. See
Idempotency.
idempotency_in_progress
The first request with this key has not finished yet. Wait, then resend the
identical request. If the first request succeeded, the retry returns its stored
response with Idempotent-Replayed: true. If it failed, the retry runs as a
new request.
cursor_expired
The event cursor points outside the 30-day retention window. Poll the event
list at the response's fallback.url instead, starting again without the
expired cursor.
endpoint_gone
The operation was retired. Read x-sellapp-replacement from its OpenAPI entry
or follow the legacy v1 migration map.
Downloading an expired export also
returns 410 with this code. Create a new export instead.
validation_failed
Inspect errors, fix the named fields, and send a new request. Some operations
with a ledger or action key, such as
wallet adjustments, also report a reused key with different input as a
validation failure. On response-replay
operations, the same mistake
returns idempotency_key_mismatch instead.
rate_limit_exceeded
The caller exceeded the API's minute window. See Rate limits.
request_failed
The request failed with a 4xx status that has no more specific code, such as
405 when the route does not accept that HTTP method. Check status and
message, then correct the request.
api_error
SellApp could not complete the operation. Log the request ID. Retry only if the
method is safe or the write uses documented idempotency.
Retry example
When a retry is safe, wait longer between attempts (exponential backoff) and choose a random delay within that window (full jitter). This keeps all your workers from retrying at the same instant:
delay = random(0, min(30 seconds, 0.5 seconds × 2^attempt))Honor Retry-After when it is present. Stop after a bounded number of attempts
or elapsed time, and include the final request_id in your error report.