GuidesBuild a checkout flowHigh-Level Flow

High-level flow

This article provides a high-level overview of the Stash Pay integration flow. It shows how a checkout session is created, presented to the player, and confirmed via webhook.

To integrate Stash Pay, the only prerequisite is to generate an API key using Stash Studio, our developer portal.

If you don’t have access to Stash Studio, contact the Stash team. They’ll set up your game instance and enable payment processing for you.

Initial setup requirements

1. Set up Stash Pay instance

To get started with Stash Pay, reach out to the Stash team. After an initial conversation, you’ll receive access to our developer portal, Stash Studio. We’ll set up your instance for you (including payment processing) so you can begin integrating quickly and efficiently.

Set up your API key

  1. Log in to Stash Studio
  2. Select your game instance
  3. Go to SettingsAPI Secrets
  4. Click Create new API key

2. Get your API key

Once you have your Stash Studio instance all set up, the only prerequisite to get started with Stash Pay is creating your first API key to call our API endpoints.

  1. Log into your Stash Studio dashboard
  2. Select your game instance.
  3. Navigate to the Settings section
  4. Go to API Secrets
  5. Create new API key

Payment Flow Overview

  1. Requesting Checkout

    • Request a checkout session via the Stash API.
    • Provide user details and item data.
  2. Get Checkout URL

    • Receive a customized URL and a unique checkout ID.
  3. Show Checkout

    • Display the checkout to the player via redirect, popup, or in-app browser.
  4. Finish Purchase

    • Once the payment is completed, Stash sends a webhook notification to your backend.

Failsafe Purchase Flow

  1. Stash pre-authorizes the payment and holds the funds.
  2. Your server receives a webhook indicating the purchase is pending.
  3. Your backend grants the purchased items to the player.
  4. Your server confirms the fulfillment by responding to the webhook.
  5. Stash finalizes the charge only after confirmation.
Was this page helpful?