API reference · Sandbox
Read a sandbox test purchase
/sandbox/test-purchases/{ref}Sandbox only: the production API does not serve this operation. Read a test purchase this seller started: processing until its order exists, then succeeded with the order_ids, or failed with the reason.
Example
These examples send requests to the sandbox.
Replace the example ref in the URL with your own.
curl --request GET \
--url 'https://api-sandbox.snapcaster.ca/api/v1/marketplace/sandbox/test-purchases/string' \
--header "Authorization: Bearer $MARKETPLACE_API_KEY"{
"success": true,
"data": {
"test_purchase_ref": "tpr_3f2c0b9d8e7a6f5c4b3a29180f7e6d5c",
"checkout_id": "chk_4e1f7a2b9c3d",
"status": "succeeded",
"order_ids": [
"ord_sandbox_01K4A8Y6D4QJH2N3P5R7S9T0VW"
],
"failure": null
}
}Endpoint
| Environment | URL |
|---|---|
| Sandbox | https://api-sandbox.snapcaster.ca/api/v1/marketplace |
marketplaceApiKey-http bearer. Send the seller's marketplace API key asAuthorization: Bearer mp_{sellerCode}_{hex}. Themp_{sellerCode}_prefix identifies the seller; the trailing hex is the secret. The seller generates the key and supplies it to your platform.
Request
Path parameters
refstring requiredThe
test_purchase_refthe trigger returned.Constraints: minimum length: 1; maximum length: 64
Headers
X-Snapcaster-Api-VersionstringOverride the platform pin for this request only. Webhook versions and the platform pin do not change.
Constraints: allowed values:
2026-10Example2026-10
Response
200
The test purchase.
Response body: Sandbox
successboolean requiredWhether the operation completed as requested.
Constraints: allowed values:
trueExampletruedataSandboxrequiredTest Purchase The operation or event payload.
Show child fieldsHide child fields
data.string requiredtest_purchase_ref Stable for the Idempotency-Key that started the purchase.
Example
tpr_3f2c0b9d8e7a6f5c4b3a29180f7e6d5cdata.string requiredcheckout_id The checkout the sandbox buyer paid through.
Example
chk_4e1f7a2b9c3ddata.string requiredstatus processinguntil the payment is captured and the order exists, thensucceeded.failedwhen the payment did not complete.Constraints: allowed values:
processing,succeeded,failedExamplesucceededdata.array of string requiredorder_ids The orders the purchase created, as
order_idvalues. Empty untilsucceeded.Field example
[ "ord_sandbox_01K4A8Y6D4QJH2N3P5R7S9T0VW" ]data.object or null requiredfailure Why the purchase failed, or null.
Show child fieldsHide child fields
data.string requiredfailure. code The stable machine-readable code for this result.
Constraints: allowed values:
TEST_PAYMENT_FAILED,TEST_PURCHASE_NOT_AVAILABLEdata.string requiredfailure. message A human-readable explanation of the result.
Errors
Errors return a Marketplace body, except HTTP 500 (Api). Error codes explains both error bodies and lists every code.
400
UNSUPPORTED_API_VERSIONUnknown or retired API-version override (
UNSUPPORTED_API_VERSION).Do this: For UNSUPPORTED_API_VERSION, choose a supported version from the API versioning guide.
401
UNAUTHORIZEDMissing or invalid marketplace API key (
UNAUTHORIZED).Do this: Send the marketplace API key for this seller as a Bearer token, then retry.
404
TEST_PURCHASE_NOT_FOUNDNo test purchase matches this ref for the authenticated seller (
TEST_PURCHASE_NOT_FOUND). Another seller's ref also returns 404.Do this: Use the test_purchase_ref the trigger returned to this seller.
500
INTERNAL_ERRORAn unexpected failure (
INTERNAL_ERROR).Do this: Retry with bounded retries and jitter. If the failure persists, contact Snapcaster with the X-Correlation-ID response header.