Test mode and the sandbox

What a test key works on, what is real and what is acted out, and the endpoints that simulate sales and the choices of a marketplace.

Download all as MarkdownOpenAPI

Two modes, one API

The key decides the mode. A key that starts with ssapi_live_ works on your account, one that starts with ssapi_test_ on your account’s sandbox. The endpoints, the parameters and the shapes are the same in both, and the SyncSeats-Mode header of every answer says which mode it was: live or test.

What the sandbox keeps to itself

The sandbox holds listings, sales, payouts, charges, inventory entries and webhook events of its own. Nothing in it reaches a marketplace, changes a real listing or your real inventory, or touches your balance, and each account has its own sandbox.

It also asks for less: test mode needs no verified identity, and creating a test key needs no authenticator code.

What is real

The event catalog and your marketplaces are the real ones, read only. So you can check how your software matches events against the catalog it will meet later, and the ids you find with a test key are the ids you use with a live one.

What is different

  • A sandbox listing is live at once when it is created or put on sale. A live one is queued first and goes live as its marketplaces take it in.
  • Sales do not happen by themselves. You act them out.
  • No marketplace asks for a choice by itself. You make one wait.
  • A delivery is checked and kept as a record, but its files are dropped and no email goes out. The same goes for the files of a proof of purchase.
  • Amounts in EUR and GBP are converted at fixed rates instead of the rate of the day: one euro is always $1.10 and one pound always $1.27, so a price of £325.00 becomes $412.75 every time. Payouts go out in EUR at the same fixed rate, and the inventory adds up its totals at it. Money explains the rate of a live key.
  • The inventory holds only the purchases and sales you record in the sandbox. A sandbox listing has no entry in it, so listing_id of an entry is always null. In the sandbox has the rest.
  • The limits differ: a test key may send 120 requests a minute where a live key may send 300, and a sandbox takes 60 changes a minute where a live account takes 30. Rate limits has the table.

Acting out sales and marketplaces

These 4 endpoints exist only in the sandbox. A live key gets 403 test_only for them.

A simulated sale takes tickets of a sandbox listing that is on sale:

Request
curl -X POST "https://www.syncseats.com/api/v1/sandbox/sales" \
	-H "Authorization: Bearer ssapi_test_..." \
	-H "Content-Type: application/json" \
	-H "Idempotency-Key: sandbox-sale-48211" \
	-d '{
		"listing_id": "671f3a9c2b7d4e0f1ae48211",
		"quantity": 2,
		"marketplace_id": "66a0c41e7b2d9f3a10c5e801"
	}'

The answer is a sale like any other. Then move it on, one step for each request, with to:

StepWhat it acts out
proof_submittedA proof of delivery is uploaded; the sale waits for confirmation, and its delivery shows via: syncseats. Sends sale.proof_submitted.
deliveredOur team confirms the delivery. Sends sale.delivered.
cancelledThe sale is cancelled, with a charge if charge is set. Sends sale.cancelled.
marketplace_paidThe marketplace pays for the sale; it becomes ready for a payout. Sends sale.payout_ready.
paid_outA payout with every ready sale is created and sent. Sends payout.paid.

A cancellation can carry a charge, to see how penalties show up in your software:

JSON
{
	"to": "cancelled",
	"charge": {
		"amount": { "amount": "74.00", "currency": "USD" },
		"reason": "The tickets were not delivered."
	}
}

Each step sends the webhook event a live sale would send, to the test endpoints of your account.

Delivering in the sandbox

POST /v1/sales/{id}/delivery/uploads and POST /v1/sales/{id}/delivery work with a test key as they do live, so your software can hand in a delivery before it meets a real sale. Deliver a sale explains the steps.

  • The upload_url of a sandbox upload leads to SyncSeats itself, not to storage. Like a live one it takes no key, since it carries its own signature, and it takes the file for the same time.
  • A file can be up to 4 MB in the sandbox, where a live key takes up to 10 MB. Asking for an upload of a bigger file gets 422 validation_failed: test with a smaller one.
  • A sandbox gives upload URLs for up to 120 files an hour, for deliveries and proofs of purchase together, and a reset does not start the hour anew. Past that the answer is 429 rate_limited with Retry-After.
  • One upload URL takes up to 10 files in 10 minutes, and each file has 20 seconds to arrive.
  • The URL checks what arrives as storage does: the Content-Type and Content-Length headers against what was announced, the length of the body, and whether the file starts like a PDF, a PNG or a JPEG. It answers 200 without a body, and drops the file. Put it again to the same URL to replace it, until the upload is handed in.
What is wrongThe answer
The URL is not one the API gave, or its time is over403 forbidden
The sandbox was reset since the URL was given404 not_found
The upload was handed in already, with a delivery or with new listings409 conflict
The Content-Type header is not the type announced422 validation_failed at Content-Type
The Content-Length header is not the size announced422 validation_failed at Content-Length
The body has another length, or does not start like a PDF, a PNG or a JPEG422 validation_failed at body
The body takes longer than 20 seconds to arrive422 validation_failed at body
The URL took 10 files in the last 10 minutes, refused ones included429 rate_limited with Retry-After

The hand-in works as live: the sale is awaiting_confirmation, delivery.via is api, and your test endpoints get sale.proof_submitted. The sandbox does not check buyer_note or the recipient as live does. Move the sale on with delivered as our team would.

The step proof_submitted acts out a delivery without files of yours: delivery.via is then syncseats, with a made-up PDF, as when our team hands a delivery in for you.

A proof of purchase in the sandbox

POST /v1/listings/proof-of-purchase/uploads and proof_of_purchase_upload_ids of POST /v1/listings work with a test key as they do live, so your software can list on a marketplace that asks for a proof before it meets a live one. Proof of purchase explains the steps.

  • The upload_url leads to SyncSeats itself, as for a delivery, and checks the file the same way: the headers, the length and how the file starts.
  • A file can be up to 4 MB, where a live key takes up to 10 MB. Asking for an upload of a bigger file gets 422 validation_failed.
  • Its upload URLs count in the same hour as those of deliveries: up to 120 files together, and each URL takes up to 10 files in 10 minutes.
  • POST /v1/listings takes an upload once its file has come in, and each upload once. A request that creates no listing gives its uploads back, as live.
  • The files are dropped. The listings keep how many there were in proof_of_purchase_files. With a proof, a marketplace with requires_proof can be named in marketplace_ids as live; without marketplace_ids the sandbox takes every marketplace of the account, as it always does, since it does not know the choice of your last listing in the dashboard.
  • POST /v1/sandbox/reset deletes these uploads too.

Choices of a marketplace

Live, a marketplace can wait for a choice before it takes a listing, as When a marketplace needs a choice explains. In the sandbox POST /v1/sandbox/listings/{id}/require-choice makes one wait, so your software can practise reading action and answering it:

Request
curl -X POST "https://www.syncseats.com/api/v1/sandbox/listings/671f3a9c2b7d4e0f1ae48211/require-choice" \
	-H "Authorization: Bearer ssapi_test_..." \
	-H "Content-Type: application/json" \
	-H "Idempotency-Key: sandbox-48211-require-category" \
	-d '{
		"marketplace_id": "66a0c41e7b2d9f3a10c5e803",
		"kind": "category"
	}'

The listing has to be on sale, and marketplace_id has to be one of its marketplaces; another marketplace gets 422 validation_failed. A draft, a listing off sale or a closed one gets 409 conflict, and so does a kind the marketplace waits for already.

The marketplace’s status is then needs_action, and action offers the same options every time:

Kindid and label of the options
fan_sectionHome Fans, Away Fans and Neutral Fans
categoryCategory 1, Category 2 and Category 3
seating1SA (All Together), 1S2 (Up To 2 Together) and 1S1 (Single Seat(s))
  • Asked for more than one kind, the marketplace waits for them in the order a live one asks: fan_section, category and seating.
  • Your test endpoints get listing.action_required when the choice the listing shows changes, not for one that waits behind another.
  • POST /v1/listings/{id}/marketplaces/{marketplace_id}/choice answers as live. After the last answer the marketplace is live at once and listing.live goes out; after another, the next choice shows and listing.action_required goes out for it.
  • POST /v1/listings/{id}/unpublish drops a choice that waits.

Limits and clean-up

A sandbox holds up to 500 listings, 500 sales, 100 payouts and 500 inventory entries. Past that, a request that would add one gets 409 sandbox_full.

Sandbox data is deleted 90 days after it last changed. POST /v1/sandbox/reset empties the sandbox whenever you want a clean start, its inventory and the uploads of its deliveries and proofs of purchase included: an upload URL given before takes no file after it.

Request
curl -X POST "https://www.syncseats.com/api/v1/sandbox/reset" \
	-H "Authorization: Bearer ssapi_test_..." \
	-H "Idempotency-Key: sandbox-reset-1"
Response, 200
{
	"object": "sandbox_reset",
	"deleted": {
		"listings": 3,
		"sales": 2,
		"payouts": 1,
		"charges": 1,
		"inventory_items": 1
	}
}

Webhooks in test mode

Webhook endpoints have a mode too. A test endpoint receives the events of the sandbox, signed like live ones, with mode set to test. Webhooks explains how to receive them.

A sandbox sends up to 500 events an hour. Past that, requests work as before, but their events are not sent, and they are not sent later either.

When one request creates several listings, only the events of the first can be sent while the request runs; those of the others are sent after it.