Skip to main content
POST
Register payment intent

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 register a purchase intent with the game backend, at which point the game backend is expected to reserve the inventory for the purchase.

Request to register a purchase intent with the game backend, at which point the game backend is expected to reserve the inventory for the purchase.

playerId
string
required

The user making the purchase

transactionId
string
required

Unique transaction identifier for this purchase session

currency
string
required

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

decimalPlaces
integer<int64>
required

Number of decimal places in this request's 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).

registrations
Purchase Registration · object[]
required

List of items to register for purchase

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

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
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')

loyalty
Player Loyalty State · object

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

Response

A successful response.

Expected response format for the RegisterPayment endpoint from the game backend (response body includes status indicating success or failure).

statuses
Offer Status · object[]
required

Status of each registered offer