Skip to main content
POST
Generate Checkout

Authorizations

x-stash-hmac-signature
string
header
required

Versioned HMAC-SHA256 signature authenticating server-to-server SDK requests (your backend calling Stash), as opposed to client-side SDK operations. Recommended over the deprecated X-Stash-Api-Key for the best security. Header format: v1;{appId};{unixMillisTimestamp};{base64Signature} (semicolon-delimited). {base64Signature} is the base64-encoded HMAC-SHA256 of the string {unixMillisTimestamp}.{requestBody} using your app ingress secret (the ingress secret is shown base64-encoded in Studio; base64-decode it to the raw bytes used as the HMAC key), where {requestBody} is the request body exactly as you send it for POST and PUT requests (the compact canonical request JSON is also accepted) and empty for GET requests. A signature over the exact bytes verifies for bodies of up to 18 KiB (18,432 bytes); a larger body may be refused with 401 even when correctly signed. The timestamp must be within 5 minutes of Stash server time. Your appId is your immutable app identifier, shown in Stash Studio under Project Settings > App details; your ingress secret is under Project Settings > API Secrets.

Body

application/json
item
object
bonusItems
Bonus items to include with the purchase (free items granted alongside the main item) · object[]

Optional bonus items to include with the purchase. These are free items granted alongside the main item. Works with either item or catalog_items. A bonus whose id matches a bonus set up in Stash for the purchased product replaces that bonus, so only the amount sent here is granted for that id; a bonus with any other id is granted in addition. Each quantity is granted exactly as sent and is not multiplied by the item quantity. Each id may appear only once: a request that repeats an id is rejected, and no checkout link is created.

user
object
transactionId
string

Optional transaction ID for tracking

regionCode
string

Region code (2-3 letter country code, defaults to US if not set)

currency
string

ISO-4217 Currency code (currently only USD supported)

catalogItems
object[]

Managed Catalog SKUs (id + quantity) to resolve server-side. Requires the shop to have managed catalog enabled. Mutually exclusive with item; provide exactly one of the two.

checkoutSessionId
string

Optional checkout-session id (the per-tab analytics session for this checkout, shared with telemetry and the funnel webhooks); persisted on the order. Distinct from the multi-PSP payment session_id used during authorization.

successUrl
string

Optional absolute URL the player is sent to once the payment succeeds, instead of the Stash Pay success screen. Any host is accepted; javascript, data, vbscript, blob and file URLs are rejected. Maximum 2048 characters. When checkout runs in an iframe, the iframe itself navigates here: the page must allow being framed, and browsers can block an app deeplink scheme opened from a cross-origin iframe.

failureUrl
string

Optional absolute URL the player is sent to instead of the Stash Pay payment-failed screen. Same rules as success_url. Checkout keeps the player instead of redirecting when they can retry there (a decline shown inline, or a network error while finishing the payment) and when the payment went through but could not be finished. The iframe and app deeplink limits of success_url apply.

Response

A successful response.

url
string

Generated quick payment URL

id
string

Unique payment link ID

regionCode
string

Region code used for the payment