Errors

The shape of every refusal, every error code with its status, and what to do about each kind.

Download all as MarkdownOpenAPI

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:

JSON
{
	"error": {
		"code": "not_found",
		"message": "A listing with this id was not found."
	},
	"request_id": "req_8f3a1c5e7b9d2f4a6c8e0b1d"
}
FieldTypeDescription
errorobjectThe refusal: its code, its message and, for some codes, more about it.
error.codestringWhat 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.messagestringWhat went wrong, in a sentence for the person reading the log. It may be reworded, so do not match on it.
error.detailsoptionalmap of string to any valueMore about the refusal, for the codes that have something to add.
request_idstringThe 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:

JSON
{
	"event_id": "6718d2f4a9c3b17e5d204a61",
	"listings": [
		{
			"section": "112",
			"row": "F",
			"seats": ["14-15"],
			"price_per_ticket": { "amount": "412,00", "currency": "USD" }
		}
	]
}

The answer names both:

JSON
{
	"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

KindStatusesWhat to do
The request is wrong400, 413, 415, 422Fix the request. Sent again unchanged, it gets the same answer.
The key or the account401, 403Check the key, what it was given and the account behind it. Do not retry.
Not there404, 405Check the id, the path and the method.
The state does not allow it409, 428Read 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 requests429Wait as long as the Retry-After header says, then go on.
Our side, or a marketplace500, 502, 503Send 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

StatusCodeWhat it means
400invalid_requestThe request is not one the API understands: a parameter is missing or has the wrong form.
400invalid_jsonThe body is not a JSON object.
413payload_too_largeThe body is larger than the API takes.
415unsupported_media_typeA body has to be sent as application/json.
422validation_failedThe request was understood, but its values are not accepted. details.issues lists each problem with its path.
422idempotency_key_reusedThis Idempotency-Key was used for a different request.

The key or the account

StatusCodeWhat it means
401unauthorizedNo API key, or one that is unknown, revoked or expired.
403forbiddenThe key is valid, but this is not something it may do.
403insufficient_scopeThe key lacks the permission this endpoint needs. details.required names it.
403account_unavailableThe account behind the key cannot use the API right now: it is not active, its setup is unfinished or two-factor authentication is off.
403api_not_enabledThe Seller API is not switched on for this account yet.
403kyc_requiredChanging listings or delivering sales with a live key needs a verified identity on SyncSeats.
403test_onlyThis endpoint belongs to the sandbox and takes test keys only.

Not there

StatusCodeWhat it means
404not_foundNothing with this id belongs to the account. Something that never existed, was deleted or is someone else’s answers the same.
404route_not_foundThe API has no endpoint at this path.
405method_not_allowedThe endpoint exists, but not for this HTTP method.

The state does not allow it

StatusCodeWhat it means
409conflictThe request cannot be carried out in the state things are in. The message says why.
409listing_changedThe 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.
409listing_lockedThe 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.
409listing_busyThe listing is being synced with a marketplace, or tickets are held for an order a marketplace has not confirmed yet. Try again shortly.
409listing_has_salesThe listing has sales and stays on record. Take the rest off sale instead.
409seats_takenOne or more of these seats are already listed for the event.
409sale_not_deliverableThe sale takes no delivery: it is delivered, cancelled or failed.
409idempotency_in_progressA request with this Idempotency-Key is still running.
409sandbox_fullThe sandbox of this account is full. Reset it to go on.
428precondition_requiredThis change needs the If-Match header with the listing’s current version.

Too many requests

StatusCodeWhat it means
429rate_limitedToo many requests. Retry-After says how many seconds to wait.

Our side, or a marketplace

StatusCodeWhat it means
500internal_errorSomething went wrong on our side. The request id helps us find it.
502marketplace_errorA marketplace did not take the change. Nothing was saved; the listing is as it was.
503service_unavailableA service the request needs did not answer, such as the file storage. Nothing was saved. Retry-After says when to try again.
503api_suspendedThe API is switched off for the moment. Retry-After says when to try again.