API reference · Listings
Purge all listings
/listings/purgeRemove listings at or before asOf and retain newer snapshots. The purge fences delayed pushes, including SKUs never stored here. Repeating the same purge is a no-op. A stale purge returns 409 STALE_SNAPSHOT.
Example
These examples send requests to the sandbox.
curl --request POST \
--url 'https://api-sandbox.snapcaster.ca/api/v1/marketplace/listings/purge' \
--header "Authorization: Bearer $MARKETPLACE_API_KEY" \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"asOf": "$(node -p 'new Date().toISOString()')"
}
EOF$(node -p 'new Date().toISOString()') sets asOf to the current UTC time in milliseconds, so two writes in the same second never share an asOf.
{
"success": true,
"data": {
"purged": 0
}
}Endpoint
| Environment | URL |
|---|---|
| Sandbox | https://api-sandbox.snapcaster.ca/api/v1/marketplace |
| Production | https://api.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
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
This operation takes no Idempotency-Key. Retries says how to resend it safely.
Request body
asOfstring requiredSee Send ordered listing snapshots in Core concepts.
Constraints: format: date-time
Response
200
The count of listings removed.
Response body: Purge
successboolean requiredWhether the operation completed as requested.
Constraints: allowed values:
truedataobject requiredThe operation or event payload.
Show child fieldsHide child fields
data.integer requiredpurged The number of listings removed by the purge.
Errors
Errors return a Marketplace body, except HTTP 413, 500 (Api). Error codes explains both error bodies and lists every code.
400
INVALID_REQUESTUNSUPPORTED_API_VERSIONThe request failed validation (
INVALID_REQUEST). Unknown or retired API-version override (UNSUPPORTED_API_VERSION).Do this: Correct the fields named in the error details, then retry the request. 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.
409
SELLER_SOURCE_EXCLUSIVESTALE_SNAPSHOTThe seller uses another inventory source, or asOf precedes an existing purge.
Do this: Use the declared inventory source. For STALE_SNAPSHOT, discard the delayed purge; use a newly measured snapshot for a new purge.
413
PAYLOAD_TOO_LARGEThe body is larger than this route accepts (
PAYLOAD_TOO_LARGE).Do this: Send a smaller body and retry.
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.