> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stash.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook List

> Comprehensive list of all webhook events that Stash can send to your backend, including event types, triggers, payload structures, and detailed examples for purchase, subscription, and payment webhooks across Stash products.

This page lists all webhook events Stash can send to your backend. Each event is triggered by a specific user action or system event. Use the table below to see what's available, then expand the tabs for full payload examples.

> [!NOTE]
>
> **Product-specific events:** Some events are specific to Stash Pay or Stash
> Webshop. See the [Stash Pay integration guide](https://docs.stash.gg/guides/stash-pay/integration.md)
> or [Stash Webshop integration guide](https://docs.stash.gg/guides/stash-webshop/integration.md) for
> product-specific webhook details.

## Available webhooks

`PURCHASE_SUCCEEDED` is the **primary event for granting items**; always subscribe to it. `PURCHASE_REFUNDED` should be handled to revoke or adjust granted items. The remaining events are **optional** and used mainly for analytics, marketing, and behavior tracking.

| Event Type | Required | Products | Description |
| - | - | - | - |
| `PURCHASE_SUCCEEDED` | **Yes** | Pay, Webshop | Purchase successfully completed. Use to grant items to the player. `source` is `"StashPay"`, `"Cart"` or `"BuyNow"`. |
| `PURCHASE_FAILED` | No | Pay, Webshop | A payment was refused or canceled. Use it for support and analytics, not to grant or revoke items. `reasonCode` says why: never show it or `reason` to the player. |
| `PURCHASE_REFUNDED` | Recommended | Pay, Webshop | Full or partial refund processed. Use to revoke or adjust granted items. |
| `OPEN_PAYMENT` | No | Pay, Webshop | Payment process initiated (user starts checkout). |
| `FREE_ITEM_REDEEMED` | No | Pay, Webshop | A player claimed a free item. |
| `LOGGED_IN` | No | Webshop | A player signed in to your webshop with a login code, an authenticated URL or your own OAuth 2.0 server. |
| `MUTATE_CART` | No | Webshop | Cart contents changed (add/remove/quantity). |
| `VIEW_ITEM` | No | Webshop | User viewed an item. At most once per 100 seconds per item per player; a view without a `userId` is sent once per view, up to a per-shop limit. |
| `VIEW_CATALOG_SECTION` | No | Webshop | User scrolled a catalog section into view. At most once per 100 seconds per section per player; a view without a `userId` is sent once per view, up to a per-shop limit. |
| `VIEW_CHECKOUT_PAGE` | No | Webshop | User opened the checkout page. |
| `VIEW_PRODUCT_DETAIL_PAGE` | No | Webshop | User opened a product detail page. |
| `CART_BUTTON_CLICK` | No | Webshop | User interacted with a cart button. |
| `BUY_NOW_ITEM_CLICK` | No | Webshop | User clicked an item that opens checkout directly, without the cart. |
| `PAY_BUTTON_CLICK` | No | Pay, Webshop | User clicked the pay button on the checkout page. |
| `LOYALTY_MILESTONE_CLAIMED` | No | Webshop | Player claimed a loyalty milestone. Only fires when the loyalty program uses async webhook delivery mode. |
| `LOGIN_FAILED` | No | Webshop | A player's sign-in to your webshop was declined, by your server or by Stash. `reason` says why. Off until Stash turns it on for your shop. |
| `OFFER_SLOT_MISMATCH` | No | Webshop | Offers used a template key, or reward, buy button or text slot names, their catalog's templates do not have. The offers still showed. At most once per clock hour per template and set of mismatches. |
| `CATALOG_REJECTED` | No | Webshop | Stash could not fetch your Real-time Catalog or decode its response. At most once per shop per 10-minute window. |
| `CATALOG_ITEMS_DROPPED` | No | Webshop | Your Real-time Catalog was shown, but items were left out or a declared bonus has a missing or invalid picture. At most once per shop per 10-minute window from Stash's server, and once from your webshop. |
| `CATALOG_DATA_CONFLICT` | No | Webshop | Your Real-time Catalog contradicts itself or your shop's configuration. At most once per shop and conflict per 10-minute window; `RESET_TIME_PASSED` once per item and reset time. |
| `CATALOG_TEXT_FALLBACK` | No | Webshop | Catalog texts showed their `defaultText` because their `localizationKey` is not in your shop's localizations, or has no translation in the player's language. The offers still showed. At most once per shop per clock hour. |

`CATALOG_REJECTED`, `CATALOG_ITEMS_DROPPED`, `CATALOG_DATA_CONFLICT` and `CATALOG_TEXT_FALLBACK` report problems in your [Real-time Catalog](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog.md) that you can fix. To start receiving them, contact your Stash engineering partner.

`LOGIN_FAILED` is off by default, so an endpoint that rejects unknown event types is not affected. Once your endpoint accepts the event, contact your Stash engineering partner to turn it on for your shop.

## Payload structure

All v1 webhooks follow a consistent base structure:

```json title="Base Webhook Structure" theme={null}
{
  "type": "PURCHASE_SUCCEEDED",
  "environment": "test",
  "shopId": "your-shop-uuid",
  "purchaseSucceeded": {
    // Event-specific payload
  }
}
```

`type`, `environment` and `shopId` are on every v1 event. The event's payload sits under a key named for the event, such as `purchaseSucceeded` for `PURCHASE_SUCCEEDED`; each example below shows its key.

* `environment` is `"test"` (test/staging) or `"production"` (live). Use it to distinguish test traffic from real transactions.
* `shopId` is the ID of the shop that sent the event. Use it to route events when one endpoint serves several shops.

### Webshop session

`checkoutSessionId` identifies one player's browsing session in your webshop. Events from the same session carry the same value, from catalog views through checkout and the purchase. After 30 minutes without activity, the player's next action starts a new session with a new `checkoutSessionId`. A new browser tab can also start a new session. Treat it as an opaque string.

* **Group a session's events:** collect every event with the same `checkoutSessionId`.
* **Join a purchase to its funnel:** a `PURCHASE_SUCCEEDED` or `PURCHASE_FAILED` carries the `checkoutSessionId` of the views and clicks that led to it.
* **Match the purchase to your purchase calls:** use `transactionId` (or `orderId` on a `"Cart"` purchase), as described under `PURCHASE_SUCCEEDED`. `checkoutSessionId` is not sent on `RegisterPayment` or `ConfirmPayment`.

On `PURCHASE_REFUNDED`, `checkoutSessionId` is the session of the original purchase, not of the refund.

These events can carry it: `PURCHASE_SUCCEEDED`, `PURCHASE_FAILED`, `PURCHASE_REFUNDED`, `FREE_ITEM_REDEEMED`, `LOGGED_IN`, `VIEW_ITEM`, `VIEW_CATALOG_SECTION`, `VIEW_CHECKOUT_PAGE`, `VIEW_PRODUCT_DETAIL_PAGE`, `CART_BUTTON_CLICK`, `BUY_NOW_ITEM_CLICK` and `PAY_BUTTON_CLICK`. It is omitted when the event is not tied to a webshop session, for example a purchase through a Stash Pay checkout link your backend created. It may also be omitted when `analyticsConsent` is `"DECLINED"` or `"UNANSWERED"`. `OPEN_PAYMENT`, `MUTATE_CART`, `LOYALTY_MILESTONE_CLAIMED`, `LOGIN_FAILED`, `OFFER_SLOT_MISMATCH` and the `CATALOG_*` events never carry it.

### Analytics consent

`analyticsConsent` is the player's answer to your webshop's analytics consent banner. `VIEW_ITEM`, `VIEW_CATALOG_SECTION` and `BUY_NOW_ITEM_CLICK` carry it.

| Value | Meaning |
| - | - |
| `"ACCEPTED"` | The player accepted analytics. |
| `"DECLINED"` | The player declined analytics. |
| `"UNANSWERED"` | The player has not answered the banner yet. |

Depending on your webshop, `userId` and `checkoutSessionId` are either sent with every answer, or omitted unless the answer is `"ACCEPTED"`. A view or click without a `userId` can also come from a signed-out visitor. To find out which applies to your shop, contact your Stash engineering partner.

The field is omitted when no answer was reported, for example when your webshop shows no consent banner. It describes the banner answer only: it is not a permission that Stash grants, and it does not authenticate the event.

## Detailed payload examples

Pick the event you're integrating to see its full JSON payload.

> [tab] PURCHASE\_SUCCEEDED
>
> Triggered when a purchase is successfully completed. The `source` field says where the purchase started:
>
> | `source` | Purchase |
> | :- | :- |
> | `"StashPay"` | A Stash Pay checkout link your backend created |
> | `"Cart"` | A Webshop cart checkout |
> | `"BuyNow"` | A single item bought directly from the Webshop, without the cart |
>
> To match the event to the purchase your backend saw on `RegisterPayment` or `ConfirmPayment`, use `transactionId`: it is the transaction ID Stash sent on those calls. On a `"Cart"` purchase, `orderId` carries that ID. `transactionId` may be absent on a `"Cart"` purchase, so match on `orderId` there.
>
> Each entry in `items` describes one purchased item. For a [Real-time Catalog](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog.md), the offer fields repeat what your catalog sent for that item when the purchase started, so you can attribute the purchase to the offer as the player saw it:
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | string | The item's product ID. Several offers can share one product ID; use `guid` to tell them apart. |
> | `guid` | string (optional) | The `guid` of the offer the item was sold under: the `guid` your catalog sent, or the one Stash generated for the item when your catalog sent none. On a `"Cart"` purchase it matches the `guid` on `ConfirmPayment`. |
> | `quantity` | number | Units bought. |
> | `price` | string | Price of one unit. |
> | `priceId` | string (optional) | The Studio price ID the item was priced from: your catalog's `price.priceId`, or the item's product ID when the price was looked up by product ID. Only on `"Cart"` purchases, and omitted when your catalog sent a `price.amount`. See [Studio price lookup](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/items-and-prices.md#studio-price-lookup). |
> | `metadata` | object (optional) | Metadata attached to the item, such as the `metadata` you set on a catalog item. |
> | `purchasePackId` | string (optional) | The `id` of the purchase pack the item belongs to. |
> | `version` | string (optional) | The offer's `version`. |
> | `templateKey` | string (optional) | The offer's `templateKey`. |
>
> Optional fields are omitted when Stash has no value for them, for example when the catalog did not send them. `PURCHASE_FAILED` and `PURCHASE_REFUNDED` items carry the same fields.
>
> `paymentMethodType` says how the player paid. It is omitted when the payment method is unknown.
>
> | `paymentMethodType` | Payment method |
> | :- | :- |
> | `"PAYMENT_METHOD_TYPE_CARD"` | Credit or debit card |
> | `"PAYMENT_METHOD_TYPE_APPLE_PAY"` | Apple Pay |
> | `"PAYMENT_METHOD_TYPE_GOOGLE_PAY"` | Google Pay |
> | `"PAYMENT_METHOD_TYPE_PAYPAL"` | PayPal |
> | `"PAYMENT_METHOD_TYPE_KLARNA"` | Klarna |
> | `"PAYMENT_METHOD_TYPE_IDEAL"` | iDEAL |
> | `"PAYMENT_METHOD_TYPE_EPS"` | EPS |
> | `"PAYMENT_METHOD_TYPE_AFTERPAY"` | Afterpay |
> | `"PAYMENT_METHOD_TYPE_BANCONTACT"` | Bancontact |
>
> `taxInclusive` says whether the item prices already include `tax`. It has the same value as on the purchase's [`ConfirmPayment`](https://docs.stash.gg/api/egress/purchase/confirmpayment):
>
> | `taxInclusive` | Meaning |
> | :- | :- |
> | `true` | The item prices include `tax`, as in markets where prices include VAT. `tax` is the share inside them. |
> | `false` | `tax` is added on top of the item prices, or the purchase has no tax. |
>
> `taxInclusive` is absent only when Stash cannot determine the tax mode. `isInclusive` on each `taxDetails` line gives the same mode per tax line. For a purchase without a cash coupon, `total`, minus `tax` when `taxInclusive` is `false`, equals the sum of `price` × `quantity` over `items`.
>
> ```json title="Purchase Succeeded Event (Stash Pay example)" theme={null}
> {
>   "type": "PURCHASE_SUCCEEDED",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "purchaseSucceeded": {
>     "timeMillis": 1640995200000,
>     "transactionId": "txn_789",
>     "orderId": "order_abc123",
>     "checkoutLinkId": "checkout_xyz789",
>     "currency": "USD",
>     "userId": "user_123",
>     "items": [
>       {
>         "id": "item_456",
>         "guid": "item_456_summer",
>         "quantity": 2,
>         "price": "9.99",
>         "metadata": {
>           "category": "weapons",
>           "rarity": "legendary"
>         },
>         "purchasePackId": "summer-offer",
>         "version": "5",
>         "templateKey": "starter-offer-v2"
>       }
>     ],
>     "tax": "1.50",
>     "total": "21.48",
>     "taxInclusive": false,
>     "taxDetails": {
>       "items": [
>         {
>           "label": "Sales Tax",
>           "isInclusive": false,
>           "amount": "1.50",
>           "percentage": "7.5",
>           "country": "US",
>           "state": "CA"
>         }
>       ]
>     },
>     "emailMarketingOptIn": true,
>     "regionCode": "US",
>     "source": "StashPay",
>     "ipAddress": "192.168.1.1",
>     "paymentMethodType": "PAYMENT_METHOD_TYPE_CARD",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] PURCHASE\_FAILED
>
> Triggered when the payment provider refuses a payment (for example, a declined card) or a payment is canceled after authorization. Use it for support and analytics, not to grant or revoke items.
>
> > [!WARNING]
> >
> > **Never show `reasonCode` or `reason` to the player.** For a card or payment refusal, show a generic message, such as "Your payment could not be completed." Refusal details such as insufficient funds, suspected fraud or blocked-card signals help bad actors probe payment checks. This applies to `PURCHASE_FAILED` only; a decline your server returns from [`ConfirmPayment`](https://docs.stash.gg/api/egress/purchase/confirmpayment) is a different case.
>
> `reasonCode` says why the payment failed. It is always one of the values below, and the same refusal gives the same value whichever payment provider handled the payment. Build your analytics and support tooling on it.
>
> | `reasonCode` | Meaning |
> | - | - |
> | `insufficient_funds` | The account cannot cover the amount. |
> | `card_expired` | The card's expiry date has passed. |
> | `invalid_card` | The card cannot be charged: invalid number, unknown issuer or closed account. |
> | `invalid_card_details` | The details entered don't match the card: wrong CVC, expiry date, postal code or PIN. |
> | `suspected_fraud` | The payment was flagged as potential fraud. |
> | `card_lost_or_stolen` | The card was reported lost or stolen. |
> | `card_blocked` | The card is blocked or restricted. |
> | `issuer_declined` | The bank declined the payment without a more specific cause. |
> | `transaction_not_allowed` | This kind of payment is not permitted for the card. |
> | `limit_exceeded` | An amount or frequency limit was exceeded. |
> | `issuer_unavailable` | The bank or card network could not be reached. Trying again later may work. |
> | `authentication_failed` | 3D Secure authentication failed or the player abandoned it. |
> | `authentication_required` | The bank requires 3D Secure authentication for this payment. |
> | `payment_stopped` | The cardholder or the bank stopped or revoked the payment. |
> | `declined_other` | Any other cause, including a payment canceled after authorization. |
>
> Treat any value you don't recognize as `declined_other`: new values may be added over time.
>
> `reason` is free text for your logs and support team. Its wording can change, so read `reasonCode` instead of parsing it. See [Testing refusal reasons](https://docs.stash.gg/guides/get-started/test-cards.md#testing-refusal-reasons) for the refusals you can trigger in the test environment.
>
> ```json title="Purchase Failed Event" theme={null}
> {
>   "type": "PURCHASE_FAILED",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "purchaseFailed": {
>     "timeMillis": 1640995200000,
>     "transactionId": "txn_789",
>     "checkoutLinkId": "checkout_xyz789",
>     "userId": "user_123",
>     "items": [
>       {
>         "id": "item_456",
>         "quantity": 2,
>         "price": "9.99"
>       }
>     ],
>     "totalPrice": "21.48",
>     "currency": "USD",
>     "decimalPlaces": 2,
>     "reasonCode": "insufficient_funds",
>     "reason": "Payment failed: Insufficient funds (Warning: do not expose specific refusal reasons to shoppers, to prevent malicious use of details)",
>     "regionCode": "US",
>     "source": "StashPay",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] PURCHASE\_REFUNDED
>
> Triggered when a refund is successfully processed for a previous purchase. Both full and partial refunds fire this event; multiple partial refunds on the same order each generate a separate event.
>
> The `items` array contains all items from the original purchase, not just refunded ones. The `total` field reflects the actual refund amount.
>
> ```json title="Purchase Refunded Event" theme={null}
> {
>   "type": "PURCHASE_REFUNDED",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "purchaseRefunded": {
>     "timeMillis": 1640995200000,
>     "orderId": "order_abc123",
>     "userId": "user_123",
>     "items": [
>       {
>         "id": "item_456",
>         "quantity": 2,
>         "price": "9.99",
>         "metadata": {
>           "category": "weapons",
>           "rarity": "legendary"
>         }
>       }
>     ],
>     "total": "21.48",
>     "currency": "USD",
>     "reason": "Customer requested refund",
>     "regionCode": "US",
>     "source": "StashPay",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] OPEN\_PAYMENT
>
> Triggered when the payment process is initiated. The `source` field is `"StashPay"` for Stash Pay or `"Cart"` for Webshop.
>
> ```json title="Open Payment Event" theme={null}
> {
>   "type": "OPEN_PAYMENT",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "openPayment": {
>     "cartId": "cart_789",
>     "userId": "user_123",
>     "items": [
>       {
>         "id": "item_456",
>         "quantity": 2
>       }
>     ],
>     "source": "StashPay"
>   }
> }
> ```

> [tab] FREE\_ITEM\_REDEEMED
>
> Triggered when a player claims a free item in your shop. Promo codes never trigger it: a promo code applies at checkout, as a discount or a bonus item (see [Create and Edit Promo Codes](https://docs.stash.gg/guides/stash-webshop/how-tos/create-promo-codes.md)).
>
> `itemId` is the catalog item that was granted. `claimId` is the claim it consumed, for catalogs that declare a stable claim identity on free items; it appears only when it differs from `itemId`. See [Free items and claim identity](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/free-items.md).
>
> `redemptionId` identifies one redemption. Every delivery of that redemption carries the same `redemptionId`, so de-duplicate on it and treat it as an opaque string. This includes delivery retries, and the webhook from a player's new claim after a claim that did not complete (see [Claim status](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/free-items.md#claim-status)). A redemption in a later claim window gets a new `redemptionId`, so keep your own rule for how often a claim can be granted.
>
> If a payload has no `redemptionId`, de-duplicate on `userId` + `itemId` + `timeMillis` instead. A retried delivery repeats the original payload unchanged, including `timeMillis`.
>
> `metadata` describes the item, not how it was claimed. For a Real-time Catalog it repeats the `metadata` you set on that free item, and `version` and `templateKey` repeat the free item's `version` and `templateKey`. Each is omitted when your catalog did not send it.
>
> ```json title="Free Item Redeemed Event" theme={null}
> {
>   "type": "FREE_ITEM_REDEEMED",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "freeItemRedeemed": {
>     "timeMillis": 1640995200000,
>     "userId": "user_123",
>     "itemId": "item_free_001_gold_tier",
>     "claimId": "daily_gift",
>     "redemptionId": "6f1c2a9e-4b7d-4e2a-9c3f-8d5e1b0a7c42",
>     "version": "3",
>     "templateKey": "daily-gift-v1",
>     "ipAddress": "192.168.1.1",
>     "metadata": {
>       "rewardTier": "gold"
>     },
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] LOGGED\_IN
>
> Triggered when a player signs in to your webshop by one of these methods. Stash sends it once the player is signed in.
>
> | Sign-in | `checkoutSessionId` |
> | :- | :- |
> | An [account linking](https://docs.stash.gg/guides/stash-webshop/player-authentication/account-linking.md) login code | Present |
> | A URL from [Generate authenticated URL](https://docs.stash.gg/api/ingress/server-urls/generateauthenticatedurl.md) | Present |
> | Your own OAuth 2.0 server, set up by Stash for your shop | Omitted |
>
> [Direct Sign in (SSO)](https://docs.stash.gg/guides/stash-webshop/player-authentication/authentication-methods.md#direct-sign-in-sso) with providers such as Google, Apple or Facebook sends no `LOGGED_IN`.
>
> ```json title="Logged In Event" theme={null}
> {
>   "type": "LOGGED_IN",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "loggedIn": {
>     "userId": "user_123",
>     "regionCode": "US",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] MUTATE\_CART
>
> Triggered when cart contents are modified. Quantity deltas can be negative (removal) or positive (addition).
>
> ```json title="Mutate Cart Event" theme={null}
> {
>   "type": "MUTATE_CART",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "mutateCart": {
>     "cartId": "cart_789",
>     "timeMillis": 1640995200000,
>     "userId": "user_123",
>     "items": [
>       {
>         "id": "item_456",
>         "quantity": 3
>       },
>       {
>         "id": "item_789",
>         "quantity": -1
>       }
>     ],
>     "regionCode": "US",
>     "source": "Cart",
>     "ipAddress": "192.168.1.1"
>   }
> }
> ```

> [tab] VIEW\_ITEM
>
> Triggered when a user views an item. A view with a `userId` is debounced to once per 100 seconds per item per user. A view without a `userId` is sent once per view, up to a per-shop limit; past that limit, it is debounced to once per 100 seconds per item.
>
> `analyticsConsent` is the player's answer to your webshop's analytics consent banner. See [Analytics consent](#analytics-consent).
>
> ```json title="View Item Event" theme={null}
> {
>   "type": "VIEW_ITEM",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "viewItem": {
>     "userId": "user_123",
>     "itemId": "item_456",
>     "regionCode": "US",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46",
>     "analyticsConsent": "ACCEPTED"
>   }
> }
> ```

> [tab] VIEW\_CATALOG\_SECTION
>
> Triggered when a catalog section scrolls into view. A view with a `userId` is debounced to once per 100 seconds per section per user. A view without a `userId` is sent once per view, up to a per-shop limit; past that limit, it is debounced to once per 100 seconds per section.
>
> `sectionId` is the section's ID. `sectionName` is the section's header, and is omitted when the section has none. `analyticsConsent` is the player's answer to your webshop's analytics consent banner. See [Analytics consent](#analytics-consent).
>
> ```json title="View Catalog Section Event" theme={null}
> {
>   "type": "VIEW_CATALOG_SECTION",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "viewCatalogSection": {
>     "userId": "user_123",
>     "sectionId": "daily-deals",
>     "sectionName": "Daily Deals",
>     "regionCode": "US",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46",
>     "analyticsConsent": "ACCEPTED"
>   }
> }
> ```

> [tab] VIEW\_CHECKOUT\_PAGE
>
> Triggered when the checkout page is viewed.
>
> ```json title="View Checkout Page Event" theme={null}
> {
>   "type": "VIEW_CHECKOUT_PAGE",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "viewCheckoutPage": {
>     "userId": "user_123",
>     "regionCode": "US",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] VIEW\_PRODUCT\_DETAIL\_PAGE
>
> Triggered when a product detail page is viewed.
>
> ```json title="View Product Detail Page Event" theme={null}
> {
>   "type": "VIEW_PRODUCT_DETAIL_PAGE",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "viewProductDetailsPage": {
>     "userId": "user_123",
>     "itemId": "item_456",
>     "regionCode": "US",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] CART\_BUTTON\_CLICK
>
> Triggered when a cart-related button (icon, badge, etc.) is clicked.
>
> ```json title="Cart Button Click Event" theme={null}
> {
>   "type": "CART_BUTTON_CLICK",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "sendCartButtonClick": {
>     "userId": "user_123",
>     "regionCode": "US",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] BUY\_NOW\_ITEM\_CLICK
>
> Triggered when a player clicks an item that opens checkout directly, without the cart.
>
> `itemId` is the clicked item. `productId` is the product ID shared by every offer of that item, and is omitted when Stash has none for the item. `analyticsConsent` is the player's answer to your webshop's analytics consent banner. See [Analytics consent](#analytics-consent).
>
> ```json title="Buy Now Item Click Event" theme={null}
> {
>   "type": "BUY_NOW_ITEM_CLICK",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "buyNowItemClick": {
>     "userId": "user_123",
>     "itemId": "item_456",
>     "productId": "gems_100",
>     "regionCode": "US",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46",
>     "analyticsConsent": "ACCEPTED"
>   }
> }
> ```

> [tab] PAY\_BUTTON\_CLICK
>
> Triggered when a player clicks the pay button on the checkout page:
>
> * **Webshop cart checkout:** `cartId` is the cart being paid.
> * **Stash Pay checkout opened from your webshop:** `cartId` is omitted, and `items` lists the checkout link's items.
>
> Each entry in `items` has the item's `id` and `quantity`, plus `productId` when Stash has one for the item.
>
> ```json title="Pay Button Click Event" theme={null}
> {
>   "type": "PAY_BUTTON_CLICK",
>   "environment": "test",
>   "shopId": "your-shop-uuid",
>   "payButtonClick": {
>     "userId": "user_123",
>     "regionCode": "US",
>     "items": [
>       {
>         "id": "item_456",
>         "quantity": 2,
>         "productId": "gems_100"
>       }
>     ],
>     "cartId": "cart_789",
>     "checkoutSessionId": "8f3c2b1e-6a4d-4c9e-9b2f-5d7a1e0c3b46"
>   }
> }
> ```

> [tab] LOYALTY\_MILESTONE\_CLAIMED
>
> Triggered when a player claims a loyalty milestone. Only fires when your loyalty program is configured for async webhook delivery mode (not synchronous API mode). This event carries the shared `loyalty` payload and a `milestoneTierId`. See [Loyalty webhooks](https://docs.stash.gg/guides/stash-webshop/how-tos/loyalty/analytics-app-integration.md) for the full contract and the [loyalty guide](https://docs.stash.gg/guides/stash-webshop/how-tos/loyalty.md) for configuration.
>
> ```json title="Loyalty Milestone Claimed Event" theme={null}
> {
>   "type": "LOYALTY_MILESTONE_CLAIMED",
>   "environment": "production",
>   "shopId": "your-shop-uuid",
>   "loyaltyMilestoneClaimed": {
>     "timeMillis": 1748476800000,
>     "userId": "player_external_account_id",
>     "milestoneId": "milestone_uuid",
>     "rewards": [
>       {
>         "itemId": "reward_type_id",
>         "quantity": 500
>       }
>     ]
>   }
> }
> ```

> [tab] LOGIN\_FAILED
>
> Triggered when a player's sign-in to your webshop is declined:
>
> * **By your server:** it called [`DeclineCustomLogin`](https://docs.stash.gg/api/ingress/webshop-account-linking/declinecustomlogin) for an [account linking](https://docs.stash.gg/guides/stash-webshop/player-authentication/account-linking.md) login code.
> * **By Stash:** your server sent a client version below your shop's [minimum app version](https://docs.stash.gg/guides/stash-webshop/player-authentication/account-linking.md#set-a-minimum-app-version-optional) for the player's platform, on [`ApproveCustomLogin`](https://docs.stash.gg/api/ingress/webshop-account-linking/approvecustomlogin) or on [Generate authenticated URL](https://docs.stash.gg/api/ingress/server-urls/generateauthenticatedurl.md). Stash declines the login instead of approving the code or creating the link.
>
> An account linking login code sends at most 1 event: retrying the decline, or retrying an approve Stash already declined, sends no second one. Each declined Generate authenticated URL call sends its own event. A login code that expires without being approved or declined sends none.
>
> | `reason` | Meaning |
> | :- | :- |
> | `"NOT_ELIGIBLE"` | The store is not available to this player yet. |
> | `"NOT_IN_ROLLOUT"` | The store is not enabled for this player in the current rollout. |
> | `"CLIENT_OUTDATED"` | The player's app is older than the minimum version your shop requires. |
> | `"OTHER"` | Any other reason. |
>
> Stash only declines with `CLIENT_OUTDATED`. Your server can send any of the reasons: see [Decline a login](https://docs.stash.gg/guides/stash-webshop/player-authentication/account-linking.md#decline-a-login) for when to send each.
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `reason` | string | Why the login was declined: one of the values above. |
> | `declinedBy` | string | `"PARTNER"` when your server declined the login, `"STASH"` when Stash did. |
> | `loginMethod` | string | `"CUSTOM_LOGIN"` for an account linking login code, `"AUTHENTICATED_LINK"` for a Generate authenticated URL call. |
> | `occurredAt` | string | When the login was declined, as an RFC 3339 timestamp in UTC. |
> | `userId` | string (optional) | The player ID your server sent on the declining call. |
> | `clientVersion` | string (optional) | The client version your server sent. |
> | `gameVersion` | string (optional) | The game version your server sent. |
> | `minAppVersion` | string (optional) | The minimum app version that applied to the player's platform. Only when `declinedBy` is `"STASH"`. |
> | `regionCode` | string (optional) | The player's region your server sent, as a Unicode CLDR region code. Only when `declinedBy` is `"STASH"`. |
>
> Optional fields are omitted when the declining call did not carry them.
>
> ```json title="Login Failed Event" theme={null}
> {
>   "type": "LOGIN_FAILED",
>   "environment": "production",
>   "shopId": "your-shop-uuid",
>   "loginFailed": {
>     "userId": "player_123",
>     "reason": "CLIENT_OUTDATED",
>     "declinedBy": "STASH",
>     "clientVersion": "2.13.0",
>     "gameVersion": "512",
>     "minAppVersion": "2.14.0",
>     "loginMethod": "CUSTOM_LOGIN",
>     "regionCode": "BR",
>     "occurredAt": "2026-09-30T12:00:00Z"
>   }
> }
> ```

> [tab] OFFER\_SLOT\_MISMATCH
>
> Triggered when the web shop shows [Real-time Catalog](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog.md) offers whose template key or slot names do not fit their templates (see [Offer templates with named slots](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/offer-templates.md)):
>
> * **Unknown template key:** an offer's `templateKey` names no template your shop has, so the offer showed in your shop's default template. Sent even when nothing else is wrong, so you can tell a misspelled or not-yet-added template from a slot mismatch.
> * **Unmatched layout keys:** a reward's `layoutKey` names no reward slot of the template.
> * **Missing layout keys:** the template has reward slots and a reward has no `layoutKey`. Only reported when at least one offer on the page sends a `layoutKey`, so a catalog that does not use layout keys gets no such reports.
> * **Unmatched text slots:** a `textSlots` name is no text slot of the template.
> * **Unmatched buy button key:** a buy button's `layoutKey` names no buy button slot of the template. A buy button with no `layoutKey` is not reported.
>
> The offers still showed: those rewards, buy buttons and texts were placed by the template's fallback rules. Use the event to correct the names in your catalog.
>
> You get at most one event per clock hour (UTC) for each template and set of mismatches, however many players see the offers, so the same mismatch can arrive twice a few minutes apart across the hour. A new or changed mismatch is sent right away. `offers` lists up to 10 of the affected offers by the IDs your catalog sent, and each name list is sorted and holds up to 20 names.
>
> `unmatchedBuyButtonLayoutKey` is the buy button `layoutKey` the offers sent, and is present only when it names no buy button slot of the template.
>
> `templateKey` is the template key the offers sent, and is omitted when they sent none. When `unknownTemplateKey` is `true`, the key names no template your shop has, the offers showed in your shop's default template, and any other mismatches are against that template's slots.
>
> ```json title="Offer Slot Mismatch Event" theme={null}
> {
>   "type": "OFFER_SLOT_MISMATCH",
>   "environment": "production",
>   "shopId": "your-shop-uuid",
>   "offerSlotMismatch": {
>     "templateKey": "starter-offer-v2",
>     "unknownTemplateKey": false,
>     "unmatchedLayoutKeys": ["Middle"],
>     "missingLayoutKeys": true,
>     "unmatchedTextSlots": ["Subtitle"],
>     "unmatchedBuyButtonLayoutKey": "SKU_Top",
>     "offers": [
>       {
>         "itemId": "starter_bundle",
>         "productId": "starter_bundle"
>       }
>     ],
>     "detectedAt": "2026-10-15T21:05:00Z"
>   }
> }
> ```

> [tab] CATALOG\_REJECTED
>
> Triggered when Stash requests your catalog from your [`GetCatalog`](https://docs.stash.gg/api/egress/catalog/getcatalog) endpoint and the request fails. Until your endpoint answers again, players may see an earlier cached copy of your catalog, or no catalog.
>
> | `reason` | What happened | What to check |
> | :- | :- | :- |
> | `"ENDPOINT_UNAVAILABLE"` | Stash could not reach your endpoint, or it did not answer in time. | Your endpoint's availability and response time. |
> | `"ENDPOINT_ERROR_STATUS"` | Your endpoint answered with an HTTP 4xx or 5xx status. | Your endpoint's logs for the failed requests. |
> | `"RESPONSE_UNDECODABLE"` | Your endpoint answered, but the body is not a valid `GetCatalog` response. | The response body against the [`GetCatalog` reference](https://docs.stash.gg/api/egress/catalog/getcatalog). |
>
> Stash does not send the event for a failure on its own side before the request reaches you, or when the player leaves the page before your endpoint answers.
>
> You get at most 1 event per shop in each 10-minute window (windows start on the hour and every 10 minutes after it, UTC), however many requests fail.
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `timeMillis` | number | When Stash saw the failure that sent this event, in milliseconds since the Unix epoch. |
> | `windowStartMillis` | number | Start of the period `occurrences` covers, in milliseconds since the Unix epoch. |
> | `occurrences` | number | Failed requests from `windowStartMillis` to `timeMillis`. Counted on the Stash server that sent the event, so treat it as a minimum. |
> | `endpoint` | string | Always `"CATALOG"`: your `GetCatalog` endpoint. |
> | `reason` | string | Why the request failed: one of the values above. |
>
> ```json title="Catalog Rejected Event" theme={null}
> {
>   "type": "CATALOG_REJECTED",
>   "environment": "production",
>   "shopId": "your-shop-uuid",
>   "catalogRejected": {
>     "timeMillis": 1700000600000,
>     "windowStartMillis": 1700000000000,
>     "occurrences": 42,
>     "endpoint": "CATALOG",
>     "reason": "ENDPOINT_ERROR_STATUS"
>   }
> }
> ```

> [tab] CATALOG\_ITEMS\_DROPPED
>
> Triggered when catalog items cannot be read or shown, or a bonus you declared has a missing or invalid picture. Use `items` to find each problem in your catalog response.
>
> Problems are reported from 2 places, each separately:
>
> * **Stash's server**, when it cannot read an item, hides a streak's free items because the streak's layout breaks the [streak rules](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/free-items.md#keep-the-layout-whole), or finds a missing or invalid picture for a declared bonus. Bonus-picture reports use `path: "bonusItems[n]"` and the bonus ID as `value`, including bonuses combined into another reward on the card. A bonus-picture report does not mean the server removed the offer. Check the bonus ID and its picture in your shop's reward configuration.
> * **Your webshop**, when it draws the page in the player's browser and cannot show an item, for example because a picture it needs is missing, is not an `https` URL, or fails to load. These entries carry `path` and `value`, which point at the field to fix.
>
> You get at most 1 event per shop from each place in each 10-minute window (windows start on the hour and every 10 minutes after it, UTC), so at most 2 in one window. `droppedCount` and `items` describe the single page load that sent the event; `occurrences` counts page loads with reportable problems. An item you have already fixed can still be reported until the cached copy of your catalog refreshes (see [Caching](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/caching.md)).
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `timeMillis` | number | When the page load that sent this event happened, in milliseconds since the Unix epoch. |
> | `windowStartMillis` | number | Start of the period `occurrences` covers, in milliseconds since the Unix epoch. |
> | `occurrences` | number | Page loads with reportable problems, from `windowStartMillis` to `timeMillis`. Counted on the Stash server that sent the event, so treat it as a minimum. Always `1` on an event from your webshop, whose `windowStartMillis` equals its `timeMillis`. |
> | `droppedCount` | number | Count of distinct problem entries for that page load, including bonus-picture findings on offers the server kept. A truncated webshop report may carry a larger omitted-item count supplied by the browser. May exceed the length of `items`. |
> | `items` | array | Up to 20 reported problems. Server reports list removed items before bonus-picture findings on retained offers, except that a hidden streak lists only its first `STREAK_LAYOUT_INVALID` entry before those findings and the rest after them. Always present. |
> | `truncated` | boolean | `true` when the report contains more problems than `items` holds. |
>
> Each entry in `items`:
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `itemId` | string (optional) | Your ID for the item: the `productId` of a `product` or of a pack's price point, the `itemId` of an `info` or `free` item, or the first link's `productId` for a `chain`. |
> | `guid` | string (optional) | The `guid` you sent for the item. |
> | `reason` | string | Why the item was left out. See below. |
> | `field` | string (optional) | What in the item was malformed, with `ITEM_NOT_CONVERTIBLE`, or which streak rule the section broke, with `STREAK_LAYOUT_INVALID`. Only with these 2 reasons. See below. |
> | `path` | string (optional) | Where in the item the picture problem is, in your catalog's field names, for example `image`, `contents[2].unitImage` or `bonusItems[0]`. |
> | `value` | string (optional) | The reported value, cut to 512 bytes. For `bonusItems[n]`, the bonus ID you sent, rather than its resolved picture URL. Otherwise, the picture value; omitted when absent. |
> | `rewardGuid` | string (optional) | The `guid` you sent for the reward, when the problem is in one of the item's `contents`. |
> | `layoutKey` | string (optional) | The `layoutKey` you sent for the affected reward or declared bonus. |
>
> `itemId` and `guid` are always values from your catalog, never IDs Stash generated. Each is omitted when Stash has none to report, for example for an item of a type Stash does not recognize.
>
> | `reason` | Why the item was left out |
> | :- | :- |
> | `"DUPLICATE_ITEM_ID"` | An earlier item in the response has the same `guid`, or the item repeats the free offer configured for your shop. Stash shows the first one. |
> | `"UNKNOWN_ITEM_VARIANT"` | The item is none of the [catalog item types](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/items-and-prices.md#catalog-items) Stash recognizes. Reported with no `itemId` or `guid`. |
> | `"PRICE_NOT_RESOLVABLE"` | Stash could not look up a Studio price for the item's `priceId`, or for its `productId` when `price` is omitted. See [Studio price lookup](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/items-and-prices.md#studio-price-lookup). |
> | `"CONTENT_LIMIT_EXCEEDED"` | The item has more `contents` entries (in total, featured or not featured) than your shop's content limits allow. |
> | `"PACK_MISSING_ID"` | The item is in a `pack` with no `id`, so the whole pack is left out. Reported once per item in the pack; a pack with no items is reported once, with no `itemId` or `guid`. |
> | `"ITEM_NOT_RENDERABLE"` | Stash read the item but could not draw it, for example an offer chain whose link statuses are out of order, or a `contents` quantity too large for an unsigned 32-bit integer. Also reported by your webshop for an item it cannot draw for another reason. |
> | `"ITEM_NOT_CONVERTIBLE"` | A value in the item is malformed. `field` names it when Stash can. |
> | `"IMAGE_MISSING"` | A required picture is absent or empty. `path` identifies the picture or declared bonus. Reported by your webshop, or by Stash's server for declared bonus pictures. |
> | `"IMAGE_INVALID"` | A picture is not an absolute `https` URL. `path` identifies the picture or declared bonus; `value` contains the picture value or bonus ID. Reported by your webshop, or by Stash's server for declared bonus pictures. |
> | `"IMAGE_LOAD_FAILED"` | A picture's URL did not load in the player's browser. `path` names it and `value` carries the URL. Reported by your webshop. |
> | `"STREAK_LAYOUT_INVALID"` | The item is a `free` item of a [streak tracked by Stash](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/free-items.md#streaks-tracked-by-stash) whose section breaks the [streak rules](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/free-items.md#keep-the-layout-whole), so Stash hides the section's free items. Reported once per hidden item; `field` names the rule broken. Not reported when Stash only inferred the section and shows it as you sent it. Reported by Stash's server. |
>
> | `field` | What was malformed |
> | :- | :- |
> | `"ITEM_EMPTY"` | The item, or a link of an offer chain, is empty, or the item has neither an ID nor a `guid`. |
> | `"PRICE_AMOUNT_INVALID"` | `price.amount` cannot be read, for example because it has no `currency`. |
> | `"PRICE_TYPE_UNKNOWN"` | `price` is present but sets neither `amount` nor `priceId`. |
> | `"PRICE_MISSING"` | The item has no `price`, and Studio price lookup is not set up for your shop. |
> | `"CONTENT_QUANTITY_INVALID"` | A `contents` entry's `quantity` is not an integer. |
> | `"REWARD_BUFF_INVALID"` | A `contents` entry's `rewardBuff` has a `type` Stash does not recognize. |
> | `"BONUS_INVALID"` | The bonus amount in the item's `metadata` is not a whole number from 0 to 4294967295. |
> | `"CHAIN_EMPTY"` | An offer chain has no links. |
> | `"CONTENTS_MISSING"` | A `free` item has no `contents`. |
>
> With `STREAK_LAYOUT_INVALID`, `field` names the streak rule the section broke:
>
> | `field` | Rule broken |
> | :- | :- |
> | `"STREAK_ORDER_GAP"` | The `streakOrder` values do not run from 1 with no gaps. |
> | `"STREAK_ORDER_MIXED"` | Some free items in the section set `streakOrder` and some do not. |
> | `"STREAK_ORDER_DUPLICATE"` | Two items share a `streakOrder` and a `targetTierId`, or share a `streakOrder` and neither sets `targetTierId`. |
> | `"STREAK_ITEM_ID_DUPLICATE"` | Two free items in the section share an `itemId`. |
> | `"STREAK_SEQUENCE_PARTIAL"` | The steps do not make a whole number of sequences of the length set for your shop. |
> | `"STREAK_ORDER_IN_SEVERAL_SECTIONS"` | More than 1 section sets `streakOrder`. The free items of each are reported. |
> | `"STREAK_TIER_LISTS_UNEQUAL"` | No item sets `streakOrder`, and the tiers' lists of items have different lengths. |
> | `"STREAK_TIER_WITH_FREE_OFFER"` | An item sets `targetTierId` while a free offer is configured for your shop. |
> | `"STREAK_STEP_IS_FREE_OFFER"` | An item sets `rewardHiddenWhileLocked`, sets no `targetTierId`, and its `itemId` or its `claimId` is the item ID of the free offer configured for your shop. |
> | `"STREAK_HIDDEN_IDENTITY_SHARED"` | An item sets `rewardHiddenWhileLocked`, and another item in the catalog uses its `itemId` or `guid`, or claims as it. |
>
> ```json title="Catalog Items Dropped Event" theme={null}
> {
>   "type": "CATALOG_ITEMS_DROPPED",
>   "environment": "production",
>   "shopId": "your-shop-uuid",
>   "catalogItemsDropped": {
>     "timeMillis": 1700000600000,
>     "windowStartMillis": 1700000000000,
>     "occurrences": 3,
>     "droppedCount": 2,
>     "items": [
>       {
>         "itemId": "gems_100",
>         "guid": "gems-guid",
>         "reason": "ITEM_NOT_CONVERTIBLE",
>         "field": "PRICE_AMOUNT_INVALID"
>       },
>       {
>         "reason": "UNKNOWN_ITEM_VARIANT"
>       }
>     ],
>     "truncated": false
>   }
> }
> ```
>
> ```json title="Catalog Items Dropped Event (from your webshop)" theme={null}
> {
>   "type": "CATALOG_ITEMS_DROPPED",
>   "environment": "production",
>   "shopId": "your-shop-uuid",
>   "catalogItemsDropped": {
>     "timeMillis": 1700000600000,
>     "windowStartMillis": 1700000600000,
>     "occurrences": 1,
>     "droppedCount": 2,
>     "items": [
>       {
>         "itemId": "starter_bundle",
>         "guid": "starter-bundle-guid",
>         "reason": "IMAGE_INVALID",
>         "path": "contents[0].unitImage",
>         "value": "CoinIcon",
>         "rewardGuid": "coins-guid",
>         "layoutKey": "Reward_Panel_0"
>       },
>       {
>         "itemId": "starter_bundle",
>         "guid": "starter-bundle-guid",
>         "reason": "IMAGE_MISSING",
>         "path": "image"
>       }
>     ],
>     "truncated": false
>   }
> }
> ```

> [tab] CATALOG\_DATA\_CONFLICT
>
> Triggered when your catalog contradicts itself or your shop's configuration, so Stash shows something other than what you intended.
>
> You get at most 1 event per shop and `conflict` value in each 10-minute window (windows start on the hour and every 10 minutes after it, UTC), so 2 different conflicts in the same window are both sent. `"RESET_TIME_PASSED"` is the exception: you get 1 event for each item and reset time, not per window (a reset time that stays in your catalog for hours can occasionally be reported again), and Stash sends a limited number per shop in any 10 minutes, so with many late items the rest arrive in later windows if their time is still in the past then. This event has no `occurrences` or `windowStartMillis`.
>
> | `conflict` | What happened | Fields set |
> | :- | :- | :- |
> | `"FREE_OFFER_ID_NOT_MATCHED"` | Your catalog sent `free` items, but none of them matches the free offer configured for your shop. Stash keeps showing the configured free offer. See [Free items and claim identity](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/free-items.md). | `configuredValue`: the configured free offer's item ID. `receivedValue`: the `itemId` of each `free` item you sent, comma-separated, up to 20. |
> | `"FREE_OFFER_CLAIM_ID_CONFLICT"` | The `free` item whose `itemId` is the configured free offer's item ID declares a different `claimId`. Seen when a player claims the item: Stash ignores that `claimId` and uses the `itemId` as the claim identity. | `itemId` and `configuredValue`: the item ID. `receivedValue`: the `claimId` you sent. |
> | `"PURCHASE_PACK_DUPLICATE_ID"` | 2 or more packs share an `id`, so purchases from any of them carry the same `purchasePackId`. | `itemId`: the pack `id`. |
> | `"PURCHASE_PACK_MULTIPLE_WHOLE_PACK_ITEMS"` | A pack has more than 1 item with `type: PURCHASE_PACK_ITEM_TYPE_WHOLE_PURCHASE_PACK`. See [Purchase packs](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/items-and-prices.md#purchase-packs). | `itemId`: the pack `id`. |
> | `"RESET_TIME_PASSED"` | When Stash fetched your catalog, it still carried a reset time more than 1 minute in the past: a `refreshAt` on a `product`, `pack` or `free` item, `catalog.refreshAt`, or a trigger's `nextResetAt`. The state you promised from that time was not in the response yet. Return the post-reset catalog from the reset time onward; see [Caching](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/caching.md). | `itemId`: the product `productId`, pack `id` or free item `itemId`; omitted for `catalog.refreshAt` and a trigger's `nextResetAt`. `receivedValue`: the reset time you sent, as an RFC 3339 UTC timestamp. |
>
> When several packs have the same conflict, the event names the first by `id` in sort order. Once you fix it, a later window names the next pack still affected.
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `timeMillis` | number | When Stash saw the conflict, in milliseconds since the Unix epoch. |
> | `conflict` | string | What contradicts what: one of the values above. |
> | `itemId` | string (optional) | The pack `id`, free item `itemId` or product `productId` the conflict is about. |
> | `configuredValue` | string (optional) | The value configured for your shop. |
> | `receivedValue` | string (optional) | The value your catalog sent. |
>
> A field the conflict does not use is omitted. Every value is one you sent in your catalog or one configured for your shop.
>
> ```json title="Catalog Data Conflict Event" theme={null}
> {
>   "type": "CATALOG_DATA_CONFLICT",
>   "environment": "production",
>   "shopId": "your-shop-uuid",
>   "catalogDataConflict": {
>     "timeMillis": 1700000600000,
>     "conflict": "FREE_OFFER_ID_NOT_MATCHED",
>     "configuredValue": "daily_gift",
>     "receivedValue": "daily_gift_v2"
>   }
> }
> ```

> [tab] CATALOG\_TEXT\_FALLBACK
>
> Triggered when catalog texts on offers your webshop showed fell back to their `defaultText` because of their `localizationKey` (see [Localization](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/localization-and-text.md#localization)). The offers are still shown; the event tells you which keys to fix.
>
> | `reason` | What happened |
> | :- | :- |
> | `"KEY_UNKNOWN"` | Your shop's localizations have no English entry for the key. A player whose language has a translation for the key still sees it; every other player, English included, sees `defaultText`. Usually a mistyped key, or an offer published before its localization row was imported. |
> | `"TRANSLATION_MISSING"` | The key has an English entry but none in the player's language, so `defaultText` showed in an otherwise translated page. `locale` names the language. |
>
> Keys are matched exactly, including case.
>
> You get at most 1 event per shop in each clock hour (UTC). Unlike `CATALOG_ITEMS_DROPPED`, whose `items` describe one page load, `texts` gathers what one Stash server saw since its previous event, so a key that only some players' catalogs or languages produce still reaches you. One event may not list every text: `keyUnknownCount` and `translationMissingCount` say how many there were. A text keeps being reported each hour until it is fixed, and a fixed text can still be reported until your next localization import and the cached copy of your catalog refresh (see [Caching](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/caching.md)).
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `timeMillis` | number | When the page load that sent this event happened, in milliseconds since the Unix epoch. |
> | `windowStartMillis` | number | Start of the period the event covers, in milliseconds since the Unix epoch. |
> | `occurrences` | number | Page loads with at least 1 text that fell back, from `windowStartMillis` to `timeMillis`. Counted on the Stash server that sent the event, so treat it as a minimum. |
> | `keyUnknownCount` | number | Distinct keys with `KEY_UNKNOWN` in that period. A minimum; may exceed the entries in `texts`. |
> | `translationMissingCount` | number | Distinct pairs of key and `locale` with `TRANSLATION_MISSING` in that period. A minimum; may exceed the entries in `texts`. |
> | `texts` | array | Up to 20 entries, `KEY_UNKNOWN` first, then `TRANSLATION_MISSING`. Always present. |
> | `truncated` | boolean | `true` when there were more texts than `texts` holds. |
>
> Each entry in `texts` names one key once per reason and language, at the first place it was found:
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `reason` | string | `"KEY_UNKNOWN"` or `"TRANSLATION_MISSING"`. |
> | `localizationKey` | string | The `localizationKey` you sent, cut to 512 bytes. |
> | `locale` | string (optional) | The player's language, for example `"nl-NL"`. Only on `TRANSLATION_MISSING`. |
> | `itemId` | string (optional) | Your ID for the item the text is on: the `productId` of a `product` or of a pack's price point, the `id` of a pack for the pack's own texts, the `itemId` of an `info` or `free` item, or the first link's `productId` for a `chain`. Omitted for a text outside any item. |
> | `guid` | string (optional) | The `guid` you sent for the item. |
> | `path` | string (optional) | Where the text is, in your catalog's field names, relative to the item (`name`, `contents[2].name`, `textSlots.Title`, `items[1].name` in a pack), or from the response root for a text outside any item (`catalog.sections[0].header`, `catalog.banner.title`). |
> | `textOmitted` | boolean | `true` when `defaultText` was empty too, so nothing showed. |
>
> ```json title="Catalog Text Fallback Event" theme={null}
> {
>   "type": "CATALOG_TEXT_FALLBACK",
>   "environment": "production",
>   "shopId": "your-shop-uuid",
>   "catalogTextFallback": {
>     "timeMillis": 1700003600000,
>     "windowStartMillis": 1700000000000,
>     "occurrences": 7,
>     "keyUnknownCount": 1,
>     "translationMissingCount": 2,
>     "texts": [
>       {
>         "reason": "KEY_UNKNOWN",
>         "localizationKey": "offer.starter.titel",
>         "itemId": "starter_499",
>         "guid": "starter-guid",
>         "path": "textSlots.Title",
>         "textOmitted": false
>       },
>       {
>         "reason": "TRANSLATION_MISSING",
>         "localizationKey": "offer.starter.title",
>         "locale": "nl-NL",
>         "itemId": "starter_499",
>         "path": "name",
>         "textOmitted": false
>       },
>       {
>         "reason": "TRANSLATION_MISSING",
>         "localizationKey": "section.daily",
>         "locale": "nl-NL",
>         "path": "catalog.sections[0].header",
>         "textOmitted": false
>       }
>     ],
>     "truncated": false
>   }
> }
> ```

## Common fields

Several fields appear across multiple webhook types. Only `type`, `environment` and `shopId` are on every v1 event; check the event's example above for the rest.

| Field | Type | Description |
| - | - | - |
| `type` | string | Event type identifier (e.g. `"PURCHASE_SUCCEEDED"`). |
| `environment` | string | Environment that sent the webhook. Always present. `"test"` or `"production"`. |
| `shopId` | string | ID of the shop that sent the event. Always present on v1 events. |
| `userId` | string | External user identifier from your system. |
| `regionCode` | string | Unicode CLDR region code (e.g. `"US"`, `"FR"`) based on user location. |
| `ipAddress` | string | User's IP address when the event occurred. |
| `timeMillis` | number | When the event happened, in milliseconds since the Unix epoch. Present on `PURCHASE_SUCCEEDED`, `PURCHASE_REFUNDED`, `FREE_ITEM_REDEEMED`, `MUTATE_CART`, `LOYALTY_MILESTONE_CLAIMED`, `CATALOG_REJECTED`, `CATALOG_ITEMS_DROPPED`, `CATALOG_DATA_CONFLICT` and `CATALOG_TEXT_FALLBACK`. Not on the view and click events. |
| `checkoutSessionId` | string | The player's webshop browsing session: the same value on every event of the session, and a new value after 30 minutes without activity. Omitted when the event is not tied to a webshop session, and may be omitted when `analyticsConsent` is `"DECLINED"` or `"UNANSWERED"`. See [Webshop session](#webshop-session). |
| `analyticsConsent` | string | The player's answer to your webshop's analytics consent banner: `"ACCEPTED"`, `"DECLINED"` or `"UNANSWERED"`. On `VIEW_ITEM`, `VIEW_CATALOG_SECTION` and `BUY_NOW_ITEM_CLICK`; omitted when no answer was reported. See [Analytics consent](#analytics-consent). |

***

## Subscription Events (v2)

> [!NOTE]
>
> Subscription webhooks use a **v2 payload format** with lowercase dot-notation
> event types, unlike the v1 format used by purchase and webshop events above.

Subscription events notify your system of subscription lifecycle changes. See the [Subscriptions guide](https://docs.stash.gg/guides/stash-pay/subscriptions/about.md) for full integration details.

### Available subscription events

| Event Type | Description | Trigger |
| - | - | - |
| `subscription.created` | New subscription created | Player completes subscription checkout |
| `subscription.updated` | Subscription changed | Plan or status was modified |
| `subscription.canceled` | Subscription canceled | Player cancels their subscription |
| `subscription.reactivated` | Subscription reactivated | Canceled subscription was reactivated before expiration |
| `subscription.expired` | Subscription expired | Subscription reached terminal state |
| `subscription.payment_failed` | Payment failed | Renewal payment attempt failed; subscription enters `past_due` |
| `subscription.payment_succeeded` | Payment succeeded | Renewal payment processed successfully |

### v2 Payload structure

Subscription webhooks use a different structure from v1 events:

```json title="v2 Webhook Structure" theme={null}
{
  "type": "subscription.event_name",
  "data": {
    // Subscription object
  }
}
```

### Detailed subscription payloads

> [tab] created
>
> Triggered when a new subscription is created.
>
> ```json title="subscription.created" theme={null}
> {
>   "type": "subscription.created",
>   "data": {
>     "id": "sub_xyz789",
>     "external_account_id": "player_123",
>     "plan_id": "plan_abc123",
>     "status": "active",
>     "period": {
>       "value": 1,
>       "unit": "month"
>     },
>     "trial_end": "2024-02-01T00:00:00Z",
>     "access_end_date": "2024-03-01T00:00:00Z",
>     "current_period_end": "2024-03-01T00:00:00Z",
>     "next_billing_date": "2024-03-01T00:00:00Z",
>     "cancel_at_period_end": false,
>     "canceled_at": null,
>     "created_at": "2024-01-01T00:00:00Z"
>   }
> }
> ```

> [tab] updated
>
> Triggered when a subscription's plan or status changes.
>
> ```json title="subscription.updated" theme={null}
> {
>   "type": "subscription.updated",
>   "data": {
>     "id": "sub_xyz789",
>     "external_account_id": "player_123",
>     "plan_id": "plan_abc123",
>     "status": "active",
>     "period": {
>       "value": 1,
>       "unit": "month"
>     },
>     "trial_end": null,
>     "access_end_date": "2024-04-01T00:00:00Z",
>     "current_period_end": "2024-04-01T00:00:00Z",
>     "next_billing_date": "2024-04-01T00:00:00Z",
>     "cancel_at_period_end": false,
>     "canceled_at": null,
>     "created_at": "2024-01-01T00:00:00Z"
>   }
> }
> ```

> [tab] canceled
>
> Triggered when a player cancels their subscription.
>
> ```json title="subscription.canceled" theme={null}
> {
>   "type": "subscription.canceled",
>   "data": {
>     "id": "sub_xyz789",
>     "external_account_id": "player_123",
>     "plan_id": "plan_abc123",
>     "status": "canceled",
>     "period": {
>       "value": 1,
>       "unit": "month"
>     },
>     "trial_end": null,
>     "access_end_date": "2024-03-01T00:00:00Z",
>     "current_period_end": "2024-03-01T00:00:00Z",
>     "next_billing_date": "2024-03-01T00:00:00Z",
>     "cancel_at_period_end": true,
>     "canceled_at": "2024-02-15T14:30:00Z",
>     "created_at": "2024-01-01T00:00:00Z"
>   }
> }
> ```

> [tab] reactivated
>
> Triggered when a canceled subscription is reactivated before expiration.
>
> ```json title="subscription.reactivated" theme={null}
> {
>   "type": "subscription.reactivated",
>   "data": {
>     "id": "sub_xyz789",
>     "external_account_id": "player_123",
>     "plan_id": "plan_abc123",
>     "status": "active",
>     "period": {
>       "value": 1,
>       "unit": "month"
>     },
>     "trial_end": null,
>     "access_end_date": "2024-03-01T00:00:00Z",
>     "current_period_end": "2024-03-01T00:00:00Z",
>     "next_billing_date": "2024-03-01T00:00:00Z",
>     "cancel_at_period_end": false,
>     "canceled_at": null,
>     "created_at": "2024-01-01T00:00:00Z"
>   }
> }
> ```

> [tab] expired
>
> Triggered when a subscription reaches its terminal state.
>
> ```json title="subscription.expired" theme={null}
> {
>   "type": "subscription.expired",
>   "data": {
>     "id": "sub_xyz789",
>     "external_account_id": "player_123",
>     "plan_id": "plan_abc123",
>     "status": "expired",
>     "period": {
>       "value": 1,
>       "unit": "month"
>     },
>     "trial_end": null,
>     "access_end_date": "2024-03-01T00:00:00Z",
>     "current_period_end": "2024-03-01T00:00:00Z",
>     "next_billing_date": "2024-03-01T00:00:00Z",
>     "cancel_at_period_end": true,
>     "canceled_at": "2024-02-15T14:30:00Z",
>     "created_at": "2024-01-01T00:00:00Z"
>   }
> }
> ```

> [tab] payment\_failed
>
> Triggered when a renewal payment attempt fails. The subscription enters `past_due` status and Stash will retry. The `reason` field gives a normalized failure reason; see [Testing payment declines and reasons](https://docs.stash.gg/guides/stash-pay/subscriptions/integration.md#testing-payment-declines-and-reasons) for the full list of values and test cards.
>
> ```json title="subscription.payment_failed" theme={null}
> {
>   "type": "subscription.payment_failed",
>   "data": {
>     "id": "sub_xyz789",
>     "external_account_id": "player_123",
>     "plan_id": "plan_abc123",
>     "status": "past_due",
>     "reason": "insufficient_funds",
>     "retry_count": 0,
>     "period": {
>       "value": 1,
>       "unit": "month"
>     },
>     "trial_end": null,
>     "access_end_date": "2024-03-03T00:00:00Z",
>     "current_period_end": "2024-03-01T00:00:00Z",
>     "next_billing_date": "2024-03-02T00:00:00Z",
>     "cancel_at_period_end": false,
>     "canceled_at": null,
>     "created_at": "2024-01-01T00:00:00Z"
>   }
> }
> ```

> [tab] payment\_succeeded
>
> Triggered when a renewal payment is processed successfully.
>
> ```json title="subscription.payment_succeeded" theme={null}
> {
>   "type": "subscription.payment_succeeded",
>   "data": {
>     "id": "sub_xyz789",
>     "external_account_id": "player_123",
>     "plan_id": "plan_abc123",
>     "status": "active",
>     "period": {
>       "value": 1,
>       "unit": "month"
>     },
>     "trial_end": null,
>     "access_end_date": "2024-04-01T00:00:00Z",
>     "current_period_end": "2024-04-01T00:00:00Z",
>     "next_billing_date": "2024-04-01T00:00:00Z",
>     "cancel_at_period_end": false,
>     "canceled_at": null,
>     "created_at": "2024-01-01T00:00:00Z"
>   }
> }
> ```

### Subscription object fields

| Field | Type | Description |
| - | - | - |
| `id` | string | Unique identifier for the subscription. |
| `external_account_id` | string | Identifier for the player/user. |
| `plan_id` | string | Plan identifier. |
| `status` | string | `active`, `past_due`, `canceled`, or `expired`. |
| `period` | object | Billing period with `value` (integer) and `unit` (`day` / `week` / `month` / `year`). |
| `trial_end` | string (nullable) | ISO 8601 timestamp when trial ends. |
| `access_end_date` | string | ISO 8601 timestamp when access expires. |
| `current_period_end` | string | ISO 8601 timestamp for current period end. |
| `next_billing_date` | string | ISO 8601 timestamp for next billing attempt. |
| `cancel_at_period_end` | boolean | Whether cancellation is scheduled. |
| `canceled_at` | string (nullable) | ISO 8601 timestamp when canceled. |
| `created_at` | string | ISO 8601 timestamp when created. |

***

## Payment Events (v2)

Payment webhooks notify your backend about individual payment outcomes. They use the same v2 payload format as subscription events (`type` + `data`). These events fire for subscription payments and other Stash Pay checkout flows.

### Available payment events

| Event Type | Description | Trigger |
| - | - | - |
| `payment.succeeded` | Payment completed successfully | A payment is captured |
| `payment.failed` | Payment attempt failed | A payment is declined or fails |
| `payment.refunded` | Payment was refunded | A refund is processed |
| `dispute.opened` | Dispute opened | A cardholder disputes a payment |
| `dispute.closed` | Dispute closed | A dispute is resolved (includes `won` boolean) |

### Detailed payment payloads

> [tab] payment.succeeded
>
> Triggered when a payment completes successfully.
>
> ```json title="payment.succeeded" theme={null}
> {
>   "type": "payment.succeeded",
>   "data": {
>     "id": "pay_abc123",
>     "external_account_id": "player_123",
>     "currency": "USD",
>     "subscription_id": "sub_xyz789",
>     "succeeded_at": "2024-01-01T00:00:00Z",
>     "tax": "1.50",
>     "tax_inclusive": false,
>     "total": "10.99",
>     "metadata": {
>       "custom-key": "customer-value"
>     }
>   }
> }
> ```

> [tab] payment.failed
>
> Triggered when a payment attempt fails. The `reason` field gives a normalized failure reason; see [Testing payment declines and reasons](https://docs.stash.gg/guides/stash-pay/subscriptions/integration.md#testing-payment-declines-and-reasons) for the full list of values and test cards.
>
> ```json title="payment.failed" theme={null}
> {
>   "type": "payment.failed",
>   "data": {
>     "id": "pay_abc456",
>     "external_account_id": "player_123",
>     "currency": "USD",
>     "subscription_id": "sub_xyz789",
>     "reason": "insufficient_funds",
>     "failed_at": "2024-01-01T00:00:00Z",
>     "tax": "1.50",
>     "tax_inclusive": false,
>     "total": "10.99",
>     "metadata": {
>       "custom-key": "customer-value"
>     }
>   }
> }
> ```

> [tab] payment.refunded
>
> Triggered when a payment is refunded.
>
> ```json title="payment.refunded" theme={null}
> {
>   "type": "payment.refunded",
>   "data": {
>     "id": "pay_abc789",
>     "external_account_id": "player_123",
>     "currency": "USD",
>     "subscription_id": "sub_xyz789",
>     "refunded_at": "2024-01-01T00:00:00Z",
>     "total_refunded": "10.99",
>     "metadata": {
>       "custom-key": "customer-value"
>     }
>   }
> }
> ```

> [tab] dispute.opened
>
> Triggered when a dispute is opened.
>
> ```json title="dispute.opened" theme={null}
> {
>   "type": "dispute.opened",
>   "data": {
>     "id": "pay_abc123",
>     "external_account_id": "player_123",
>     "currency": "USD",
>     "subscription_id": "sub_xyz789",
>     "total_disputed": "10.99",
>     "metadata": {
>       "custom-key": "custom-value"
>     }
>   }
> }
> ```

> [tab] dispute.closed
>
> Triggered when a dispute is closed. The `won` field indicates whether you won the dispute.
>
> ```json title="dispute.closed" theme={null}
> {
>   "type": "dispute.closed",
>   "data": {
>     "id": "pay_abc123",
>     "won": true,
>     "external_account_id": "player_123",
>     "currency": "USD",
>     "subscription_id": "sub_xyz789",
>     "total_disputed": "10.99",
>     "metadata": {
>       "custom-key": "custom-value"
>     }
>   }
> }
> ```

### Payment object fields

| Field | Type | Description |
| - | - | - |
| `id` | string | Payment identifier. |
| `external_account_id` | string | Identifier for the player/user. |
| `currency` | string | Currency code (e.g. `"USD"`, `"EUR"`). |
| `subscription_id` | string (optional) | Subscription identifier when the payment is related to a subscription. |
| `succeeded_at` | string | ISO 8601 timestamp when payment succeeded (`payment.succeeded` only). |
| `failed_at` | string | ISO 8601 timestamp when payment failed (`payment.failed` only). |
| `reason` | string | Normalized failure reason (`payment.failed` only). |
| `refunded_at` | string | ISO 8601 timestamp when payment was refunded (`payment.refunded` only). |
| `tax` | string (optional) | Tax amount as a decimal string, zero when the payment has no tax (`payment.succeeded` and `payment.failed`). If Stash cannot read the payment's tax, both `tax` and `tax_inclusive` are absent. |
| `tax_inclusive` | boolean (optional) | `true` when the item prices already include `tax`, as in markets where prices include VAT; `false` when `tax` is added to the item prices or is zero (`payment.succeeded` and `payment.failed`). If Stash cannot read the payment's tax, both fields are absent. |
| `total` | string | Total payment amount as decimal string (`payment.succeeded` and `payment.failed`). |
| `total_refunded` | string | Total refunded amount as decimal string (`payment.refunded` only). |
| `total_disputed` | string | Total disputed amount as decimal string (`dispute.opened` and `dispute.closed`). |
| `won` | boolean | Whether you won the dispute (`dispute.closed` only). |
| `metadata` | object (optional) | Custom metadata attached to the payment. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.