Skip to main content
POST
Confirm payment completion

Authorizations

x-stash-hmac-signature
string
header
required

Versioned HMAC-SHA256 signature for server-to-server communication between game backends and Stash services. Recommended over the deprecated legacyHmac scheme for the best security. Header format: v1;{shopId};{unixMillisTimestamp};{base64Signature} (semicolon-delimited). {base64Signature} is the base64-encoded HMAC-SHA256 of the string {unixMillisTimestamp}.{requestBody} signed with your Egress API key, where {requestBody} is the compact request JSON. The timestamp must be within 5 minutes of Stash server time. Your shopId is your immutable shop identifier; it and your Egress API key are available in Stash Studio under Project Settings > API Secrets.

Body

application/json

Request to confirm and complete a pending purchase that was previously registered.

Request to confirm and complete a pending purchase that was previously registered.

playerId
string
required

The user confirming the purchase

transactionId
string
required

Transaction identifier to confirm

currency
string
required

Currency code (ISO-4217 code, e.g., 'USD', 'EUR')

decimalPlaces
integer<int64>
required

Number of decimal places in this request's tax, total and line-item cents values for this ISO 4217 currency, under the minor-unit standard configured for your shop: Unicode CLDR release 32 by default. See cents in GetCatalog for the standards a shop can use and their sources. Always sent, including the literal 0 for zero-decimal currencies (e.g. JPY, KRW).

tax
integer<int64>
required

Tax as integer minor units for this ISO 4217 currency (e.g. 99 for $0.99 in USD; can be 0), scaled by this request's decimalPlaces under the minor-unit standard configured for your shop, the same standard Stash reads your catalog prices with (see cents in GetCatalog). Always sent, including the literal 0 when the purchase has no tax.

taxInclusive
boolean
required

Whether tax is already included in the item prices. When true, tax is the share of total that is tax. When false, tax is added on top. False when tax is 0. For a purchase without a cash coupon, you can check before granting that total, minus tax when taxInclusive is false, equals the sum of cents × quantity. Each of cents, tax and total is rounded down on its own to the currency's minor units in CLDR version 32 (the CLDR_32 standard) before it is scaled to decimalPlaces, and for a few currencies (such as COP, which has 0 decimals there) those have fewer decimals than ISO 4217 or later CLDR versions list. So when item prices are finer than those units, total (minus tax when taxInclusive is false) can exceed the sum by less than one such unit per item purchased, plus one more when tax is added on top; allow that difference. A cash coupon lowers total by its discount, and this request does not carry the discount yet, so these fields alone cannot validate a purchase with a cash coupon. Always sent, including false.

total
integer<int64>
required

Amount charged, as integer minor units for this ISO 4217 currency (e.g. 1098 for $10.98 in USD), scaled by this request's decimalPlaces under the minor-unit standard configured for your shop, the same standard Stash reads your catalog prices with (see cents in GetCatalog). Includes tax: added on top of the item prices when taxInclusive is false, already inside them when true.

timeMillis
string<int64>
required

Timestamp when the purchase was completed (milliseconds since Unix epoch)

items
Purchased Item · object[]
required

List of items in this purchase

Optional checkout link identifier if purchase was made through a checkout link

orderId
string

Stash's order ID for this purchase: the same value as orderId in the PURCHASE_SUCCEEDED webhook for it, so you can record it at confirmation without waiting for the webhook. Each payment attempt can have its own order ID: if the player pays again after a failed attempt, the new confirmation can carry the same transaction_id with a different order_id, and the webhook carries the order_id of the attempt that was paid. On a web shop cart purchase it equals transaction_id. Sent only for a shop Stash has turned it on for: ask Stash to turn it on for yours. A confirmation without it is still valid; take the order ID from the webhook then.

shopId
string

The originating Stash shop identifier (mirrors the shopId sent in webhooks)

environment
enum<string>
default:PAYMENT_ENVIRONMENT_UNSPECIFIED

Represents the payment environment for the request

Available options:
PAYMENT_ENVIRONMENT_UNSPECIFIED,
PAYMENT_ENVIRONMENT_TEST,
PAYMENT_ENVIRONMENT_PRODUCTION
paymentMethodType
enum<string>
default:PAYMENT_METHOD_TYPE_UNSPECIFIED

Represents the payment method used for the purchase

Available options:
PAYMENT_METHOD_TYPE_UNSPECIFIED,
PAYMENT_METHOD_TYPE_CARD,
PAYMENT_METHOD_TYPE_APPLE_PAY,
PAYMENT_METHOD_TYPE_GOOGLE_PAY,
PAYMENT_METHOD_TYPE_PAYPAL,
PAYMENT_METHOD_TYPE_KLARNA,
PAYMENT_METHOD_TYPE_CASH_APP,
PAYMENT_METHOD_TYPE_AMAZON_PAY
platform
enum<string>
default:PURCHASE_PLATFORM_UNSPECIFIED

Represents the platform of the user making the purchase

Available options:
PURCHASE_PLATFORM_UNSPECIFIED,
PURCHASE_PLATFORM_IOS,
PURCHASE_PLATFORM_ANDROID,
PURCHASE_PLATFORM_WEBSTORE
browser
string

Browser information for web purchases (e.g., 'Chrome/91.0', 'Firefox/89.0', 'Safari/14.1', 'any')

deviceId
string

Device identifier for tracking and fraud prevention (can be generated client-side)

source
enum<string>
default:PURCHASE_SOURCE_UNSPECIFIED

Represents the source of the purchase for analytics

Available options:
PURCHASE_SOURCE_UNSPECIFIED,
PURCHASE_SOURCE_CART,
PURCHASE_SOURCE_DIRECT,
PURCHASE_SOURCE_BUY_NOW
ipAddress
string

Customer IP address for fraud prevention and compliance

region
string

Region/country code using ISO-3166-1 alpha-2 code (e.g., 'US', 'CA', 'GB')

userEmail
string

Customer email for the purchase

emailMarketingOptIn
boolean

Optional flag indicating if customer opted in to email marketing

bonusItems
Bonus Item · object[]

Optional list of bonus items to be granted with the purchase

loyalty
Player Loyalty State · object

A player's standing in a shop's active loyalty campaign at a point in time.

valueCode
Value Code · object

A value code that the player applied to this purchase: a code that grants more of a bonus at the full price. It never changes the price.

Response

A successful response.

Expected response format for the ConfirmPayment endpoint from the game backend. Return exactly one of results or decline: results present and decline absent indicates success; decline present indicates the purchase was not fulfilled and takes precedence over anything in results. Return a decline together with an HTTP 4xx status.

results
Confirm Payment Result · object[]

Results of the confirmed purchases. Present with at least one entry on success; omit when declining

decline
Confirm Payment Decline · object

Structured reason a purchase confirmation was declined. When present, no item of the purchase may have been granted and the payment is not completed.