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.
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
liveat once when it is created or put on sale. A live one isqueuedfirst 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_idof an entry is alwaysnull. 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.
POST /v1/sandbox/sales: simulate a sale.POST /v1/sandbox/sales/{id}/advance: move a simulated sale on.POST /v1/sandbox/listings/{id}/require-choice: make a marketplace wait for a choice.POST /v1/sandbox/reset: reset the sandbox.
A simulated sale takes tickets of a sandbox listing that is on sale:
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"
}'const response = await fetch('https://www.syncseats.com/api/v1/sandbox/sales', {
method: 'POST',
headers: {
Authorization: 'Bearer ssapi_test_...',
'Content-Type': 'application/json',
'Idempotency-Key': 'sandbox-sale-48211',
},
body: JSON.stringify({
listing_id: '671f3a9c2b7d4e0f1ae48211',
quantity: 2,
marketplace_id: '66a0c41e7b2d9f3a10c5e801',
}),
})
const data = await response.json()
console.log(response.status, data)import requests
response = requests.post(
"https://www.syncseats.com/api/v1/sandbox/sales",
headers={
"Authorization": "Bearer ssapi_test_...",
"Idempotency-Key": "sandbox-sale-48211",
},
json={
"listing_id": "671f3a9c2b7d4e0f1ae48211",
"quantity": 2,
"marketplace_id": "66a0c41e7b2d9f3a10c5e801",
},
)
print(response.status_code, response.json())The answer is a sale like any other. Then move it on, one step for each request, with to:
| Step | What it acts out |
|---|---|
proof_submitted | A proof of delivery is uploaded; the sale waits for confirmation, and its delivery shows via: syncseats. Sends sale.proof_submitted. |
delivered | Our team confirms the delivery. Sends sale.delivered. |
cancelled | The sale is cancelled, with a charge if charge is set. Sends sale.cancelled. |
marketplace_paid | The marketplace pays for the sale; it becomes ready for a payout. Sends sale.payout_ready. |
paid_out | A 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:
{
"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_urlof 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_limitedwithRetry-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-TypeandContent-Lengthheaders against what was announced, the length of the body, and whether the file starts like a PDF, a PNG or a JPEG. It answers200without a body, and drops the file. Put it again to the same URL to replace it, until the upload is handed in.
| What is wrong | The answer |
|---|---|
| The URL is not one the API gave, or its time is over | 403 forbidden |
| The sandbox was reset since the URL was given | 404 not_found |
| The upload was handed in already, with a delivery or with new listings | 409 conflict |
The Content-Type header is not the type announced | 422 validation_failed at Content-Type |
The Content-Length header is not the size announced | 422 validation_failed at Content-Length |
| The body has another length, or does not start like a PDF, a PNG or a JPEG | 422 validation_failed at body |
| The body takes longer than 20 seconds to arrive | 422 validation_failed at body |
| The URL took 10 files in the last 10 minutes, refused ones included | 429 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_urlleads 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/listingstakes 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 withrequires_proofcan be named inmarketplace_idsas live; withoutmarketplace_idsthe 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/resetdeletes 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:
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"
}'const response = await fetch('https://www.syncseats.com/api/v1/sandbox/listings/671f3a9c2b7d4e0f1ae48211/require-choice', {
method: 'POST',
headers: {
Authorization: 'Bearer ssapi_test_...',
'Content-Type': 'application/json',
'Idempotency-Key': 'sandbox-48211-require-category',
},
body: JSON.stringify({
marketplace_id: '66a0c41e7b2d9f3a10c5e803',
kind: 'category',
}),
})
const data = await response.json()
console.log(response.status, data)import requests
response = requests.post(
"https://www.syncseats.com/api/v1/sandbox/listings/671f3a9c2b7d4e0f1ae48211/require-choice",
headers={
"Authorization": "Bearer ssapi_test_...",
"Idempotency-Key": "sandbox-48211-require-category",
},
json={
"marketplace_id": "66a0c41e7b2d9f3a10c5e803",
"kind": "category",
},
)
print(response.status_code, response.json())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:
| Kind | id and label of the options |
|---|---|
fan_section | Home Fans, Away Fans and Neutral Fans |
category | Category 1, Category 2 and Category 3 |
seating | 1SA (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,categoryandseating. - Your test endpoints get
listing.action_requiredwhen the choice the listing shows changes, not for one that waits behind another. POST /v1/listings/{id}/marketplaces/{marketplace_id}/choiceanswers as live. After the last answer the marketplace isliveat once andlisting.livegoes out; after another, the next choice shows andlisting.action_requiredgoes out for it.POST /v1/listings/{id}/unpublishdrops 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.
curl -X POST "https://www.syncseats.com/api/v1/sandbox/reset" \
-H "Authorization: Bearer ssapi_test_..." \
-H "Idempotency-Key: sandbox-reset-1"const response = await fetch('https://www.syncseats.com/api/v1/sandbox/reset', {
method: 'POST',
headers: {
Authorization: 'Bearer ssapi_test_...',
'Idempotency-Key': 'sandbox-reset-1',
},
})
const data = await response.json()
console.log(response.status, data)import requests
response = requests.post(
"https://www.syncseats.com/api/v1/sandbox/reset",
headers={
"Authorization": "Bearer ssapi_test_...",
"Idempotency-Key": "sandbox-reset-1",
},
)
print(response.status_code, response.json()){
"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.