Errors
The shape of every refusal, every error code with its status, and what to do about each kind.
The shape of a refusal
When the API refuses a request, the status is in the 400s or 500s and the body always has this shape:
{
"error": {
"code": "not_found",
"message": "A listing with this id was not found."
},
"request_id": "req_8f3a1c5e7b9d2f4a6c8e0b1d"
}| Field | Type | Description |
|---|---|---|
error | object | The refusal: its code, its message and, for some codes, more about it. |
error. | string | What went wrong, for your program to act on. One of invalid_request, invalid_json, unauthorized, forbidden, insufficient_scope, account_unavailable, api_not_enabled, kyc_required, test_only, not_found, route_not_found, method_not_allowed, conflict, listing_changed, listing_locked, listing_busy, listing_has_sales, seats_taken, sale_not_deliverable, idempotency_in_progress, sandbox_full, payload_too_large, unsupported_media_type, validation_failed, idempotency_key_reused, precondition_required, rate_limited, internal_error, marketplace_error, service_unavailable or api_suspended. |
error. | string | What went wrong, in a sentence for the person reading the log. It may be reworded, so do not match on it. |
error.optional | map of string to any value | More about the refusal, for the codes that have something to add. |
request_id | string | The id of the request, as in the X-Request-Id header. Name it when you write to us. |
code is for your program: branch on it. message is for the person who reads the log, and may be worded differently tomorrow. The status says what kind of refusal it is, and several codes share a status.
A refusal changes nothing: what the request asked for did not happen. Only 500 internal_error cannot promise that. After one, read the object again before you decide what to send.
Values the API does not take
422 validation_failed names every value it did not accept under details.issues, each with the path of the value in your request and a message. This body for POST /v1/listings writes the seats as one entry and the amount with a comma:
{
"event_id": "6718d2f4a9c3b17e5d204a61",
"listings": [
{
"section": "112",
"row": "F",
"seats": ["14-15"],
"price_per_ticket": { "amount": "412,00", "currency": "USD" }
}
]
}The answer names both:
{
"error": {
"code": "validation_failed",
"message": "2 values are not accepted.",
"details": {
"issues": [
{
"path": "listings[0].seats[0]",
"message": "A seat is 1 to 10 letters or digits."
},
{
"path": "listings[0].price_per_ticket.amount",
"message": "Send the amount as a decimal string like \"412.00\"."
}
]
}
},
"request_id": "req_8f3a1c5e7b9d2f4a6c8e0b1d"
}A path reads like the request: listings[0].seats[0] is the first seat of the first ticket group. A field the endpoint does not know is refused the same way.
What to do about each kind
| Kind | Statuses | What to do |
|---|---|---|
| The request is wrong | 400, 413, 415, 422 | Fix the request. Sent again unchanged, it gets the same answer. |
| The key or the account | 401, 403 | Check the key, what it was given and the account behind it. Do not retry. |
| Not there | 404, 405 | Check the id, the path and the method. |
| The state does not allow it | 409, 428 | Read the object again, decide anew and send a new request. Only listing_busy and idempotency_in_progress are worth sending again as they are, after a short wait. |
| Too many requests | 429 | Wait as long as the Retry-After header says, then go on. |
| Our side, or a marketplace | 500, 502, 503 | Send the request again a little later, with the same Idempotency-Key. Only after internal_error read the object again first: the request may have changed something, and the same key gives the same answer again, so send what is still missing with a new key. If it keeps coming back, write to us with the request id. |
Send a request again only when it can go through the next time: after 429 rate_limited, 409 listing_busy, 409 idempotency_in_progress, 502 marketplace_error, 503 service_unavailable or 503 api_suspended, and after a connection that broke before an answer came. Give every changing request an Idempotency-Key, so that sending it again never does the same thing twice. Safe retries explains how.
Every code
The request is wrong
| Status | Code | What it means |
|---|---|---|
400 | invalid_request | The request is not one the API understands: a parameter is missing or has the wrong form. |
400 | invalid_json | The body is not a JSON object. |
413 | payload_too_large | The body is larger than the API takes. |
415 | unsupported_media_type | A body has to be sent as application/json. |
422 | validation_failed | The request was understood, but its values are not accepted. details.issues lists each problem with its path. |
422 | idempotency_key_reused | This Idempotency-Key was used for a different request. |
The key or the account
| Status | Code | What it means |
|---|---|---|
401 | unauthorized | No API key, or one that is unknown, revoked or expired. |
403 | forbidden | The key is valid, but this is not something it may do. |
403 | insufficient_scope | The key lacks the permission this endpoint needs. details.required names it. |
403 | account_unavailable | The account behind the key cannot use the API right now: it is not active, its setup is unfinished or two-factor authentication is off. |
403 | api_not_enabled | The Seller API is not switched on for this account yet. |
403 | kyc_required | Changing listings or delivering sales with a live key needs a verified identity on SyncSeats. |
403 | test_only | This endpoint belongs to the sandbox and takes test keys only. |
Not there
| Status | Code | What it means |
|---|---|---|
404 | not_found | Nothing with this id belongs to the account. Something that never existed, was deleted or is someone else’s answers the same. |
404 | route_not_found | The API has no endpoint at this path. |
405 | method_not_allowed | The endpoint exists, but not for this HTTP method. |
The state does not allow it
| Status | Code | What it means |
|---|---|---|
409 | conflict | The request cannot be carried out in the state things are in. The message says why. |
409 | listing_changed | The listing is no longer at the version sent in If-Match, for example because tickets sold. Nothing was changed. details.current_version is the version now. |
409 | listing_locked | The listing is on a marketplace, where its section, row, ticket type and seats cannot change in place, apart from removing unsold seats or standing tickets. |
409 | listing_busy | The listing is being synced with a marketplace, or tickets are held for an order a marketplace has not confirmed yet. Try again shortly. |
409 | listing_has_sales | The listing has sales and stays on record. Take the rest off sale instead. |
409 | seats_taken | One or more of these seats are already listed for the event. |
409 | sale_not_deliverable | The sale takes no delivery: it is delivered, cancelled or failed. |
409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
409 | sandbox_full | The sandbox of this account is full. Reset it to go on. |
428 | precondition_required | This change needs the If-Match header with the listing’s current version. |
Too many requests
| Status | Code | What it means |
|---|---|---|
429 | rate_limited | Too many requests. Retry-After says how many seconds to wait. |
Our side, or a marketplace
| Status | Code | What it means |
|---|---|---|
500 | internal_error | Something went wrong on our side. The request id helps us find it. |
502 | marketplace_error | A marketplace did not take the change. Nothing was saved; the listing is as it was. |
503 | service_unavailable | A service the request needs did not answer, such as the file storage. Nothing was saved. Retry-After says when to try again. |
503 | api_suspended | The API is switched off for the moment. Retry-After says when to try again. |