From 5e9d1ccb8c691e6fff6f54df1d2df4afdf52c01b Mon Sep 17 00:00:00 2001 From: Stephens Xu Date: Tue, 3 Mar 2026 15:50:52 -0800 Subject: [PATCH 1/9] generate protos for managed catalog api --- .github/workflows/check.yml | 1 + .../config/swagger-merger-ingress-config.json | 31 + docs/gen/redoc.ingress.v1.html | 437 +++++++ docs/gen/redoc.v1.html | 1038 ++++++++-------- docs/gen/swagger.ingress.v1.json | 1105 +++++++++++++++++ gen.sh | 6 + server/ingress/server.proto | 34 + server/ingress/studio/v1/enums.proto | 34 + server/ingress/studio/v1/service.proto | 177 +++ 9 files changed, 2344 insertions(+), 519 deletions(-) create mode 100644 docs/config/swagger-merger-ingress-config.json create mode 100644 docs/gen/redoc.ingress.v1.html create mode 100644 docs/gen/swagger.ingress.v1.json create mode 100644 server/ingress/server.proto create mode 100644 server/ingress/studio/v1/enums.proto create mode 100644 server/ingress/studio/v1/service.proto diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 682b64a..5b9ac2d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -40,6 +40,7 @@ jobs: run: | # Exclude redoc HTML from diff check (output varies by platform due to styled-components) git checkout -- docs/gen/redoc.v1.html 2>/dev/null || true + git checkout -- docs/gen/redoc.ingress.v1.html 2>/dev/null || true if [ -n "$(git status --porcelain)" ]; then echo "::error::Generated files are out of date. Please run 'make check' locally and commit the changes." diff --git a/docs/config/swagger-merger-ingress-config.json b/docs/config/swagger-merger-ingress-config.json new file mode 100644 index 0000000..c87fb72 --- /dev/null +++ b/docs/config/swagger-merger-ingress-config.json @@ -0,0 +1,31 @@ +{ + "swagger": "2.0", + "info": { + "title": "Stash Managed Catalog API", + "description": "Read-only API for querying the Stash managed product catalog. Designed for server-to-server communication between partner backends and Stash services.", + "version": "1.0.0", + "contact": { + "name": "API Support", + "url": "https://docs.stash.gg/", + "email": "help@stash.gg" + } + }, + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": [ + { + "name": "ManagedCatalog", + "description": "Read-only endpoints for querying the managed product catalog" + } + ], + "paths": { + "$ref": "../../gen/openapiv2/server/ingress/studio/v1/service.swagger.json#paths" + }, + "definitions": { + "$ref": "../../gen/openapiv2/server/ingress/studio/v1/service.swagger.json#definitions" + }, + "securityDefinitions": { + "$ref": "../../gen/openapiv2/server/ingress/server.swagger.json#securityDefinitions" + } +} diff --git a/docs/gen/redoc.ingress.v1.html b/docs/gen/redoc.ingress.v1.html new file mode 100644 index 0000000..d4d1838 --- /dev/null +++ b/docs/gen/redoc.ingress.v1.html @@ -0,0 +1,437 @@ + + + + + + Stash Managed Catalog API + + + + + + + + + +

Stash Managed Catalog API (1.0.0)

Download OpenAPI specification:

Read-only API for querying the Stash managed product catalog. Designed for server-to-server communication between partner backends and Stash services.

+

ManagedCatalog

Read-only endpoints for querying the managed product catalog

+

List published products

Retrieves a paginated list of published products for a shop. Results are ordered by creation date (most recent first). Only published products are returned; drafts and deleted products are excluded.

+
Authorizations:
hmac
path Parameters
shopId
required
string

Shop identifier from Stash Studio

+
query Parameters
limit
integer <int64>

Maximum results per page. Defaults to 50. Maximum allowed value is 100.

+
offset
integer <int64>

Pagination offset. Use next_offset from the previous response to fetch the next page. Defaults to 0.

+

Responses

Response samples

Content type
application/json
{
  • "products": [
    ],
  • "nextOffset": 0
}

Get a single published product

Retrieves a single published product by its product ID. Returns NOT_FOUND if the product does not exist or is not published.

+
Authorizations:
hmac
path Parameters
shopId
required
string

Shop identifier from Stash Studio

+
productId
required
string

Product identifier

+

Responses

Response samples

Content type
application/json
{
  • "product": {
    }
}
+ + + + diff --git a/docs/gen/redoc.v1.html b/docs/gen/redoc.v1.html index 0cb524e..95ed627 100644 --- a/docs/gen/redoc.v1.html +++ b/docs/gen/redoc.v1.html @@ -12,392 +12,392 @@ margin: 0; } - -

Stash Web Shop API (1.0.0)

Download OpenAPI specification:

Server-side APIs for Stash web shop integration. This API set includes catalog management, purchase processing, and user management endpoints designed for server-to-server communication between game backends and Stash services.

-

Players

Stash Web Shop API (1.0.0)

Download OpenAPI specification:

Server-side APIs for Stash web shop integration. This API set includes catalog management, purchase processing, and user management endpoints designed for server-to-server communication between game backends and Stash services.

+

Players

Player management endpoints

-

Get player by ID

Retrieves an existing player by ID. Returns player information including profile data and in-game currency balance.

-
Authorizations:
hmac
query Parameters
playerId
required
string

The player ID to retrieve

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "player": {
    }
}

Catalog

Get player by ID

Retrieves an existing player by ID. Returns player information including profile data and in-game currency balance.

+
Authorizations:
hmac
query Parameters
playerId
required
string

The player ID to retrieve

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "player": {
    }
}

Catalog

Product catalog endpoints

-

Get product catalog

Retrieves the complete product catalog including all purchasable items, offer chains, and non-purchasable display items organized in rows.

-
Authorizations:
hmac
query Parameters
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Get product catalog

Retrieves the complete product catalog including all purchasable items, offer chains, and non-purchasable display items organized in rows.

+
Authorizations:
hmac
query Parameters
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Optional platform filter to get platform-specific catalog items

+" class="sc-eeDRCX sc-eBMEMD grZYze ePkpMc">

Optional platform filter to get platform-specific catalog items

  • CATALOG_PLATFORM_UNSPECIFIED: Default unknown platform
-
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

-
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

-
playerId
string

Optional player ID filter to get player-specific catalog items

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "catalog": {
    }
}

Get offer details

Retrieves detailed information about a specific offer, including reward details and tabbed content with structured data tables for each item.

-
Authorizations:
hmac
query Parameters
guid
required
string

The offer/product UUID (auto-generated UUID v5 if not provided in catalog response)

-
productId
required
string

The unique product identifier/SKU

-
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

+
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

+
playerId
string

Optional player ID filter to get player-specific catalog items

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "catalog": {
    }
}

Get offer details

Retrieves detailed information about a specific offer, including reward details and tabbed content with structured data tables for each item.

+
Authorizations:
hmac
query Parameters
guid
required
string

The offer/product UUID (auto-generated UUID v5 if not provided in catalog response)

+
productId
required
string

The unique product identifier/SKU

+
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Optional platform filter to get platform-specific catalog offer details

+" class="sc-eeDRCX sc-eBMEMD grZYze ePkpMc">

Optional platform filter to get platform-specific catalog offer details

  • CATALOG_PLATFORM_UNSPECIFIED: Default unknown platform
-
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

-
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

-
playerId
string

Optional player ID filter to get player-specific catalog items

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "rewardsHeader": {
    }
}

Purchase

region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

+
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

+
playerId
string

Optional player ID filter to get player-specific catalog items

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "rewardsHeader": {
    }
}

Purchase

Purchase processing endpoints

-

Cancel pending payment

Step 2B: Cancels a pending purchase that was previously registered. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

-
Authorizations:
hmac
Request Body schema: application/json
required

Request to cancel a pending purchase that was previously registered.

-
playerId
required
string

The user canceling the purchase

-
transactionId
required
string

Transaction identifier to cancel

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
required
Array of objects (Canceled Item)

List of items in this canceled purchase

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "PURCHASE_CANCELLATION_STATUS_UNSPECIFIED",
  • "message": "string"
}

Confirm payment completion

Step 2A: Confirms and completes a pending purchase that was previously registered. IMPORTANT: Expects HTTP error status (3xx, 4xx, 5xx) codes for failed purchases.

-
Authorizations:
hmac
Request Body schema: application/json
required

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

-
playerId
required
string

The user confirming the purchase

-
transactionId
required
string

Transaction identifier to confirm

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
currency
required
string

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

-
tax
required
integer <int64>

Tax amount in smallest currency unit (e.g. 99 for $0.99, can be 0)

-
total
required
integer <int64>

Total purchase amount in smallest currency unit including tax (e.g. 1098 for $10.98)

-
timeMillis
required
string <int64>

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

-
paymentMethodType
string (- PAYMENT_METHOD_TYPE_UNSPECIFIED: Default unknown payment method +

Cancel pending payment

Step 2B: Cancels a pending purchase that was previously registered. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

+
Authorizations:
hmac
Request Body schema: application/json
required

Request to cancel a pending purchase that was previously registered.

+
playerId
required
string

The user canceling the purchase

+
transactionId
required
string

Transaction identifier to cancel

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
required
Array of objects (Canceled Item)

List of items in this canceled purchase

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "PURCHASE_CANCELLATION_STATUS_UNSPECIFIED",
  • "message": "string"
}

Confirm payment completion

Step 2A: Confirms and completes a pending purchase that was previously registered. IMPORTANT: Expects HTTP error status (3xx, 4xx, 5xx) codes for failed purchases.

+
Authorizations:
hmac
Request Body schema: application/json
required

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

+
playerId
required
string

The user confirming the purchase

+
transactionId
required
string

Transaction identifier to confirm

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
currency
required
string

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

+
tax
required
integer <int64>

Tax amount in smallest currency unit (e.g. 99 for $0.99, can be 0)

+
total
required
integer <int64>

Total purchase amount in smallest currency unit including tax (e.g. 1098 for $10.98)

+
timeMillis
required
string <int64>

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

+
paymentMethodType
string (- PAYMENT_METHOD_TYPE_UNSPECIFIED: Default unknown payment method - PAYMENT_METHOD_TYPE_CARD: Standard credit/debit card payment - PAYMENT_METHOD_TYPE_APPLE_PAY: Apple Pay wallet payment - PAYMENT_METHOD_TYPE_GOOGLE_PAY: Google Pay wallet payment - PAYMENT_METHOD_TYPE_PAYPAL: PayPal payment - - PAYMENT_METHOD_TYPE_KLARNA: Klarna buy-now-pay-later payment)
Default: "PAYMENT_METHOD_TYPE_UNSPECIFIED"
Enum: "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 used for this purchase (e.g., card, Apple Pay, Google Pay)

-
required
Array of objects (Purchased Item)

List of items in this purchase

-
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

-
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source + - PAYMENT_METHOD_TYPE_KLARNA: Klarna buy-now-pay-later payment)
Default: "PAYMENT_METHOD_TYPE_UNSPECIFIED"
Enum: "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 used for this purchase (e.g., card, Apple Pay, Google Pay)

+
required
Array of objects (Purchased Item)

List of items in this purchase

+
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

+
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source - PURCHASE_SOURCE_CART: Purchase initiated from cart in webstore - - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

-
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

-
Array of objects (Bonus Item)

Optional list of bonus items to be granted with the purchase

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "tax": 0,
  • "total": 0,
  • "timeMillis": "string",
  • "paymentMethodType": "PAYMENT_METHOD_TYPE_UNSPECIFIED",
  • "items": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string",
  • "userEmail": "string",
  • "emailMarketingOptIn": true,
  • "bonusItems": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Register payment intent

Step 1: Registers a purchase intent with the game backend. The game backend is expected to reserve inventory for the purchase. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

-
Authorizations:
hmac
Request Body schema: application/json
required

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
required
string

The user making the purchase

-
transactionId
required
string

Unique transaction identifier for this purchase session

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
currency
required
string

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

-
required
Array of objects (Purchase Registration)

List of items to register for purchase

-
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

-
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source + - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

+
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

+
Array of objects (Bonus Item)

Optional list of bonus items to be granted with the purchase

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "tax": 0,
  • "total": 0,
  • "timeMillis": "string",
  • "paymentMethodType": "PAYMENT_METHOD_TYPE_UNSPECIFIED",
  • "items": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string",
  • "userEmail": "string",
  • "emailMarketingOptIn": true,
  • "bonusItems": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Register payment intent

Step 1: Registers a purchase intent with the game backend. The game backend is expected to reserve inventory for the purchase. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

+
Authorizations:
hmac
Request Body schema: application/json
required

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
required
string

The user making the purchase

+
transactionId
required
string

Unique transaction identifier for this purchase session

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
currency
required
string

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

+
required
Array of objects (Purchase Registration)

List of items to register for purchase

+
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

+
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source - PURCHASE_SOURCE_CART: Purchase initiated from cart in webstore - - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

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

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "registrations": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "statuses": [
    ]
}
+ - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

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

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "registrations": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "statuses": [
    ]
}
-

Stash Web Shop API (1.0.0)

Download OpenAPI specification:

Server-side APIs for Stash web shop integration. This API set includes catalog management, purchase processing, and user management endpoints designed for server-to-server communication between game backends and Stash services.

-

Players

Stash Web Shop API (1.0.0)

Download OpenAPI specification:

Server-side APIs for Stash web shop integration. This API set includes catalog management, purchase processing, and user management endpoints designed for server-to-server communication between game backends and Stash services.

+

Players

Player management endpoints

-

Get player by ID

Retrieves an existing player by ID. Returns player information including profile data and in-game currency balance.

-
Authorizations:
hmac
query Parameters
playerId
required
string

The player ID to retrieve

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "player": {
    }
}

Catalog

Get player by ID

Retrieves an existing player by ID. Returns player information including profile data and in-game currency balance.

+
Authorizations:
hmac
query Parameters
playerId
required
string

The player ID to retrieve

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "player": {
    }
}

Catalog

Product catalog endpoints

-

Get product catalog

Retrieves the complete product catalog including all purchasable items, offer chains, and non-purchasable display items organized in rows.

-
Authorizations:
hmac
query Parameters
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Get product catalog

Retrieves the complete product catalog including all purchasable items, offer chains, and non-purchasable display items organized in rows.

+
Authorizations:
hmac
query Parameters
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Optional platform filter to get platform-specific catalog items

+" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr">

Optional platform filter to get platform-specific catalog items

  • CATALOG_PLATFORM_UNSPECIFIED: Default unknown platform
-
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

-
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

-
playerId
string

Optional player ID filter to get player-specific catalog items

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "catalog": {
    }
}

Get offer details

Retrieves detailed information about a specific offer, including reward details and tabbed content with structured data tables for each item.

-
Authorizations:
hmac
query Parameters
guid
required
string

The offer/product UUID (auto-generated UUID v5 if not provided in catalog response)

-
productId
required
string

The unique product identifier/SKU

-
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

+
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

+
playerId
string

Optional player ID filter to get player-specific catalog items

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "catalog": {
    }
}

Get offer details

Retrieves detailed information about a specific offer, including reward details and tabbed content with structured data tables for each item.

+
Authorizations:
hmac
query Parameters
guid
required
string

The offer/product UUID (auto-generated UUID v5 if not provided in catalog response)

+
productId
required
string

The unique product identifier/SKU

+
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Optional platform filter to get platform-specific catalog offer details

+" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr">

Optional platform filter to get platform-specific catalog offer details

  • CATALOG_PLATFORM_UNSPECIFIED: Default unknown platform
-
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

-
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

-
playerId
string

Optional player ID filter to get player-specific catalog items

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "rewardsHeader": {
    }
}

Purchase

region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

+
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

+
playerId
string

Optional player ID filter to get player-specific catalog items

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "rewardsHeader": {
    }
}

Purchase

Purchase processing endpoints

-

Cancel pending payment

Step 2B: Cancels a pending purchase that was previously registered. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

-
Authorizations:
hmac
Request Body schema: application/json
required

Request to cancel a pending purchase that was previously registered.

-
playerId
required
string

The user canceling the purchase

-
transactionId
required
string

Transaction identifier to cancel

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
required
Array of objects (Canceled Item)

List of items in this canceled purchase

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "PURCHASE_CANCELLATION_STATUS_UNSPECIFIED",
  • "message": "string"
}

Confirm payment completion

Step 2A: Confirms and completes a pending purchase that was previously registered. IMPORTANT: Expects HTTP error status (3xx, 4xx, 5xx) codes for failed purchases.

-
Authorizations:
hmac
Request Body schema: application/json
required

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

-
playerId
required
string

The user confirming the purchase

-
transactionId
required
string

Transaction identifier to confirm

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
currency
required
string

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

-
tax
required
integer <int64>

Tax amount in smallest currency unit (e.g. 99 for $0.99, can be 0)

-
total
required
integer <int64>

Total purchase amount in smallest currency unit including tax (e.g. 1098 for $10.98)

-
timeMillis
required
string <int64>

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

-
paymentMethodType
string (- PAYMENT_METHOD_TYPE_UNSPECIFIED: Default unknown payment method +

Cancel pending payment

Step 2B: Cancels a pending purchase that was previously registered. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

+
Authorizations:
hmac
Request Body schema: application/json
required

Request to cancel a pending purchase that was previously registered.

+
playerId
required
string

The user canceling the purchase

+
transactionId
required
string

Transaction identifier to cancel

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
required
Array of objects (Canceled Item)

List of items in this canceled purchase

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "PURCHASE_CANCELLATION_STATUS_UNSPECIFIED",
  • "message": "string"
}

Confirm payment completion

Step 2A: Confirms and completes a pending purchase that was previously registered. IMPORTANT: Expects HTTP error status (3xx, 4xx, 5xx) codes for failed purchases.

+
Authorizations:
hmac
Request Body schema: application/json
required

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

+
playerId
required
string

The user confirming the purchase

+
transactionId
required
string

Transaction identifier to confirm

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
currency
required
string

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

+
tax
required
integer <int64>

Tax amount in smallest currency unit (e.g. 99 for $0.99, can be 0)

+
total
required
integer <int64>

Total purchase amount in smallest currency unit including tax (e.g. 1098 for $10.98)

+
timeMillis
required
string <int64>

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

+
paymentMethodType
string (- PAYMENT_METHOD_TYPE_UNSPECIFIED: Default unknown payment method - PAYMENT_METHOD_TYPE_CARD: Standard credit/debit card payment - PAYMENT_METHOD_TYPE_APPLE_PAY: Apple Pay wallet payment - PAYMENT_METHOD_TYPE_GOOGLE_PAY: Google Pay wallet payment - PAYMENT_METHOD_TYPE_PAYPAL: PayPal payment - - PAYMENT_METHOD_TYPE_KLARNA: Klarna buy-now-pay-later payment)
Default: "PAYMENT_METHOD_TYPE_UNSPECIFIED"
Enum: "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 used for this purchase (e.g., card, Apple Pay, Google Pay)

-
required
Array of objects (Purchased Item)

List of items in this purchase

-
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

-
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source + - PAYMENT_METHOD_TYPE_KLARNA: Klarna buy-now-pay-later payment)
Default: "PAYMENT_METHOD_TYPE_UNSPECIFIED"
Enum: "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 used for this purchase (e.g., card, Apple Pay, Google Pay)

+
required
Array of objects (Purchased Item)

List of items in this purchase

+
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

+
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source - PURCHASE_SOURCE_CART: Purchase initiated from cart in webstore - - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

-
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

-
Array of objects (Bonus Item)

Optional list of bonus items to be granted with the purchase

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "tax": 0,
  • "total": 0,
  • "timeMillis": "string",
  • "paymentMethodType": "PAYMENT_METHOD_TYPE_UNSPECIFIED",
  • "items": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string",
  • "userEmail": "string",
  • "emailMarketingOptIn": true,
  • "bonusItems": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Register payment intent

Step 1: Registers a purchase intent with the game backend. The game backend is expected to reserve inventory for the purchase. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

-
Authorizations:
hmac
Request Body schema: application/json
required

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
required
string

The user making the purchase

-
transactionId
required
string

Unique transaction identifier for this purchase session

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
currency
required
string

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

-
required
Array of objects (Purchase Registration)

List of items to register for purchase

-
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

-
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source + - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

+
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

+
Array of objects (Bonus Item)

Optional list of bonus items to be granted with the purchase

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "tax": 0,
  • "total": 0,
  • "timeMillis": "string",
  • "paymentMethodType": "PAYMENT_METHOD_TYPE_UNSPECIFIED",
  • "items": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string",
  • "userEmail": "string",
  • "emailMarketingOptIn": true,
  • "bonusItems": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Register payment intent

Step 1: Registers a purchase intent with the game backend. The game backend is expected to reserve inventory for the purchase. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

+
Authorizations:
hmac
Request Body schema: application/json
required

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
required
string

The user making the purchase

+
transactionId
required
string

Unique transaction identifier for this purchase session

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
currency
required
string

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

+
required
Array of objects (Purchase Registration)

List of items to register for purchase

+
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

+
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source - PURCHASE_SOURCE_CART: Purchase initiated from cart in webstore - - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

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

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "registrations": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "statuses": [
    ]
}
+ - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

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

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "registrations": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "statuses": [
    ]
}
-

Stash Web Shop API (1.0.0)

Download OpenAPI specification:

Server-side APIs for Stash web shop integration. This API set includes catalog management, purchase processing, and user management endpoints designed for server-to-server communication between game backends and Stash services.

-

Players

Stash Web Shop API (1.0.0)

Download OpenAPI specification:

Server-side APIs for Stash web shop integration. This API set includes catalog management, purchase processing, and user management endpoints designed for server-to-server communication between game backends and Stash services.

+

Players

Player management endpoints

-

Get player by ID

Retrieves an existing player by ID. Returns player information including profile data and in-game currency balance.

-
Authorizations:
hmac
query Parameters
playerId
required
string

The player ID to retrieve

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "player": {
    }
}

Catalog

Get player by ID

Retrieves an existing player by ID. Returns player information including profile data and in-game currency balance.

+
Authorizations:
hmac
query Parameters
playerId
required
string

The player ID to retrieve

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "player": {
    }
}

Catalog

Product catalog endpoints

-

Get product catalog

Retrieves the complete product catalog including all purchasable items, offer chains, and non-purchasable display items organized in rows.

-
Authorizations:
hmac
query Parameters
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Get product catalog

Retrieves the complete product catalog including all purchasable items, offer chains, and non-purchasable display items organized in rows.

+
Authorizations:
hmac
query Parameters
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Optional platform filter to get platform-specific catalog items

+" class="sc-eeDRCX sc-eBMEMD grZYze ePkpMc">

Optional platform filter to get platform-specific catalog items

  • CATALOG_PLATFORM_UNSPECIFIED: Default unknown platform
-
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

-
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

-
playerId
string

Optional player ID filter to get player-specific catalog items

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "catalog": {
    }
}

Get offer details

Retrieves detailed information about a specific offer, including reward details and tabbed content with structured data tables for each item.

-
Authorizations:
hmac
query Parameters
guid
required
string

The offer/product UUID (auto-generated UUID v5 if not provided in catalog response)

-
productId
required
string

The unique product identifier/SKU

-
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

+
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

+
playerId
string

Optional player ID filter to get player-specific catalog items

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "catalog": {
    }
}

Get offer details

Retrieves detailed information about a specific offer, including reward details and tabbed content with structured data tables for each item.

+
Authorizations:
hmac
query Parameters
guid
required
string

The offer/product UUID (auto-generated UUID v5 if not provided in catalog response)

+
productId
required
string

The unique product identifier/SKU

+
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Optional platform filter to get platform-specific catalog offer details

+" class="sc-eeDRCX sc-eBMEMD grZYze ePkpMc">

Optional platform filter to get platform-specific catalog offer details

  • CATALOG_PLATFORM_UNSPECIFIED: Default unknown platform
-
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

-
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

-
playerId
string

Optional player ID filter to get player-specific catalog items

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "rewardsHeader": {
    }
}

Purchase

region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

+
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

+
playerId
string

Optional player ID filter to get player-specific catalog items

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "rewardsHeader": {
    }
}

Purchase

Purchase processing endpoints

-

Cancel pending payment

Step 2B: Cancels a pending purchase that was previously registered. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

-
Authorizations:
hmac
Request Body schema: application/json
required

Request to cancel a pending purchase that was previously registered.

-
playerId
required
string

The user canceling the purchase

-
transactionId
required
string

Transaction identifier to cancel

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
required
Array of objects (Canceled Item)

List of items in this canceled purchase

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "PURCHASE_CANCELLATION_STATUS_UNSPECIFIED",
  • "message": "string"
}

Confirm payment completion

Step 2A: Confirms and completes a pending purchase that was previously registered. IMPORTANT: Expects HTTP error status (3xx, 4xx, 5xx) codes for failed purchases.

-
Authorizations:
hmac
Request Body schema: application/json
required

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

-
playerId
required
string

The user confirming the purchase

-
transactionId
required
string

Transaction identifier to confirm

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
currency
required
string

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

-
tax
required
integer <int64>

Tax amount in smallest currency unit (e.g. 99 for $0.99, can be 0)

-
total
required
integer <int64>

Total purchase amount in smallest currency unit including tax (e.g. 1098 for $10.98)

-
timeMillis
required
string <int64>

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

-
paymentMethodType
string (- PAYMENT_METHOD_TYPE_UNSPECIFIED: Default unknown payment method +

Cancel pending payment

Step 2B: Cancels a pending purchase that was previously registered. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

+
Authorizations:
hmac
Request Body schema: application/json
required

Request to cancel a pending purchase that was previously registered.

+
playerId
required
string

The user canceling the purchase

+
transactionId
required
string

Transaction identifier to cancel

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
required
Array of objects (Canceled Item)

List of items in this canceled purchase

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "PURCHASE_CANCELLATION_STATUS_UNSPECIFIED",
  • "message": "string"
}

Confirm payment completion

Step 2A: Confirms and completes a pending purchase that was previously registered. IMPORTANT: Expects HTTP error status (3xx, 4xx, 5xx) codes for failed purchases.

+
Authorizations:
hmac
Request Body schema: application/json
required

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

+
playerId
required
string

The user confirming the purchase

+
transactionId
required
string

Transaction identifier to confirm

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
currency
required
string

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

+
tax
required
integer <int64>

Tax amount in smallest currency unit (e.g. 99 for $0.99, can be 0)

+
total
required
integer <int64>

Total purchase amount in smallest currency unit including tax (e.g. 1098 for $10.98)

+
timeMillis
required
string <int64>

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

+
paymentMethodType
string (- PAYMENT_METHOD_TYPE_UNSPECIFIED: Default unknown payment method - PAYMENT_METHOD_TYPE_CARD: Standard credit/debit card payment - PAYMENT_METHOD_TYPE_APPLE_PAY: Apple Pay wallet payment - PAYMENT_METHOD_TYPE_GOOGLE_PAY: Google Pay wallet payment - PAYMENT_METHOD_TYPE_PAYPAL: PayPal payment - - PAYMENT_METHOD_TYPE_KLARNA: Klarna buy-now-pay-later payment)
Default: "PAYMENT_METHOD_TYPE_UNSPECIFIED"
Enum: "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 used for this purchase (e.g., card, Apple Pay, Google Pay)

-
required
Array of objects (Purchased Item)

List of items in this purchase

-
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

-
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source + - PAYMENT_METHOD_TYPE_KLARNA: Klarna buy-now-pay-later payment)
Default: "PAYMENT_METHOD_TYPE_UNSPECIFIED"
Enum: "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 used for this purchase (e.g., card, Apple Pay, Google Pay)

+
required
Array of objects (Purchased Item)

List of items in this purchase

+
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

+
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source - PURCHASE_SOURCE_CART: Purchase initiated from cart in webstore - - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

-
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

-
Array of objects (Bonus Item)

Optional list of bonus items to be granted with the purchase

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "tax": 0,
  • "total": 0,
  • "timeMillis": "string",
  • "paymentMethodType": "PAYMENT_METHOD_TYPE_UNSPECIFIED",
  • "items": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string",
  • "userEmail": "string",
  • "emailMarketingOptIn": true,
  • "bonusItems": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Register payment intent

Step 1: Registers a purchase intent with the game backend. The game backend is expected to reserve inventory for the purchase. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

-
Authorizations:
hmac
Request Body schema: application/json
required

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
required
string

The user making the purchase

-
transactionId
required
string

Unique transaction identifier for this purchase session

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
currency
required
string

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

-
required
Array of objects (Purchase Registration)

List of items to register for purchase

-
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

-
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source + - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

+
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

+
Array of objects (Bonus Item)

Optional list of bonus items to be granted with the purchase

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "tax": 0,
  • "total": 0,
  • "timeMillis": "string",
  • "paymentMethodType": "PAYMENT_METHOD_TYPE_UNSPECIFIED",
  • "items": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string",
  • "userEmail": "string",
  • "emailMarketingOptIn": true,
  • "bonusItems": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Register payment intent

Step 1: Registers a purchase intent with the game backend. The game backend is expected to reserve inventory for the purchase. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

+
Authorizations:
hmac
Request Body schema: application/json
required

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
required
string

The user making the purchase

+
transactionId
required
string

Unique transaction identifier for this purchase session

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
currency
required
string

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

+
required
Array of objects (Purchase Registration)

List of items to register for purchase

+
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

+
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source - PURCHASE_SOURCE_CART: Purchase initiated from cart in webstore - - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

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

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "registrations": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "statuses": [
    ]
}
+ - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

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

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "registrations": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "statuses": [
    ]
}
-

Stash Web Shop API (1.0.0)

Download OpenAPI specification:

Server-side APIs for Stash web shop integration. This API set includes catalog management, purchase processing, and user management endpoints designed for server-to-server communication between game backends and Stash services.

-

Players

Stash Web Shop API (1.0.0)

Download OpenAPI specification:

Server-side APIs for Stash web shop integration. This API set includes catalog management, purchase processing, and user management endpoints designed for server-to-server communication between game backends and Stash services.

+

Players

Player management endpoints

-

Get player by ID

Retrieves an existing player by ID. Returns player information including profile data and in-game currency balance.

-
Authorizations:
hmac
query Parameters
playerId
required
string

The player ID to retrieve

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "player": {
    }
}

Catalog

Get player by ID

Retrieves an existing player by ID. Returns player information including profile data and in-game currency balance.

+
Authorizations:
hmac
query Parameters
playerId
required
string

The player ID to retrieve

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "player": {
    }
}

Catalog

Product catalog endpoints

-

Get product catalog

Retrieves the complete product catalog including all purchasable items, offer chains, and non-purchasable display items organized in rows.

-
Authorizations:
hmac
query Parameters
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Get product catalog

Retrieves the complete product catalog including all purchasable items, offer chains, and non-purchasable display items organized in rows.

+
Authorizations:
hmac
query Parameters
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Optional platform filter to get platform-specific catalog items

+" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr">

Optional platform filter to get platform-specific catalog items

  • CATALOG_PLATFORM_UNSPECIFIED: Default unknown platform
-
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

-
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

-
playerId
string

Optional player ID filter to get player-specific catalog items

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "catalog": {
    }
}

Get offer details

Retrieves detailed information about a specific offer, including reward details and tabbed content with structured data tables for each item.

-
Authorizations:
hmac
query Parameters
guid
required
string

The offer/product UUID (auto-generated UUID v5 if not provided in catalog response)

-
productId
required
string

The unique product identifier/SKU

-
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

+
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

+
playerId
string

Optional player ID filter to get player-specific catalog items

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "catalog": {
    }
}

Get offer details

Retrieves detailed information about a specific offer, including reward details and tabbed content with structured data tables for each item.

+
Authorizations:
hmac
query Parameters
guid
required
string

The offer/product UUID (auto-generated UUID v5 if not provided in catalog response)

+
productId
required
string

The unique product identifier/SKU

+
platform
string
Default: "CATALOG_PLATFORM_UNSPECIFIED"
Enum: "CATALOG_PLATFORM_UNSPECIFIED" "CATALOG_PLATFORM_IOS" "CATALOG_PLATFORM_ANDROID" "CATALOG_PLATFORM_WEBSTORE"

Optional platform filter to get platform-specific catalog offer details

+" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr">

Optional platform filter to get platform-specific catalog offer details

  • CATALOG_PLATFORM_UNSPECIFIED: Default unknown platform
-
region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

-
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

-
playerId
string

Optional player ID filter to get player-specific catalog items

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "rewardsHeader": {
    }
}

Purchase

region
string

Optional region filter using ISO-3166-1 alpha-2 country code (e.g., 'US', 'EU', 'JP')

+
language
string

Optional language code filter using ISO 639-1 code (e.g., 'en', 'es', 'fr', 'de')

+
playerId
string

Optional player ID filter to get player-specific catalog items

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "rewardsHeader": {
    }
}

Purchase

Purchase processing endpoints

-

Cancel pending payment

Step 2B: Cancels a pending purchase that was previously registered. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

-
Authorizations:
hmac
Request Body schema: application/json
required

Request to cancel a pending purchase that was previously registered.

-
playerId
required
string

The user canceling the purchase

-
transactionId
required
string

Transaction identifier to cancel

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
required
Array of objects (Canceled Item)

List of items in this canceled purchase

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "PURCHASE_CANCELLATION_STATUS_UNSPECIFIED",
  • "message": "string"
}

Confirm payment completion

Step 2A: Confirms and completes a pending purchase that was previously registered. IMPORTANT: Expects HTTP error status (3xx, 4xx, 5xx) codes for failed purchases.

-
Authorizations:
hmac
Request Body schema: application/json
required

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

-
playerId
required
string

The user confirming the purchase

-
transactionId
required
string

Transaction identifier to confirm

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
currency
required
string

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

-
tax
required
integer <int64>

Tax amount in smallest currency unit (e.g. 99 for $0.99, can be 0)

-
total
required
integer <int64>

Total purchase amount in smallest currency unit including tax (e.g. 1098 for $10.98)

-
timeMillis
required
string <int64>

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

-
paymentMethodType
string (- PAYMENT_METHOD_TYPE_UNSPECIFIED: Default unknown payment method +

Cancel pending payment

Step 2B: Cancels a pending purchase that was previously registered. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

+
Authorizations:
hmac
Request Body schema: application/json
required

Request to cancel a pending purchase that was previously registered.

+
playerId
required
string

The user canceling the purchase

+
transactionId
required
string

Transaction identifier to cancel

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
required
Array of objects (Canceled Item)

List of items in this canceled purchase

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "PURCHASE_CANCELLATION_STATUS_UNSPECIFIED",
  • "message": "string"
}

Confirm payment completion

Step 2A: Confirms and completes a pending purchase that was previously registered. IMPORTANT: Expects HTTP error status (3xx, 4xx, 5xx) codes for failed purchases.

+
Authorizations:
hmac
Request Body schema: application/json
required

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

+
playerId
required
string

The user confirming the purchase

+
transactionId
required
string

Transaction identifier to confirm

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
currency
required
string

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

+
tax
required
integer <int64>

Tax amount in smallest currency unit (e.g. 99 for $0.99, can be 0)

+
total
required
integer <int64>

Total purchase amount in smallest currency unit including tax (e.g. 1098 for $10.98)

+
timeMillis
required
string <int64>

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

+
paymentMethodType
string (- PAYMENT_METHOD_TYPE_UNSPECIFIED: Default unknown payment method - PAYMENT_METHOD_TYPE_CARD: Standard credit/debit card payment - PAYMENT_METHOD_TYPE_APPLE_PAY: Apple Pay wallet payment - PAYMENT_METHOD_TYPE_GOOGLE_PAY: Google Pay wallet payment - PAYMENT_METHOD_TYPE_PAYPAL: PayPal payment - - PAYMENT_METHOD_TYPE_KLARNA: Klarna buy-now-pay-later payment)
Default: "PAYMENT_METHOD_TYPE_UNSPECIFIED"
Enum: "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 used for this purchase (e.g., card, Apple Pay, Google Pay)

-
required
Array of objects (Purchased Item)

List of items in this purchase

-
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

-
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source + - PAYMENT_METHOD_TYPE_KLARNA: Klarna buy-now-pay-later payment)
Default: "PAYMENT_METHOD_TYPE_UNSPECIFIED"
Enum: "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 used for this purchase (e.g., card, Apple Pay, Google Pay)

+
required
Array of objects (Purchased Item)

List of items in this purchase

+
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

+
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source - PURCHASE_SOURCE_CART: Purchase initiated from cart in webstore - - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

-
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

-
Array of objects (Bonus Item)

Optional list of bonus items to be granted with the purchase

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "tax": 0,
  • "total": 0,
  • "timeMillis": "string",
  • "paymentMethodType": "PAYMENT_METHOD_TYPE_UNSPECIFIED",
  • "items": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string",
  • "userEmail": "string",
  • "emailMarketingOptIn": true,
  • "bonusItems": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Register payment intent

Step 1: Registers a purchase intent with the game backend. The game backend is expected to reserve inventory for the purchase. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

-
Authorizations:
hmac
Request Body schema: application/json
required

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
required
string

The user making the purchase

-
transactionId
required
string

Unique transaction identifier for this purchase session

-
checkoutLinkId
string

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

-
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

-
currency
required
string

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

-
required
Array of objects (Purchase Registration)

List of items to register for purchase

-
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

-
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source + - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

+
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

+
Array of objects (Bonus Item)

Optional list of bonus items to be granted with the purchase

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "tax": 0,
  • "total": 0,
  • "timeMillis": "string",
  • "paymentMethodType": "PAYMENT_METHOD_TYPE_UNSPECIFIED",
  • "items": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string",
  • "userEmail": "string",
  • "emailMarketingOptIn": true,
  • "bonusItems": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Register payment intent

Step 1: Registers a purchase intent with the game backend. The game backend is expected to reserve inventory for the purchase. IMPORTANT: Always expects HTTP 200 OK response with inline error codes in the body.

+
Authorizations:
hmac
Request Body schema: application/json
required

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
required
string

The user making the purchase

+
transactionId
required
string

Unique transaction identifier for this purchase session

+
checkoutLinkId
string

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

+
environment
string
Default: "PAYMENT_ENVIRONMENT_UNSPECIFIED"
Enum: "PAYMENT_ENVIRONMENT_UNSPECIFIED" "PAYMENT_ENVIRONMENT_TEST" "PAYMENT_ENVIRONMENT_PRODUCTION"

Payment environment for the request

+
currency
required
string

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

+
required
Array of objects (Purchase Registration)

List of items to register for purchase

+
platform
string (- PURCHASE_PLATFORM_UNSPECIFIED: Default unknown platform)
Default: "PURCHASE_PLATFORM_UNSPECIFIED"
Enum: "PURCHASE_PLATFORM_UNSPECIFIED" "PURCHASE_PLATFORM_IOS" "PURCHASE_PLATFORM_ANDROID" "PURCHASE_PLATFORM_WEBSTORE"

Platform making the purchase

+
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
string (- PURCHASE_SOURCE_UNSPECIFIED: Default unknown source - PURCHASE_SOURCE_CART: Purchase initiated from cart in webstore - - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

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

-

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "registrations": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "statuses": [
    ]
}
+ - PURCHASE_SOURCE_DIRECT: Purchase initiated from direct StashPay checkout link)
Default: "PURCHASE_SOURCE_UNSPECIFIED"
Enum: "PURCHASE_SOURCE_UNSPECIFIED" "PURCHASE_SOURCE_CART" "PURCHASE_SOURCE_DIRECT"

Source of the purchase for analytics

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

+

Responses

Request samples

Content type
application/json
{
  • "playerId": "string",
  • "transactionId": "string",
  • "checkoutLinkId": "string",
  • "environment": "PAYMENT_ENVIRONMENT_UNSPECIFIED",
  • "currency": "string",
  • "registrations": [
    ],
  • "platform": "PURCHASE_PLATFORM_UNSPECIFIED",
  • "browser": "string",
  • "deviceId": "string",
  • "source": "PURCHASE_SOURCE_UNSPECIFIED",
  • "ipAddress": "string",
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "statuses": [
    ]
}