Stash Webhooks

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 each webhook type across Stash products.

List of webhooks is currently under construction, more events to be added.

This page contains a comprehensive list of all webhook events that Stash can send to your backend. Each webhook is triggered by specific user actions or system events.

Available webhooks

Event TypeDescriptionTriggerPayload Fields
PURCHASE_SUCCEEDEDFired when a purchase is successfully completedWhen a user completes a purchase transactiontimeMillis, orderId, checkoutLinkId, currency, userId, items[], tax, total, taxDetails, emailMarketingOptIn, regionCode, source, ipAddress
MUTATE_CARTFired when items are added, removed, or modified in cartWhen cart contents change (add/remove items, quantity changes)cartId, timeMillis, userId, items[], regionCode, source, ipAddress
VIEW_ITEMFired when a user views a specific itemWhen a user visits an item page or views item detailsuserId, itemId, regionCode
CREATE_PAYMENT_INTENTFired when a payment process is initiatedWhen user starts checkout process or opens payment flowcartId, userId, items[], source
FREE_ITEM_REDEEMEDFired when a user redeems a free itemWhen a free item is claimed or redeemeduserId, itemId, ipAddress, metadata
VIEW_CHECKOUT_PAGEFired when user visits the checkout pageWhen checkout page is loadeduserId, regionCode
VIEW_PRODUCT_DETAIL_PAGEFired when user views product detailsWhen product detail page is accesseduserId, itemId, regionCode
CART_BUTTON_CLICKFired when cart-related buttons are clickedWhen user interacts with cart buttonsuserId, regionCode

Payload structure

All webhooks follow a consistent structure with a base webhook object:

Base Webhook Structure
{
  "type": "EVENT_TYPE",
  "eventData": {
    // Event-specific payload data
  }
}

Detailed payload examples

PURCHASE_SUCCEEDED

Triggered when a purchase is successfully completed.

Purchase Succeeded Event
{
  "type": "PURCHASE_SUCCEEDED",
  "purchaseSucceeded": {
    "timeMillis": 1640995200000,
    "orderId": "order_abc123",
    "checkoutLinkId": "checkout_xyz789",
    "currency": "USD",
    "userId": "user_123",
    "items": [
      {
        "id": "item_456",
        "quantity": 2,
        "price": "9.99",
        "metadata": {
          "category": "weapons",
          "rarity": "legendary"
        }
      }
    ],
    "tax": "1.50",
    "total": "21.48",
    "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"
  }
}

MUTATE_CART

Triggered when cart contents are modified.

Mutate Cart Event
{
  "type": "MUTATE_CART",
  "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"
  }
}

VIEW_ITEM

Triggered when a user views an item.

View Item Event
{
  "type": "VIEW_ITEM",
  "viewItem": {
    "userId": "user_123",
    "itemId": "item_456",
    "regionCode": "US"
  }
}

CREATE_PAYMENT_INTENT

Triggered when payment process is initiated.

Create Payment Intent Event
{
  "type": "CREATE_PAYMENT_INTENT",
  "openPayment": {
    "cartId": "cart_789",
    "userId": "user_123",
    "items": [
      {
        "id": "item_456",
        "quantity": 2
      }
    ],
    "source": "StashPay"
  }
}

FREE_ITEM_REDEEMED

Triggered when a free item is redeemed.

Free Item Redeemed Event
{
  "type": "FREE_ITEM_REDEEMED",
  "freeItemRedeemed": {
    "userId": "user_123",
    "itemId": "item_free_001",
    "ipAddress": "192.168.1.1",
    "metadata": {
      "promotionId": "summer_promo",
      "redeemCode": "SUMMER2024"
    }
  }
}

VIEW_CHECKOUT_PAGE

Triggered when checkout page is viewed.

View Checkout Page Event
{
  "type": "VIEW_CHECKOUT_PAGE",
  "viewCheckoutPage": {
    "userId": "user_123",
    "regionCode": "US"
  }
}

VIEW_PRODUCT_DETAIL_PAGE

Triggered when product details are viewed.

View Product Detail Page Event
{
  "type": "VIEW_PRODUCT_DETAIL_PAGE",
  "viewProductDetailsPage": {
    "userId": "user_123",
    "itemId": "item_456",
    "regionCode": "US"
  }
}

CART_BUTTON_CLICK

Triggered when cart buttons are clicked.

Cart Button Click Event
{
  "type": "CART_BUTTON_CLICK",
  "sendCartButtonClick": {
    "userId": "user_123",
    "regionCode": "US"
  }
}

Common fields

Several fields appear across multiple webhook types:

  • userId: The external user identifier from your system
  • regionCode: Unicode CLDR region code (e.g., "US", "FR") based on user location
  • ipAddress: User's IP address when the event occurred
  • timeMillis: Timestamp in milliseconds since Unix epoch

How is this guide?