Learn how Stash Pay’s purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.
This article walks through three Stash Pay integration patterns and when to use each one, based on:
Your game-specific technical requirements and limitations.
Your backend architecture (async/event-based vs. synchronous).
Your preferred in-game purchase-granting behavior.
Initial Setup
1
Set up Stash Pay instance
To set up Stash Pay, contact the Stash team. After onboarding, you’ll receive access to Stash Studio, our developer portal. Your game instance (including payment processing) will be created for you so you can begin the integration.
2
Get your API key
Once you have your Stash Studio instance all set up, the only prerequisite is creating your first API key. You’ll use this key to call Stash Pay API endpoints from your game backend. Specifically, you’ll need an Ingress API key for the GetPaymentEvent endpoint, and an Egress API key for the ConfirmPayment endpoint.
Core Checkout Flow (Common to All Options)
All three options share the same basic checkout flow:
1
Requesting Checkout
From your game backend, request a checkout session via the Stash API.
2
Get Checkout URL
Receive a customized checkout URL and a checkout link order ID (UUID) from Stash. Store this ID on your backend, associated with the player and the pending purchase.
3
Show Checkout
Display the checkout to the player via redirect, popup, or in-app browser. The player reviews the purchase and completes payment using the configured payment methods.
While these three steps are always consistent, the way you finalize the purchase and grant items can vary.
Where the Money Is at Each Step
Every Stash Pay purchase runs the same payment sequence, whichever granting flow you choose. The sequence tells you what has already happened to the player’s money by the time your backend hears from Stash.
1
Authorize
Stash asks the player’s bank to check and reserve the funds. The money is held, not taken.
2
Grant (ConfirmPayment pattern only)
Stash calls your backend here and waits for your response. The funds are already held at this point, so your response decides whether they are taken or released. The other two patterns have no step here.
3
Capture
Stash requests the capture that draws the held funds. On the ConfirmPayment pattern, capture runs only after your backend returns success.
4
PURCHASE_SUCCEEDED
Stash queues the webhook as soon as the capture request is accepted.
PURCHASE_SUCCEEDED marks the capture request, not settlement. Stash sends the event as soon as the payment provider accepts the capture, and settlement happens asynchronously after that. Read the event as “the purchase completed and capture was requested”, not as a settlement receipt.
Not every payment method has a separate capture step. Some settle at authorization, and which ones do depends on the method and on the provider processing it. The sequence above is otherwise unchanged, but there is no hold to release: the funds moved when the payment was authorized, so reversing such a purchase takes a refund. Standard card payments follow the authorize-then-capture sequence. If the behaviour of a specific method matters to your integration, check with your Stash engineering partner.
Choosing Your Granting Flow
Select the pattern that best matches your backend architecture and reward-granting requirements. The three differ mainly in when they fire relative to the charge, and only one of them lets your server reject a purchase:
Showing rewards in the client immediately after purchase
This is an integration-time choice, not a runtime one. Which delivery mechanism a shop uses is fixed when the shop is configured, not selected per purchase. A single shop uses one of these patterns rather than switching between them, so treat the table above as a decision you make once per integration.
Webhook
Payment Lookup
Confirm Payment
Async post-purchase. Stash captures the payment and then sends your backend a PURCHASE_SUCCEEDED event. Your server has no say in whether the charge goes through.Direction: Stash → Game (your backend exposes a webhook endpoint).Best for: Backends that already process events via queues, workers, or background jobs. Rewards may appear slightly after purchase.Flow:
1
Player completes checkout.
2
Stash authorizes the payment, then captures it.
3
Stash queues aPURCHASE_SUCCEEDEDwebhook to your backend.
4
Your backend consumes the event, runs game logic, and grants rewards.
Delivery is queued, not guaranteed. Stash hands the event to a delivery queue and retries a failed delivery, but a purchase never fails because its webhook could not be delivered, and there is no way to ask Stash to replay an event that never landed. On this pattern the webhook is your only delivery signal, so make your handler idempotent and reconcile missed events with GetPaymentEvent. See Webhook Retries and Idempotency.
Synchronous post-purchase. Your backend asks Stash for the final payment status as soon as the purchase completes.This is a targeted lookup, not a background poll. The trigger is the client’s completion signal, which depends on how you present the checkout: the onSuccess prop or option on web; the successCallback argument of OpenCard or OpenModal (for example successCallback: OnSuccess) in Unity; and, in browser presentation modes such as openBrowser, the deep link that returns the player to your game, since those modes have no success callback (see Presentation Options). Your backend already holds the checkout link order ID from creating the link, so it can look the purchase up as soon as the client reports completion.Direction: Game → Stash (your backend calls GetPaymentEvent).Best for: Games where the client needs to show rewards immediately, or backends designed for synchronous request-response patterns without incoming webhooks.Flow:
1
Player completes checkout.
2
The client receives the completion signal (the SDK success callback, or the deep-link return in browser modes) and notifies your backend.
Validation between the hold and the charge. Stash authorizes the payment first, then calls your backend with ConfirmPayment and waits for your response. Capture runs only after you return success.By the time you see the call, the player’s funds are already held but not taken. That is what makes this the only one of the three patterns where your server can reject a purchase: the bad case is “not charged, not granted” rather than “charged, not granted”. It grants items during the same call, and it fires earliest of the three.Direction: Stash → Game (your backend exposes the ConfirmPayment endpoint).Best for: Games with per-player inventory limits, multi-client purchase locking, or any validation that must happen before a purchase is finalized.Flow:
1
Player completes checkout.
2
Stash authorizes the payment. The funds are held.
3
Stash sends aConfirmPaymentrequest to your backend.
4
Your backend validates the purchase (inventory, caps, locks), grants the items, and returns them in the response body.
5
Stash captures the payment and queues aPURCHASE_SUCCEEDEDwebhook.
There is no approve field. Your server signals success by returning 200 OK with the granted results in the body. A 200 whose results array is empty or absent confirms nothing and counts as a failure, not a success. Your server rejects by returning an HTTP 4xx status, optionally with a decline object in the body naming a PurchaseConfirmationStatus. Where the checkout supports it, Stash uses that status to show the player the specific reason; otherwise the player sees a generic failure. See the ConfirmPayment API Reference.
Any failure response fails the purchase. Stash treats every non-success response the same way, whether it is a deliberate rejection, an unhandled 500, a timeout, a malformed body, or a 200 with no results. When that happens Stash does not capture: the authorization is released or left to expire at the payment provider, and the player is not charged. A payment method that settles at authorization has no hold to release, so reversing that purchase takes a refund.Respond 200 OK with your granted results unless you specifically do not want Stash to take the money.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Stash Documentation","description":"Integrate Stash Pay, Stash Webshop, and Stash Launcher. Guides and partner resources for the Stash direct-to-consumer platform.","colors":{"primary":"#1e1e1e","light":"#f7f9f4","dark":"#1e1e1e"},"logo":{"light":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/light.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=c58d1a385fd52c013aef762b9f06da39","dark":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/dark.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=012af7b9b89de597a472667a86a65eef","href":"/guides"},"favicon":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/favicon.png?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=6f4e9b8b8e5068337b7712264275bd28","api":{"playground":{"display":"interactive"}},"appearance":{"default":"system","strict":false},"background":{"color":{"light":"#f7f9f4","dark":"#1e1e1e"}},"navbar":{"primary":{"type":"button","label":"Studio","href":"https://studio.stash.gg"}},"seo":{"metatags":{"og:image":"https://docs.stash.gg/og-image.png"}},"fonts":{"heading":{"family":"Factor A","weight":500,"source":"https://storage.googleapis.com/stash_assets/fonts/FactorA-Medium.woff2","format":"woff2"},"body":{"family":"Factor A","weight":300,"source":"https://storage.googleapis.com/stash_assets/fonts/FactorA-Regular.woff2","format":"woff2"}},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":false},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"stash-gg","hasAudioNarration":false,"actualSubdomain":"stash-gg","customDomains":[],"gitSource":{"type":"github","owner":"stashgg","repo":"stash-mintlify","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6afccf82d3f0f72f2b169b4c"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6b0e1f15d09a38910d349f35:success","clientVersion":"0.0.4352","searchFilterCounts":[{"language":"default","tag":"Integration Guides","count":66},{"language":"default","tag":"API Reference","count":41},{"language":"default","tag":"Changelog","count":38},{"language":"default","tag":"Ingress","count":34},{"language":"default","tag":"Stash Webshop","count":28},{"language":"default","tag":"Features \u0026 Customizations","count":19},{"language":"default","tag":"Stash Pay","count":18},{"language":"default","tag":"Getting Started","count":11},{"language":"default","tag":"Catalog Management","count":11},{"language":"default","tag":"Partner With Us","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":":root{--sidebar-width: 286px;--stash-menu-surface: #f4f6f1;--stash-menu-glass: rgba(244, 246, 241, 0.8);--stash-menu-border: rgba(153, 153, 153, 0.2)}html.dark{--stash-menu-surface: #1c1c1c;--stash-menu-glass: rgba(28, 28, 28, 0.8);--stash-menu-border: rgba(153, 153, 153, 0.2)}#navbar>div:not(#navbar-transition),div:has(>[data-layout-item=\"sidebar\"]){max-width:none}#navbar-transition,[data-layout-item=\"sidebar\"]{background-color:var(--stash-menu-glass);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);border-color:var(--stash-menu-border)}[data-layout-item=\"sidebar\"]{border-inline-end:1px solid var(--stash-menu-border)}#sidebar-content div:has(>#navigation-items)>div:first-child{background-image:linear-gradient(to bottom, var(--stash-menu-surface), transparent)}#mobile-nav,[data-layout-item=\"mobile-nav\"],.nav-dropdown-content,[data-component-part=\"theme-preference-menu-content\"]{background-color:var(--stash-menu-surface);border-color:var(--stash-menu-border)}@media (min-width: 1024px){div:has(>[data-layout-item=\"sidebar\"]){padding-inline:0}#sidebar-content{padding-inline-start:1rem}}@font-face{font-family:\"Factor A\";src:url(\"https://storage.googleapis.com/stash_assets/fonts/FactorA-Bold.woff2\") format(\"woff2\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Factor A\";src:url(\"https://storage.googleapis.com/stash_assets/fonts/FactorA-Extrabold35.woff2\") format(\"woff2\");font-weight:900;font-style:normal;font-display:swap}:root{--stash-page-background: #f7f9f4;--stash-header-glass: rgba(244, 246, 241, 0.8);--stash-header-border: rgba(128, 128, 128, 0.2);--stash-muted: #737373;--stash-foreground: #1e1e1e;--stash-control: rgba(235, 235, 235, 0.5);--stash-control-active: #e6e6e6;--stash-header-height: 104px}html.dark{--stash-page-background: #1e1e1e;--stash-header-glass: rgba(28, 28, 28, 0.8);--stash-muted: #999;--stash-foreground: #f7f9f4;--stash-control: rgba(33, 33, 33, 0.5);--stash-control-active: #262626}body{font-feature-settings:\"kern\" 1, \"liga\" 1, \"calt\" 1;-webkit-font-smoothing:antialiased}#page-title,#page-header h1{font-size:28px;line-height:42px;font-weight:500!important;letter-spacing:normal}#content h2,#content h3,#content h4,#content h5,#content h6{font-weight:400!important;letter-spacing:normal}#content strong{font-weight:700!important}#navbar-transition{background-color:var(--stash-header-glass);border-color:var(--stash-header-border)}#navbar .nav-logo{width:96px;height:24px}#navbar .nav-tabs-item{font-weight:500!important;text-shadow:none;color:var(--stash-muted)}#navbar .nav-tabs-item[data-active=\"true\"],#navbar .nav-tabs-item:hover{color:var(--stash-foreground)}#topbar-cta-button a{height:36px;padding:6px 12px;border:1px solid var(--stash-header-border);border-radius:9999px;color:var(--stash-muted);font-weight:300!important}#topbar-cta-button a:hover{background:var(--stash-control-active);color:var(--stash-foreground)}#topbar-cta-button a>span{display:none}#topbar-cta-button a>div{gap:6px}#topbar-cta-button a>div>span{color:inherit}#topbar-cta-button a>div>svg{display:none}#topbar-cta-button a>div::before{content:\"\";width:14px;height:14px;background:currentColor;mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20105%20104%22%3E%3Cpath%20d%3D%22M3.53358%20104L3.73942%2075.4788H64.8398C68.2705%2075.4788%2070.6719%2074.8897%2072.1128%2073.7461C73.5537%2072.6025%2074.2742%2070.9044%2074.2742%2068.6864C74.2742%2064.2159%2071.5296%2061.7901%2066.0406%2061.3742L35.5761%2059.5375C11.8701%2058.1859%200%2048.3439%200%2029.9767C0%2020.5851%203.25914%2013.2383%209.81174%207.93602C16.3643%202.63379%2026.3819%200%2039.8988%200H97.8086L98.0145%2028.5212H39.9331C36.571%2028.5212%2034.2039%2029.0756%2032.7973%2030.15C31.3907%2031.2243%2030.6703%2032.8184%2030.6703%2034.9324C30.6703%2039.1256%2033.4148%2041.4822%2038.9039%2042.0366L70.3632%2043.8734C93.4174%2045.017%20104.944%2054.6858%20104.944%2072.8104C104.944%2082.4099%20101.651%2090.034%2095.0984%2095.6135C88.5458%20101.193%2078.5968%20104%2065.2515%20104H3.53358Z%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat;-webkit-mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20105%20104%22%3E%3Cpath%20d%3D%22M3.53358%20104L3.73942%2075.4788H64.8398C68.2705%2075.4788%2070.6719%2074.8897%2072.1128%2073.7461C73.5537%2072.6025%2074.2742%2070.9044%2074.2742%2068.6864C74.2742%2064.2159%2071.5296%2061.7901%2066.0406%2061.3742L35.5761%2059.5375C11.8701%2058.1859%200%2048.3439%200%2029.9767C0%2020.5851%203.25914%2013.2383%209.81174%207.93602C16.3643%202.63379%2026.3819%200%2039.8988%200H97.8086L98.0145%2028.5212H39.9331C36.571%2028.5212%2034.2039%2029.0756%2032.7973%2030.15C31.3907%2031.2243%2030.6703%2032.8184%2030.6703%2034.9324C30.6703%2039.1256%2033.4148%2041.4822%2038.9039%2042.0366L70.3632%2043.8734C93.4174%2045.017%20104.944%2054.6858%20104.944%2072.8104C104.944%2082.4099%20101.651%2090.034%2095.0984%2095.6135C88.5458%20101.193%2078.5968%20104%2065.2515%20104H3.53358Z%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat}.stash-theme-controls{display:inline-flex;padding:4px;border:1px solid var(--stash-header-border);border-radius:9999px}.stash-theme-controls button{display:grid;place-items:center;width:26px;height:26px;padding:6px;border-radius:9999px;color:var(--stash-muted);cursor:pointer}.stash-theme-controls button[aria-pressed=\"true\"]{background:var(--stash-control-active);color:var(--stash-foreground)}.stash-theme-controls svg{width:14px;height:14px}.stash-sidebar-toggle{display:grid;place-items:center;width:32px;height:32px;margin-inline-end:-6px;padding:6px;border-radius:9999px;border:1px solid var(--stash-header-border);background:var(--stash-control);color:var(--stash-muted);cursor:pointer}.stash-sidebar-toggle svg{width:18px;height:18px}.stash-theme-controls button:hover,.stash-sidebar-toggle:hover{color:var(--stash-foreground)}.stash-theme-controls button:focus-visible,.stash-sidebar-toggle:focus-visible{outline:2px solid var(--stash-foreground);outline-offset:2px}html[data-stash-setting-theme] [data-component-part=\"theme-preference-menu-content\"]{visibility:hidden}.stash-background{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none;user-select:none}#content .stash-background img{position:absolute;max-width:none;margin:0!important;object-fit:contain;filter:brightness(0.8);border-radius:0}@media (max-width: 767px){.stash-background{display:none}}@media (min-width: 1024px){#navbar>div:not(#navbar-transition)>div>div:has(>div>div>div>a>.nav-logo)>div:first-child{padding-inline:24px;margin-inline:0;border-bottom:1px solid var(--stash-header-border)}#navbar div:has(>div>a>.nav-logo){border-bottom:0}#navbar div:has(>#search-bar-entry){position:absolute;left:50%;transform:translateX(-50%);width:384px;flex:none}#search-bar-entry{height:36px;padding:6px 6px 6px 10px;border:1px solid var(--stash-header-border);color:var(--stash-muted);box-shadow:none;background:var(--stash-control);filter:none;font-size:14px;line-height:20px}#search-bar-entry [data-search-item=\"trigger-icon\"]{color:inherit;stroke-width:2}#search-bar-entry [data-search-item=\"trigger-hint\"]{display:inline-flex;gap:2px;font-size:14px;font-weight:300!important}#search-bar-entry kbd{border:1px solid var(--stash-header-border);border-radius:6px;padding:0 6px;background:var(--stash-page-background);font:inherit}#navbar div:has(>nav[aria-label=\"Main\"]){gap:8px}#navbar div:has(>nav[aria-label=\"Main\"])>*{margin-inline:0}#navbar div:has(>nav[aria-label=\"Main\"])>.stash-sidebar-toggle{margin-inline-end:-6px}#navbar div:has(>.nav-tabs){height:40px;padding-inline:24px}#navbar .nav-tabs{width:100%;align-items:flex-end;border-bottom:1px solid transparent}#navbar .nav-tabs-item{height:28px;padding-bottom:8px;line-height:20px}#navbar .nav-tabs-item>div{height:2px}#navbar div:has(>#search-bar-entry){left:calc(50% - 192px);transform:none}[data-layout-item=\"sidebar\"]{top:var(--stash-header-height);height:calc(100vh - var(--stash-header-height))}html[data-stash-sidebar-collapsed]{--sidebar-width: 0px}}@media (max-width: 1023px){#navbar>div:not(#navbar-transition)>div>div:has(>div>div>div>a>.nav-logo)>div:first-child{height:56px;border-bottom:1px solid var(--stash-header-border)}#navbar div:has(>div>a>.nav-logo){border-bottom:0}#navbar button:has(>div>span.sr-only){position:absolute;top:10.5px;right:10px;width:34px;height:34px;padding:8px}#navbar button:has(>div>span.sr-only)>div:last-child{display:none}#navbar button:has(>div>span.sr-only)>div:first-child>svg{width:18px;height:18px}#navbar button:has(>div>span.sr-only)::after{content:\"\";position:absolute;inset:8px;background:var(--stash-muted);mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%203v18%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat;-webkit-mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%203v18%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat}#navbar button:has(>div>span.sr-only)>div:first-child>svg{visibility:hidden}#search-bar-entry-mobile{position:absolute;right:28px;top:10.5px;width:34px;height:34px}#navbar button[aria-label=\"More actions\"]{display:none}#content-container>div:has(>#content-area){padding-top:96px}#mobile-nav .stash-mobile-studio{flex:none;margin:12px 16px 16px 64px;padding:8px 12px;border:1px solid var(--stash-header-border);border-radius:9999px;text-align:center;font-size:14px;color:var(--stash-muted)}}#assistant-entry,#assistant-entry-mobile{display:none!important}:root{--stash-content-border: rgba(153, 153, 153, 0.2);--stash-text: #262626;--stash-heading: #0a0a0a;--stash-card: #fff;--stash-active-nav: rgba(10, 10, 10, 0.1);--stash-ease: cubic-bezier(0.4, 0, 0.2, 1);--content-width: 900px}html.dark{--stash-text: #e5e5e5;--stash-heading: #fafafa;--stash-card: #262626;--stash-active-nav: rgba(250, 250, 250, 0.1)}#header>div:first-child,#header>div:first-child>div{margin-top:0}#header nav[aria-label=\"Breadcrumb\"]{display:none}#page-title{color:var(--stash-heading)}#header>.prose{margin-top:16px;color:var(--stash-muted);line-height:28px}#header>.prose>p{margin:0;color:inherit}#header::after{content:\"\";display:block;margin-top:24px;border-bottom:1px solid var(--stash-content-border)}#content{margin-top:24px;margin-bottom:16px;color:var(--stash-text)}#content h2,#content h3,#content h4{color:var(--stash-heading)}#content h2{font-size:24px;line-height:32px;margin-top:48px;margin-bottom:24px}#content h3{font-size:20px;line-height:28px}#content>:first-child:not(.stash-background){margin-top:0}#content .card{border-radius:12px;background:var(--stash-card);border-color:var(--stash-content-border);box-shadow:none}#content [data-component-part=\"card-content-container\"]{padding:16px}#content [data-component-part=\"card-title\"]{font-size:14px;line-height:20px;font-weight:500!important;color:var(--stash-heading);margin-top:0;margin-bottom:0}#content [data-component-part=\"card-content\"]{font-size:14px;line-height:21px;margin-top:4px;color:var(--stash-muted)}#content [data-component-part=\"card-icon\"]:has(>img){width:78px;height:78px;padding:7px;margin-bottom:8px;border:1px solid var(--stash-content-border);border-radius:8px;background:#f5f5f5;box-shadow:0 2px 3px rgb(0 0 0 / 0.1)}html.dark #content [data-component-part=\"card-icon\"]:has(>img){background:#303030}#content [data-component-part=\"card-icon\"]>img{width:64px;height:64px}#content .card{margin-block:0}#content div:has(>.card){gap:12px}#content .card:hover{background:var(--stash-menu-surface);border-color:var(--stash-content-border)}#content .callout{position:relative;border-radius:12px;border-color:var(--stash-content-border);background:var(--stash-card);box-shadow:0 2px 4px rgb(0 0 0 / 0.1)}#content [data-component-part=\"callout-content\"]{color:var(--stash-muted)}#content .callout::before{content:\"\";position:absolute;inset:10px auto 10px 5px;width:2px;background:currentColor;border-radius:2px}.feedback-toolbar{margin-top:16px;margin-bottom:16px;padding:12px 0;border-block:1px solid var(--stash-content-border);color:var(--stash-heading)}#feedback-thumbs-up,#feedback-thumbs-down{border:1px solid var(--stash-content-border);border-radius:9999px;padding:8px 12px;gap:8px;color:var(--stash-muted);background:transparent}#feedback-thumbs-up>small,#feedback-thumbs-down>small{line-height:20px}.feedback-toolbar>div:first-child{justify-content:flex-start;gap:8px}.feedback-toolbar>div:first-child>p{font-weight:500;color:var(--stash-heading);margin-right:8px}.feedback-toolbar>div:first-child>div{flex-grow:0;justify-content:flex-start;gap:8px}.feedback-toolbar>div:first-child>div>div{gap:8px}.stash-verification-badge{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;margin-inline-start:auto;padding:4px 10px;border:1px solid var(--stash-content-border);border-radius:9999px;color:var(--stash-muted);background:var(--stash-menu-glass);font-size:12px;font-weight:500;line-height:18px;white-space:nowrap}.stash-verification-badge svg{width:16px;height:16px;flex-shrink:0}.stash-verification-badge[data-status=\"verified\"]{color:var(--stash-heading);background:transparent}.stash-verification-badge[data-status=\"verified\"] svg{color:#4d7c0f;fill:#b6ff00}.stash-verification-badge[data-status=\"outdated\"] svg{color:#a16207}html.dark .stash-verification-badge[data-status=\"outdated\"] svg{color:#facc15}.stash-verification-row{display:flex;align-items:center;justify-content:flex-end;min-height:64px;margin-block:16px;padding-block:12px;border-block:1px solid var(--stash-content-border)}#pagination{gap:16px;margin-top:16px;padding:0}#pagination>a{flex:1 1 0%;min-height:70px;padding:16px;gap:8px;border:1px solid var(--stash-content-border);border-radius:8px;background:var(--stash-menu-glass);backdrop-filter:blur(4px);color:var(--stash-heading);font-weight:500}#pagination>a[rel=\"next\"]{justify-content:flex-end}#pagination>a:hover{background:var(--stash-control-active)}#footer{margin-top:24px;border-color:var(--stash-content-border);padding-top:24px}[data-assistant-bar]{display:block;margin-top:24px}#sidebar-content{padding-inline:15px 0}#sidebar-content>[data-component-part=\"scroll-area-viewport\"]{padding-right:16px}#sidebar-content div:has(>#navigation-items)>div:first-child{height:40px}#sidebar-content .sidebar-group-header,#mobile-nav .sidebar-group-header{padding-left:8px;font-weight:300;color:var(--stash-heading)}#sidebar-content .sidebar-title,#mobile-nav .sidebar-title{font-weight:300!important}#navigation-items>div+div{margin-top:24px}.sidebar-group-header{margin-bottom:6px;line-height:20px}.sidebar-group>li,.sidebar-group ul>li{margin-top:0;margin-bottom:0}.sidebar-group>li>a,.sidebar-group>li>button{border-radius:8px;gap:8px;color:var(--stash-muted);text-shadow:none;padding-block:8px;line-height:20px;font-size:14px}#navigation-items>div>.sidebar-group>li>a,#navigation-items>div>.sidebar-group>li>button{padding-left:8px!important;padding-right:8px}.sidebar-group>li[data-active]>a{background:var(--stash-active-nav);color:var(--stash-heading)}.sidebar-group>li>a:hover,.sidebar-group>li>button:hover{color:var(--stash-heading);background:var(--stash-control-active)}.sidebar-group>li>button[aria-expanded]>div:last-child{margin-left:auto}.sidebar-group>li>button[aria-expanded]>div:last-child>svg{width:14px;height:14px}.sidebar-group a>div:has(>.method-nav-pill){order:2}.method-nav-pill{width:auto}.method-nav-pill>span{font-family:ui-monospace, monospace;font-size:12px;font-weight:400;padding:0;background:transparent!important}.sidebar-group a>div:has(>.method-nav-pill){align-self:center}.method-nav-pill[data-stash-method=\"get\"]>span{color:#00bc3a}.method-nav-pill[data-stash-method=\"post\"]>span{color:#2b7fff}.method-nav-pill[data-stash-method=\"put\"]>span{color:#d08700}.stash-api-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-bottom:32px;border:1px solid var(--stash-content-border);border-radius:8px}.stash-api-switch>a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;border:1px solid transparent;border-radius:6px;color:var(--stash-muted);font-size:14px;font-weight:500;line-height:20px}.stash-api-switch svg{width:16px;height:16px}.stash-api-switch>a:hover{color:var(--stash-heading);background:var(--stash-control-active)}.stash-api-switch>a[aria-current=\"true\"]{color:var(--stash-heading);background:rgb(255 255 255 / 0.85);border-color:rgb(255 255 255 / 0.6);box-shadow:0 1px 2px rgb(0 0 0 / 0.05);backdrop-filter:blur(4px)}html.dark .stash-api-switch>a[aria-current=\"true\"]{background:rgb(255 255 255 / 0.15);border-color:rgb(255 255 255 / 0.2)}.stash-api-switch>a:focus-visible{outline:2px solid var(--stash-heading);outline-offset:2px}.nav-dropdown-trigger[data-stash-api-switch]{display:none}.stash-api-overview>.sidebar-group-header{display:none}#navigation-items>.stash-api-overview{margin-top:0}html[data-current-path^=\"/api/\"] #sidebar-content div:has(>#navigation-items)>div:first-child{height:16px}@media (min-width: 1024px){#content-container>div:has(>#content-area){gap:24px;padding:32px 0 0 24px;max-width:1200px;margin-inline:auto}#content-area{padding:0;margin:0;min-width:0;width:0;max-width:none;flex:1 1 0%}#content-side-layout{width:286px;flex-shrink:0;top:152px;height:calc(100dvh - 152px)}#table-of-contents-layout{padding-left:0;padding-right:16px;width:286px}#content-container>div:has(>#content-side-layout[data-api-example]){display:grid;grid-template-columns:minmax(0, 1fr) 400px;row-gap:0;padding-right:24px;max-width:1200px}#content-side-layout[data-api-example]{grid-column:2;grid-row:2;width:400px;top:136px;height:calc(100dvh - 160px)}#content-side-layout[data-api-example]>div{width:400px}#content-side-layout[data-api-example]+#content-area{display:contents}#content-side-layout[data-api-example]+#content-area>*{grid-column:1 / -1}#content-side-layout[data-api-example]+#content-area>#header{margin-bottom:16px}#content-side-layout[data-api-example]+#content-area>#api-playground-2-operation-page{grid-column:1;grid-row:2}#content-side-layout[data-api-example]+#content-area>[data-assistant-bar]{grid-column:1}#content-side-layout[data-api-example]+#content-area>#header::after{display:none}@media (max-width: 1279px){#content-container>div:has(>#content-area){padding-right:24px}#content-container>div:has(>#content-side-layout[data-api-example]){display:flex}#content-side-layout[data-api-example]+#content-area{display:block}}[data-layout-item=\"sidebar\"]{overflow:clip}#sidebar-content{width:285px}html[data-stash-sidebar-collapsed] [data-layout-item=\"sidebar\"]{border-right-width:0}html[data-stash-sidebar-collapsed] #sidebar-content{transform:translateX(-100%);visibility:hidden;pointer-events:none}}#api-playground-2-operation-page>div:first-child{margin-top:0}#content-area:has(>#api-playground-2-operation-page)>#header::after{display:none}.api-section-heading-title{color:var(--stash-heading);font-weight:400!important;font-size:20px;line-height:28px}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-side-layout{display:none}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-container>div:has(>#content-area){max-width:1200px}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #header::after{margin-top:32px}@media (min-width: 1024px){html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-container>div:has(>#content-area){padding-right:24px}}@media (max-width: 1023px){#content-container>div:has(>#content-area){padding-top:88px}#content-area{padding-inline:0}#search-bar-entry-mobile{right:48px}#header>#page-context-menu{margin-top:16px}#header::after{margin-top:24px}#pagination{gap:12px}#pagination>a{padding:12px}.stash-api-switch{margin:8px 0 24px}}#stash-mobile-contents{display:none}@media (max-width: 1023px){#stash-mobile-contents{display:block;position:fixed;inset:56px 0 auto;z-index:35;color:var(--stash-muted);background:var(--stash-header-glass);border-bottom:1px solid var(--stash-content-border);backdrop-filter:blur(4px);font-size:14px;line-height:20px}#stash-mobile-contents>summary{display:flex;align-items:center;gap:8px;height:40px;padding:0 16px;cursor:pointer;list-style:none}#stash-mobile-contents>summary::-webkit-details-marker{display:none}#stash-mobile-contents>summary>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#stash-mobile-contents svg{width:20px;height:20px;flex:none}#stash-mobile-contents svg:first-child{opacity:0.3}#stash-mobile-contents svg:last-child{width:16px;height:16px;margin-left:auto}#stash-mobile-contents[open] svg:last-child{transform:rotate(180deg)}#stash-mobile-contents nav{max-height:min(60dvh, 320px);overflow:auto;padding:8px 16px 12px;border-top:1px solid var(--stash-content-border);background:var(--stash-menu-surface)}#stash-mobile-contents nav a{display:block;padding:6px 12px;border-radius:6px}#stash-mobile-contents nav a:hover{background:var(--stash-control-active);color:var(--stash-heading)}#stash-mobile-contents :focus-visible{outline:2px solid var(--stash-heading);outline-offset:-2px}html[data-stash-mobile-contents] #content-container>div:has(>#content-area){padding-top:128px}#content :is(h2,h3,h4)[id]{scroll-margin-top:112px}}@media (max-width: 767px){#content-container>div:has(>#content-area){padding-top:80px}html[data-stash-mobile-contents] #content-container>div:has(>#content-area){padding-top:120px}}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]){--sidebar-width: 0px}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]) :is(#sidebar,#content-side-layout,.stash-sidebar-toggle){display:none}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]) #content-container>div:has(>#content-area){max-width:768px;padding-inline:24px}html[data-current-path=\"/changelog\"] [data-component-part=\"update-tag-list\"]{gap:6px;padding-inline:0}html[data-current-path=\"/changelog\"] [data-component-part=\"update-tag\"],.stash-changelog-tag{display:inline-flex;align-items:center;padding:2px 8px;border:1px solid var(--stash-content-border);border-radius:6px;background:var(--stash-control);color:var(--stash-foreground);font-size:12px;font-weight:500;line-height:16px;white-space:nowrap}.stash-changelog-tag{margin:0 6px 6px 0}html[data-current-path=\"/changelog\"] #content h2 a{color:inherit;border-bottom:0;text-decoration:none}html[data-current-path=\"/changelog\"] #content h2 a:hover{text-decoration:underline}@property --sidebar-width{syntax:\"\u003clength>\";inherits:true;initial-value:286px}@media (prefers-reduced-motion: no-preference){:root{transition:--sidebar-width 200ms var(--stash-ease)}#sidebar-content{transition:transform 200ms var(--stash-ease), visibility 200ms}#navbar .nav-tabs-item,#topbar-cta-button a,.stash-theme-controls button,.stash-sidebar-toggle,.sidebar-group>li>a,.sidebar-group>li>button,.stash-api-switch>a,#pagination>a,#content .card,.feedback-toolbar button{transition:color 150ms var(--stash-ease), background-color 150ms var(--stash-ease), border-color 150ms var(--stash-ease), box-shadow 150ms var(--stash-ease)}.sidebar-group button[aria-expanded] svg{transition:transform 200ms var(--stash-ease)}#stash-mobile-contents svg{transition:transform 200ms var(--stash-ease)}#navbar-transition,#content-side-layout{transition:top 200ms var(--stash-ease), height 150ms var(--stash-ease)}}@media (prefers-reduced-motion: reduce){:root,#sidebar-content,.sidebar-group *,.stash-api-switch *,#mobile-nav,#content .card,#navbar *,#pagination *,.feedback-toolbar *,[data-assistant-bar] *,#stash-mobile-contents *{transition-duration:0s!important;animation-duration:0s!important}}"}]}
{"page":{"pagePath":"guides/stash-pay/flow","slug":"/guides/stash-pay/flow","pageMetadata":{"title":"High-Level Flow","description":"Learn how Stash Pay's purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.","href":"/guides/stash-pay/flow"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn how Stash Pay’s purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Info,Mermaid,Step,Steps,Tab,Table,Tabs,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This article walks through three Stash Pay integration patterns and when to use each one, based on:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Your game-specific technical requirements and limitations.`}),`\n`,_jsx(_components.li,{children:`Your backend architecture (async/event-based vs. synchronous).`}),`\n`,_jsx(_components.li,{children:`Your preferred in-game purchase-granting behavior.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`initial-setup`,children:`Initial Setup`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Set up Stash Pay instance`,id:`set-up-stash-pay-instance`,children:_jsxs(_components.p,{children:[`To set up Stash Pay, contact the Stash team. After onboarding, you’ll receive access to `,_jsx(_components.strong,{children:`Stash Studio`}),`, our developer portal. Your game instance (including payment processing) will be created for you so you can begin the integration.`]})}),_jsx(Step,{title:`Get your API key`,id:`get-your-api-key`,children:_jsxs(_components.p,{children:[`Once you have your Stash Studio instance all set up, the only prerequisite is creating your first API key. You’ll use this key to call Stash Pay API endpoints from your game backend. Specifically, you’ll need an Ingress API key for the `,_jsx(_components.code,{children:`GetPaymentEvent`}),` endpoint, and an Egress API key for the `,_jsx(_components.code,{children:`ConfirmPayment`}),` endpoint.`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`core-checkout-flow-common-to-all-options`,children:`Core Checkout Flow (Common to All Options)`}),`\n`,_jsx(_components.p,{children:`All three options share the same basic checkout flow:`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Requesting Checkout`,id:`requesting-checkout`,children:_jsx(_components.p,{children:`From your game backend, request a checkout session via the Stash API.`})}),_jsx(Step,{title:`Get Checkout URL`,id:`get-checkout-url`,children:_jsxs(_components.p,{children:[`Receive a customized checkout URL and a `,_jsx(_components.strong,{children:`checkout link order ID`}),` (UUID) from Stash. Store this ID on your backend, associated with the player and the pending purchase.`]})}),_jsx(Step,{title:`Show Checkout`,id:`show-checkout`,children:_jsx(_components.p,{children:`Display the checkout to the player via redirect, popup, or in-app browser. The player reviews the purchase and completes payment using the configured payment methods.`})})]}),`\n`,_jsx(_components.p,{children:`While these three steps are always consistent, the way you finalize the purchase and grant items can vary.`}),`\n`,_jsx(Heading,{level:`2`,id:`where-the-money-is-at-each-step`,children:`Where the Money Is at Each Step`}),`\n`,_jsx(_components.p,{children:`Every Stash Pay purchase runs the same payment sequence, whichever granting flow you choose. The sequence tells you what has already happened to the player’s money by the time your backend hears from Stash.`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Authorize`,id:`authorize`,children:_jsx(_components.p,{children:`Stash asks the player’s bank to check and reserve the funds. The money is held, not taken.`})}),_jsx(Step,{title:`Grant (ConfirmPayment pattern only)`,id:`grant-confirmpayment-pattern-only`,children:_jsx(_components.p,{children:`Stash calls your backend here and waits for your response. The funds are already held at this point, so your response decides whether they are taken or released. The other two patterns have no step here.`})}),_jsx(Step,{title:`Capture`,id:`capture`,children:_jsxs(_components.p,{children:[`Stash requests the capture that draws the held funds. On the `,_jsx(_components.code,{children:`ConfirmPayment`}),` pattern, capture runs only after your backend returns success.`]})}),_jsx(Step,{title:`PURCHASE_SUCCEEDED`,id:`purchasesucceeded`,children:_jsx(_components.p,{children:`Stash queues the webhook as soon as the capture request is accepted.`})})]}),`\n`,_jsx(Mermaid,{chart:`sequenceDiagram\nactor Player\nparticipant Stash\nparticipant Bank\nparticipant GameServer\n\nPlayer->>Stash: Complete Payment\nStash->>Bank: Authorize\nBank-->>Stash: Funds held\nopt ConfirmPayment pattern only\nStash->>GameServer: ConfirmPayment\nGameServer-->>Stash: 200 OK with granted items\nend\nStash->>Bank: Capture\nStash->>GameServer: PURCHASE_SUCCEEDED`}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`PURCHASE_SUCCEEDED`}),` marks the capture request, not settlement.`]}),` Stash sends the event as soon as the payment provider accepts the capture, and settlement happens asynchronously after that. Read the event as “the purchase completed and capture was requested”, not as a settlement receipt.`]})}),`\n`,_jsx(_components.p,{children:`Not every payment method has a separate capture step. Some settle at authorization, and which ones do depends on the method and on the provider processing it. The sequence above is otherwise unchanged, but there is no hold to release: the funds moved when the payment was authorized, so reversing such a purchase takes a refund. Standard card payments follow the authorize-then-capture sequence. If the behaviour of a specific method matters to your integration, check with your Stash engineering partner.`}),`\n`,_jsx(Heading,{level:`2`,id:`choosing-your-granting-flow`,children:`Choosing Your Granting Flow`}),`\n`,_jsxs(_components.p,{children:[`Select the pattern that best matches your backend architecture and reward-granting requirements. The three differ mainly in `,_jsx(_components.strong,{children:`when they fire relative to the charge`}),`, and only one of them lets your server reject a purchase:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Pattern`}),_jsx(_components.th,{children:`When it fires`}),_jsx(_components.th,{children:`Direction`}),_jsx(_components.th,{children:`Can your server reject?`}),_jsx(_components.th,{children:`Best for`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/api/egress/purchase/confirmpayment`,children:_jsx(_components.code,{children:`ConfirmPayment`})})}),_jsx(_components.td,{children:`After the funds are held, before they are captured`}),_jsx(_components.td,{children:`Stash calls your server`}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Yes.`}),` See the warning in that tab.`]}),_jsx(_components.td,{children:`Inventory limits, purchase caps, multi-client locking`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`PURCHASE_SUCCEEDED`}),` webhook`]}),_jsx(_components.td,{children:`After capture is requested`}),_jsx(_components.td,{children:`Stash calls your server`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Backends that process events asynchronously through queues, workers, or jobs`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/api/ingress/payments/getpaymentevent`,children:_jsx(_components.code,{children:`GetPaymentEvent`})})}),_jsx(_components.td,{children:`After the purchase completes, when you ask for it`}),_jsx(_components.td,{children:`Your server calls Stash`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Showing rewards in the client immediately after purchase`})]})]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`This is an integration-time choice, not a runtime one.`}),` Which delivery mechanism a shop uses is fixed when the shop is configured, not selected per purchase. A single shop uses one of these patterns rather than switching between them, so treat the table above as a decision you make once per integration.`]})}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Webhook`,id:`webhook`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Async post-purchase.`}),` Stash captures the payment and then sends your backend a `,_jsx(_components.code,{children:`PURCHASE_SUCCEEDED`}),` event. Your server has no say in whether the charge goes through.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Direction:`}),` Stash → Game (your backend exposes a webhook endpoint).`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Best for:`}),` Backends that already process events via queues, workers, or background jobs. Rewards may appear slightly after purchase.`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Flow:`})}),_jsxs(Steps,{children:[_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Player completes checkout.`})}),_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Stash authorizes the payment, then captures it.`})}),_jsxs(Step,{title:``,noAnchor:true,children:[_jsx(_components.p,{children:`Stash queues a`}),_jsx(_components.p,{children:_jsx(_components.code,{children:`PURCHASE_SUCCEEDED`})}),_jsx(_components.p,{children:`webhook to your backend.`})]}),_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Your backend consumes the event, runs game logic, and grants rewards.`})})]}),_jsx(Mermaid,{chart:`sequenceDiagram\nactor Player\nparticipant GameClient\nparticipant GameServer\nparticipant Stash\n\nPlayer->>Stash: Complete Payment\nStash->>Stash: Authorize, then Capture\nStash->>GameServer: PURCHASE_SUCCEEDED Webhook\nGameServer->>GameServer: Process Event (async)\nGameServer->>GameServer: Grant Rewards`}),_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Delivery is queued, not guaranteed.`}),` Stash hands the event to a delivery queue and retries a failed delivery, but a purchase never fails because its webhook could not be delivered, and there is no way to ask Stash to replay an event that never landed. On this pattern the webhook is your only delivery signal, so make your handler idempotent and reconcile missed events with `,_jsx(_components.a,{href:`/api/ingress/payments/getpaymentevent`,children:_jsx(_components.code,{children:`GetPaymentEvent`})}),`. See `,_jsx(_components.a,{href:`/guides/get-started/stash-webhooks/retries`,children:`Webhook Retries and Idempotency`}),`.`]})}),_jsxs(_components.p,{children:[`For full implementation details see the `,_jsx(_components.a,{href:`/guides/get-started/stash-webhooks/overview`,children:`Webhook guides`}),`.`]})]}),_jsxs(Tab,{title:`Payment Lookup`,id:`payment-lookup`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Synchronous post-purchase.`}),` Your backend asks Stash for the final payment status as soon as the purchase completes.`]}),_jsxs(_components.p,{children:[`This is a targeted lookup, not a background poll. The trigger is the client’s completion signal, which depends on how you present the checkout: the `,_jsx(_components.code,{children:`onSuccess`}),` prop or option on `,_jsx(_components.a,{href:`/guides/stash-pay/web-integration/web-apps`,children:`web`}),`; the `,_jsx(_components.code,{children:`successCallback`}),` argument of `,_jsx(_components.code,{children:`OpenCard`}),` or `,_jsx(_components.code,{children:`OpenModal`}),` (for example `,_jsx(_components.code,{children:`successCallback: OnSuccess`}),`) in `,_jsx(_components.a,{href:`/guides/stash-pay/ios-android-integration/unity`,children:`Unity`}),`; and, in browser presentation modes such as `,_jsx(_components.code,{children:`openBrowser`}),`, the deep link that returns the player to your game, since those modes have no success callback (see `,_jsx(_components.a,{href:`/guides/stash-pay/ios-android-integration/presentation-options`,children:`Presentation Options`}),`). Your backend already holds the checkout link order ID from creating the link, so it can look the purchase up as soon as the client reports completion.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Direction:`}),` Game → Stash (your backend calls `,_jsx(_components.a,{href:`/api/ingress/payments/getpaymentevent`,children:_jsx(_components.code,{children:`GetPaymentEvent`})}),`).`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Best for:`}),` Games where the client needs to show rewards immediately, or backends designed for synchronous request-response patterns without incoming webhooks.`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Flow:`})}),_jsxs(Steps,{children:[_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Player completes checkout.`})}),_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`The client receives the completion signal (the SDK success callback, or the deep-link return in browser modes) and notifies your backend.`})}),_jsxs(Step,{title:``,noAnchor:true,children:[_jsx(_components.p,{children:`Your backend calls`}),_jsx(_components.p,{children:_jsx(_components.a,{href:`/api/ingress/payments/getpaymentevent`,children:_jsx(_components.code,{children:`GetPaymentEvent`})})}),_jsx(_components.p,{children:`with the purchase ID.`})]}),_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Stash returns the final payment status.`})}),_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Your backend grants rewards and returns updated state to the client.`})})]}),_jsx(Mermaid,{chart:`sequenceDiagram\nactor Player\nparticipant GameClient\nparticipant GameServer\nparticipant Stash\n\nPlayer->>Stash: Complete Payment\nStash-->>GameClient: Success Callback or Deep Link Return\nGameClient->>GameServer: Check Purchase Status\nGameServer->>Stash: GetPaymentEvent\nStash-->>GameServer: Payment Status\nGameServer->>GameServer: Grant Rewards\nGameServer-->>GameClient: Updated Player State`}),_jsxs(_components.p,{children:[`See the `,_jsxs(_components.a,{href:`/api/ingress/payments/getpaymentevent`,children:[_jsx(_components.code,{children:`GetPaymentEvent`}),` API Reference`]}),` for request/response details.`]})]}),_jsxs(Tab,{title:`Confirm Payment`,id:`confirm-payment`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Validation between the hold and the charge.`}),` Stash authorizes the payment first, then calls your backend with `,_jsx(_components.a,{href:`/api/egress/purchase/confirmpayment`,children:_jsx(_components.code,{children:`ConfirmPayment`})}),` and waits for your response. Capture runs only after you return success.`]}),_jsxs(_components.p,{children:[`By the time you see the call, the player’s funds are already held but not taken. That is what makes this the only one of the three patterns where your server can `,_jsx(_components.strong,{children:`reject`}),` a purchase: the bad case is “not charged, not granted” rather than “charged, not granted”. It grants items during the same call, and it fires earliest of the three.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Direction:`}),` Stash → Game (your backend exposes the `,_jsx(_components.a,{href:`/api/egress/purchase/confirmpayment`,children:_jsx(_components.code,{children:`ConfirmPayment`})}),` endpoint).`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Best for:`}),` Games with per-player inventory limits, multi-client purchase locking, or any validation that must happen before a purchase is finalized.`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Flow:`})}),_jsxs(Steps,{children:[_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Player completes checkout.`})}),_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Stash authorizes the payment. The funds are held.`})}),_jsxs(Step,{title:``,noAnchor:true,children:[_jsx(_components.p,{children:`Stash sends a`}),_jsx(_components.p,{children:_jsx(_components.code,{children:`ConfirmPayment`})}),_jsx(_components.p,{children:`request to your backend.`})]}),_jsx(Step,{title:``,noAnchor:true,children:_jsx(_components.p,{children:`Your backend validates the purchase (inventory, caps, locks), grants the items, and returns them in the response body.`})}),_jsxs(Step,{title:``,noAnchor:true,children:[_jsx(_components.p,{children:`Stash captures the payment and queues a`}),_jsx(_components.p,{children:_jsx(_components.code,{children:`PURCHASE_SUCCEEDED`})}),_jsx(_components.p,{children:`webhook.`})]})]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`There is no approve field.`}),` Your server signals success by returning `,_jsx(_components.code,{children:`200 OK`}),` with the granted results in the body. A `,_jsx(_components.code,{children:`200`}),` whose `,_jsx(_components.code,{children:`results`}),` array is empty or absent confirms nothing and counts as a failure, not a success. Your server rejects by returning an HTTP `,_jsx(_components.code,{children:`4xx`}),` status, optionally with a `,_jsx(_components.code,{children:`decline`}),` object in the body naming a `,_jsx(_components.code,{children:`PurchaseConfirmationStatus`}),`. Where the checkout supports it, Stash uses that status to show the player the specific reason; otherwise the player sees a generic failure. See the `,_jsxs(_components.a,{href:`/api/egress/purchase/confirmpayment`,children:[_jsx(_components.code,{children:`ConfirmPayment`}),` API Reference`]}),`.`]}),_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Any failure response fails the purchase.`}),` Stash treats every non-success response the same way, whether it is a deliberate rejection, an unhandled `,_jsx(_components.code,{children:`500`}),`, a timeout, a malformed body, or a `,_jsx(_components.code,{children:`200`}),` with no results. When that happens Stash does not capture: the authorization is released or left to expire at the payment provider, and the player is not charged. A payment method that settles at authorization has no hold to release, so reversing that purchase takes a refund.`]}),_jsxs(_components.p,{children:[`Respond `,_jsx(_components.code,{children:`200 OK`}),` with your granted results unless you specifically do not want Stash to take the money.`]})]}),_jsx(Mermaid,{chart:`sequenceDiagram\nactor Player\nparticipant GameClient\nparticipant GameServer\nparticipant Stash\n\nPlayer->>Stash: Complete Payment\nStash->>Stash: Authorize (funds held)\nStash->>GameServer: ConfirmPayment Request\nGameServer->>GameServer: Validate \u0026 Grant Items\nGameServer-->>Stash: 200 OK with granted items\nStash->>Stash: Capture Payment`}),_jsxs(_components.p,{children:[`For the full request/response schema see the `,_jsxs(_components.a,{href:`/api/egress/purchase/confirmpayment`,children:[_jsx(_components.code,{children:`ConfirmPayment`}),` API Reference`]}),`.`]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"High-Level Flow","description":"Learn how Stash Pay's purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.","href":"/guides/stash-pay/flow"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Initial Setup","slug":"initial-setup","depth":2,"children":[]},{"title":"Core Checkout Flow (Common to All Options)","slug":"core-checkout-flow-common-to-all-options","depth":2,"children":[]},{"title":"Where the Money Is at Each Step","slug":"where-the-money-is-at-each-step","depth":2,"children":[]},{"title":"Choosing Your Granting Flow","slug":"choosing-your-granting-flow","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/stash-gg/7a02d7154563de2a/stash-header.js"],"subdomain":"stash-gg","siteName":"Stash Documentation","title":"High-Level Flow - Stash Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-18T00:14:54.456Z","originalFileLocation":"guides/stash-pay/flow.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn how Stash Pay\u0026#x27;s purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Stash Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"High-Level Flow - Stash Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how Stash Pay\u0026#x27;s purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Stash Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://stash-gg.mintlify.app/guides/stash-pay/flow\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.stash.gg/og-image.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"High-Level Flow - Stash Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how Stash Pay\u0026#x27;s purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.stash.gg/og-image.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Stash Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1e1e1e\">\u003clink data-mint-head rel=\"canonical\" href=\"https://stash-gg.mintlify.app/guides/stash-pay/flow\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/stash-pay/flow.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://stash-gg.mintlify.app/#organization\",\"name\":\"Stash Documentation\",\"url\":\"https://stash-gg.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/light.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=c58d1a385fd52c013aef762b9f06da39\"}},{\"@type\":\"WebSite\",\"@id\":\"https://stash-gg.mintlify.app#website\",\"name\":\"Stash Documentation\",\"url\":\"https://stash-gg.mintlify.app\",\"publisher\":{\"@id\":\"https://stash-gg.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://stash-gg.mintlify.app/guides/stash-pay/flow#webpage\",\"url\":\"https://stash-gg.mintlify.app/guides/stash-pay/flow\",\"name\":\"High-Level Flow\",\"description\":\"Learn how Stash Pay's purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.\",\"dateModified\":\"2026-11-18T00:14:54.456Z\",\"isPartOf\":{\"@id\":\"https://stash-gg.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://stash-gg.mintlify.app/guides/stash-pay/flow#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://stash-gg.mintlify.app/guides/stash-pay/flow#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Stash Pay\",\"item\":\"https://stash-gg.mintlify.app/guides/stash-pay/about\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"High-Level Flow\",\"item\":\"https://stash-gg.mintlify.app/guides/stash-pay/flow\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://stash-gg.mintlify.app/guides/stash-pay/flow#article\",\"headline\":\"High-Level Flow\",\"name\":\"High-Level Flow\",\"description\":\"Learn how Stash Pay's purchase flow works and discover three integration patterns for granting purchases based on your existing infrastructure.\",\"url\":\"https://stash-gg.mintlify.app/guides/stash-pay/flow\",\"mainEntityOfPage\":{\"@id\":\"https://stash-gg.mintlify.app/guides/stash-pay/flow#webpage\"},\"image\":\"https://docs.stash.gg/og-image.png\",\"dateModified\":\"2026-11-18T00:14:54.456Z\",\"publisher\":{\"@id\":\"https://stash-gg.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://stash-gg.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Stash Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Stash Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/stash-pay/flow.md","siteName":"Stash Documentation","nav":{"global":null,"tabs":[{"tab":"Integration Guides","groups":[{"group":"Introduction","pages":[{"title":"Quick Start","icon":"circle-check","href":"/guides"},{"title":"Demo Hub","icon":"rocket","href":"/guides/get-started/demo-hub"},{"title":"Stash Docs MCP","icon":"bot","href":"/guides/stash-docs-mcp"}]},{"group":"Getting Started","pages":[{"group":"Stash Studio","icon":"square-pen","pages":[{"title":"Getting Started with Stash Studio","href":"/guides/get-started/stash-studio/getting-started"},{"title":"Project Settings","href":"/guides/get-started/stash-studio/project-settings"},{"title":"Main Dashboard","href":"/guides/get-started/stash-studio/main-dashboard"},{"title":"View Logs in Stash Studio","href":"/guides/get-started/stash-studio/view-logs"},{"title":"Roles \u0026 Permissions","href":"/guides/get-started/stash-studio/roles-and-permissions"}]},{"group":"API Keys","icon":"key","pages":[{"title":"API Keys Overview","href":"/guides/get-started/stash-api-keys/overview"}]},{"group":"Stash Webhooks","icon":"link","pages":[{"title":"Stash Webhooks","href":"/guides/get-started/stash-webhooks/overview"},{"title":"Webhook Listener","href":"/guides/get-started/stash-webhooks/webhook-listener"},{"title":"Webhook List","href":"/guides/get-started/stash-webhooks/webhook-list"},{"title":"Webhook Retries and Idempotency","href":"/guides/get-started/stash-webhooks/retries"}]},{"title":"Test Card Numbers","icon":"credit-card","href":"/guides/get-started/test-cards"}]},{"group":"Stash Pay","pages":[{"title":"About Stash Pay","description":"Discover Stash Pay - a direct-to-consumer payment system designed for games and apps that offers a modern alternative to traditional in-app purchases. Integrate through browser checkout, in-game popups, websites, or custom shops.","href":"/guides/stash-pay/about"},{"title":"High-Level Flow","href":"/guides/stash-pay/flow"},{"title":"Integrating Stash Pay","description":"Learn how to integrate Stash Pay into your game or app with minimum setup. This guide covers creating checkout links, displaying checkouts in browser or in-app, and handling webhook events for secure payment processing.","href":"/guides/stash-pay/integration"},{"group":"Subscriptions","pages":[{"title":"About Subscriptions","href":"/guides/stash-pay/subscriptions/about"},{"title":"Subscription Flow","href":"/guides/stash-pay/subscriptions/flow"},{"title":"Integrating Subscriptions","href":"/guides/stash-pay/subscriptions/integration"}]},{"group":"iOS / Android Integration","pages":[{"title":"Presentation Options","href":"/guides/stash-pay/ios-android-integration/presentation-options"},{"title":"Native Apps Integration","href":"/guides/stash-pay/ios-android-integration/native-apps"},{"title":"Unity Integration","href":"/guides/stash-pay/ios-android-integration/unity"},{"title":"Unreal Engine Integration","href":"/guides/stash-pay/ios-android-integration/unreal"}]},{"group":"Web Integration","pages":[{"title":"Web Apps \u0026 WebGL","href":"/guides/stash-pay/web-integration/web-apps"}]},{"group":"Features \u0026 Customizations","pages":[{"title":"Stash Pay Opt-In","href":"/guides/stash-pay/how-tos/opt-in"},{"title":"Customize the Checkout Appearance","href":"/guides/stash-pay/how-tos/customize-checkout-appearance"},{"title":"Configure Image Domains","href":"/guides/stash-pay/how-tos/image-domains"},{"title":"Link Generator","href":"/guides/stash-pay/how-tos/link-generator"},{"title":"Unity Opt-in Dialog","href":"/guides/stash-pay/how-tos/unity-opt-in-dialog"},{"title":"Managed Catalog","href":"/guides/stash-pay/how-tos/managed-catalog"}]}]},{"group":"Stash Webshop","pages":[{"title":"About Stash Webshop","href":"/guides/stash-webshop/about"},{"title":"High-Level Flow","href":"/guides/stash-webshop/flow"},{"title":"Integrating Stash Webshop","href":"/guides/stash-webshop/integration"},{"group":"Catalog Management","pages":[{"title":"Catalog Management","href":"/guides/stash-webshop/catalog/catalog-management"},{"title":"Managed Catalog","href":"/guides/stash-webshop/catalog/managed-catalog"},{"group":"Real-time Catalog","pages":[{"title":"Real-time Catalog","href":"/guides/stash-webshop/catalog/real-time-catalog"},{"title":"Endpoints","href":"/guides/stash-webshop/catalog/real-time-catalog/endpoints"},{"title":"Payment Flow","href":"/guides/stash-webshop/catalog/real-time-catalog/payment-flow"},{"title":"Catalog Items and Prices","href":"/guides/stash-webshop/catalog/real-time-catalog/items-and-prices"},{"title":"Free Items and Streaks","href":"/guides/stash-webshop/catalog/real-time-catalog/free-items"},{"title":"Localization and Text","href":"/guides/stash-webshop/catalog/real-time-catalog/localization-and-text"},{"title":"Offer Templates","href":"/guides/stash-webshop/catalog/real-time-catalog/offer-templates"},{"title":"Drop Rate Compliance","href":"/guides/stash-webshop/catalog/real-time-catalog/drop-rates"},{"title":"Caching","href":"/guides/stash-webshop/catalog/real-time-catalog/caching"}]}]},{"group":"Player Authentication","pages":[{"title":"Authentication Methods","href":"/guides/stash-webshop/player-authentication/authentication-methods"},{"title":"Authentication Providers","href":"/guides/stash-webshop/player-authentication/authentication-providers"},{"title":"Account Linking","href":"/guides/stash-webshop/player-authentication/account-linking"}]},{"group":"Features \u0026 Customizations","pages":[{"title":"Customize the Webshop Appearance","href":"/guides/stash-webshop/how-tos/customize-webshop-appearance"},{"title":"Create and Edit Promo Codes","href":"/guides/stash-webshop/how-tos/create-promo-codes"},{"group":"Loyalty Program","pages":[{"title":"Loyalty Program","href":"/guides/stash-webshop/how-tos/loyalty"},{"title":"Reward Types","href":"/guides/stash-webshop/how-tos/loyalty/reward-types"},{"title":"Tiers","href":"/guides/stash-webshop/how-tos/loyalty/tiers"},{"title":"Milestones \u0026 Rewards","href":"/guides/stash-webshop/how-tos/loyalty/milestones"},{"title":"Milestone SKU Rewards","href":"/guides/stash-webshop/how-tos/loyalty/milestone-sku-rewards"},{"title":"Configure in Stash Studio","href":"/guides/stash-webshop/how-tos/loyalty/configuration"},{"title":"Analytics \u0026 App Integration","href":"/guides/stash-webshop/how-tos/loyalty/analytics-app-integration"},{"title":"Refunds \u0026 XP Adjustments","href":"/guides/stash-webshop/how-tos/loyalty/refunds-and-xp"}]},{"title":"Web Shop Maintenance Mode","href":"/guides/stash-webshop/how-tos/webshop-maintenance-mode"}]}]},{"group":"Stash Launcher","pages":[{"title":"About Stash Launcher","href":"/guides/stash-launcher/about"},{"title":"Launcher Concepts","href":"/guides/stash-launcher/launcher-concepts"},{"title":"Integrating Stash Launcher","href":"/guides/stash-launcher/integration"},{"group":"Build Management","pages":[{"title":"Manage Builds, Releases, and Channels","href":"/guides/stash-launcher/build-management/build-management"},{"title":"Stash CLI","href":"/guides/stash-launcher/build-management/stash-cli"}]},{"group":"Features \u0026 Customizations","pages":[{"title":"Customize Your Launcher's Appearance","href":"/guides/stash-launcher/how-tos/customize-launcher-appearance"},{"title":"Launcher Maintenance Mode","href":"/guides/stash-launcher/how-tos/launcher-maintenance-mode"}]}]}]},{"tab":"API Reference","dropdowns":[{"dropdown":"Ingress","groups":[{"group":"Overview","pages":[{"title":"Getting Started","href":"/api/ingress"}]},{"group":"Catalog","pages":[{"title":"Abort offers","deprecated":null,"version":null,"sidebarTitle":"Abort offers","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/abort","href":"/api/ingress/catalog/abortoffers"},{"title":"Force refresh catalog","deprecated":null,"version":null,"sidebarTitle":"Force refresh catalog","openapi":"/ingress-openapi.json post /sdk/server/catalog/force-refresh","href":"/api/ingress/catalog/forcerefreshcatalog"},{"title":"List offer aborts","deprecated":null,"version":null,"sidebarTitle":"List offer aborts","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/list","href":"/api/ingress/catalog/listofferaborts"},{"title":"Un-abort offers","deprecated":null,"version":null,"sidebarTitle":"Un-abort offers","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/unabort","href":"/api/ingress/catalog/unabortoffers"}]},{"group":"Localization","pages":[{"title":"Refresh localizations","deprecated":null,"version":null,"sidebarTitle":"Refresh localizations","openapi":"/ingress-openapi.json post /sdk/studio/{shopId}/localizations/refresh","href":"/api/ingress/localization/refreshlocalizations"}]},{"group":"Loyalty","pages":[{"title":"Get loyalty program configuration","deprecated":null,"version":null,"sidebarTitle":"Get loyalty program configuration","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty","href":"/api/ingress/loyalty/getloyalty"},{"title":"Get loyalty configuration","deprecated":null,"version":null,"sidebarTitle":"Get loyalty configuration","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty/config","href":"/api/ingress/loyalty/getloyaltyconfig"},{"title":"Get a player's loyalty standing","deprecated":null,"version":null,"sidebarTitle":"Get a player's loyalty standing","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty/players/{playerId}","href":"/api/ingress/loyalty/getplayerloyalty"},{"title":"Configure a loyalty season","deprecated":null,"version":null,"sidebarTitle":"Configure a loyalty season","openapi":"/ingress-openapi.json put /sdk/studio/{shopId}/loyalty/config","href":"/api/ingress/loyalty/updateloyaltyconfig"}]},{"group":"Payments","pages":[{"title":"Get payment event by ID","deprecated":null,"version":null,"sidebarTitle":"Get payment event by ID","openapi":"/ingress-openapi.json get /sdk/server/payment/{id}","href":"/api/ingress/payments/getpaymentevent"}]},{"group":"Pricing","pages":[{"title":"Convert prices","deprecated":null,"version":null,"sidebarTitle":"Convert prices","openapi":"/ingress-openapi.json post /sdk/server/prices/convert","href":"/api/ingress/pricing/convertprices"},{"title":"Get prices","deprecated":null,"version":null,"sidebarTitle":"Get prices","openapi":"/ingress-openapi.json get /sdk/server/prices","href":"/api/ingress/pricing/getprices"}]},{"group":"Reports","pages":[{"title":"List report files","deprecated":null,"version":null,"sidebarTitle":"List report files","openapi":"/ingress-openapi.json post /sdk/studio/{shopId}/reports/files","href":"/api/ingress/reports/listreportfiles"}]},{"group":"Server URLs","pages":[{"title":"Generate authenticated URL","deprecated":null,"version":null,"sidebarTitle":"Generate authenticated URL","openapi":"/ingress-openapi.json post /sdk/server/generate_url","href":"/api/ingress/server-urls/generateauthenticatedurl"}]},{"group":"Stash Pay","pages":[{"title":"Generate Checkout","deprecated":null,"version":null,"sidebarTitle":"Generate Checkout","openapi":"/ingress-openapi.json post /sdk/server/checkout_links/generate_quick_pay_url","href":"/api/ingress/stash-pay/generatequickpayurl"}]},{"group":"Subscription Checkout Links","pages":[{"title":"Create a subscription change checkout link","deprecated":null,"version":null,"sidebarTitle":"Create a subscription change checkout link","openapi":"/ingress-openapi.json post /sdk/subscriptions/{subscriptionId}/change-checkout-links","href":"/api/ingress/subscription-checkout-links/createsubscriptionchangecheckoutlink"},{"title":"Create a subscription checkout link","deprecated":null,"version":null,"sidebarTitle":"Create a subscription checkout link","openapi":"/ingress-openapi.json post /sdk/subscriptions/checkout-links","href":"/api/ingress/subscription-checkout-links/createsubscriptioncheckoutlink"}]},{"group":"Subscription Plans","pages":[{"title":"Get plan by ID","deprecated":null,"version":null,"sidebarTitle":"Get plan by ID","openapi":"/ingress-openapi.json get /sdk/plans/{planId}","href":"/api/ingress/subscription-plans/getplan"},{"title":"Get plan by code","deprecated":null,"version":null,"sidebarTitle":"Get plan by code","openapi":"/ingress-openapi.json get /sdk/plans/code/{code}","href":"/api/ingress/subscription-plans/getplanbycode"},{"title":"List plans","deprecated":null,"version":null,"sidebarTitle":"List plans","openapi":"/ingress-openapi.json get /sdk/plans","href":"/api/ingress/subscription-plans/listplans"}]},{"group":"Subscriptions","pages":[{"title":"Cancel subscription","deprecated":null,"version":null,"sidebarTitle":"Cancel subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}/cancel","href":"/api/ingress/subscriptions/cancelsubscription"},{"title":"Get payments by subscription ID","deprecated":null,"version":null,"sidebarTitle":"Get payments by subscription ID","openapi":"/ingress-openapi.json get /sdk/subscriptions/{id}/payments","href":"/api/ingress/subscriptions/getpaymentsbysubscriptionid"},{"title":"Get subscription by ID","deprecated":null,"version":null,"sidebarTitle":"Get subscription by ID","openapi":"/ingress-openapi.json get /sdk/subscriptions/{id}","href":"/api/ingress/subscriptions/getsubscription"},{"title":"List subscriptions","deprecated":null,"version":null,"sidebarTitle":"List subscriptions","openapi":"/ingress-openapi.json get /sdk/subscriptions","href":"/api/ingress/subscriptions/listsubscriptions"},{"title":"Reactivate subscription","deprecated":null,"version":null,"sidebarTitle":"Reactivate subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}/reactivate","href":"/api/ingress/subscriptions/reactivatesubscription"},{"title":"Update subscription","deprecated":null,"version":null,"sidebarTitle":"Update subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}","href":"/api/ingress/subscriptions/updatesubscription"}]},{"group":"User Preferences","pages":[{"title":"Get user preferences","deprecated":null,"version":null,"sidebarTitle":"Get user preferences","openapi":"/ingress-openapi.json get /sdk/server/user_preferences/{userId}","href":"/api/ingress/user-preferences/getuserpreferences"},{"title":"Set user preferences","deprecated":null,"version":null,"sidebarTitle":"Set user preferences","openapi":"/ingress-openapi.json post /sdk/server/user_preferences/{userId}","href":"/api/ingress/user-preferences/setuserpreferences"}]},{"group":"Web Shop","pages":[{"title":"Get maintenance mode","deprecated":null,"version":null,"sidebarTitle":"Get maintenance mode","openapi":"/ingress-openapi.json get /sdk/server/shop/maintenance","href":"/api/ingress/web-shop/getmaintenancemode"},{"title":"Set maintenance mode","deprecated":null,"version":null,"sidebarTitle":"Set maintenance mode","openapi":"/ingress-openapi.json post /sdk/server/shop/maintenance","href":"/api/ingress/web-shop/setmaintenancemode"}]},{"group":"Webshop Account Linking","pages":[{"title":"Approve custom login","deprecated":null,"version":null,"sidebarTitle":"Approve custom login","openapi":"/ingress-openapi.json post /sdk/custom_login/approve","href":"/api/ingress/webshop-account-linking/approvecustomlogin"},{"title":"Decline custom login","deprecated":null,"version":null,"sidebarTitle":"Decline custom login","openapi":"/ingress-openapi.json post /sdk/custom_login/decline","href":"/api/ingress/webshop-account-linking/declinecustomlogin"},{"title":"Force Logout user","deprecated":null,"version":null,"sidebarTitle":"Force Logout user","openapi":"/ingress-openapi.json post /sdk/server/custom_login/logout","href":"/api/ingress/webshop-account-linking/logoutuser"}]}]},{"dropdown":"Egress","groups":[{"group":"Overview","pages":[{"title":"Getting Started","href":"/api/egress"}]},{"group":"Catalog","pages":[{"title":"Get product catalog","deprecated":null,"version":null,"sidebarTitle":"Get product catalog","playground":"simple","openapi":"/egress-openapi.json get /api/v1/catalog","href":"/api/egress/catalog/getcatalog"},{"title":"Get offer details","deprecated":null,"version":null,"sidebarTitle":"Get offer details","playground":"simple","openapi":"/egress-openapi.json get /api/v1/catalog/offer","href":"/api/egress/catalog/getofferdetails"}]},{"group":"Players","pages":[{"title":"Get player by ID","deprecated":null,"version":null,"sidebarTitle":"Get player by ID","playground":"simple","openapi":"/egress-openapi.json get /api/v1/player","href":"/api/egress/players/getplayer"}]},{"group":"Purchase","pages":[{"title":"Cancel pending payment","deprecated":null,"version":null,"sidebarTitle":"Cancel pending payment","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/cancel","href":"/api/egress/purchase/cancelpayment"},{"title":"Confirm payment completion","deprecated":null,"version":null,"sidebarTitle":"Confirm payment completion","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/confirm","href":"/api/egress/purchase/confirmpayment"},{"title":"Register payment intent","deprecated":null,"version":null,"sidebarTitle":"Register payment intent","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/register","href":"/api/egress/purchase/registerpayment"}]}]}]},{"tab":"Partner With Us","pages":[{"title":"Partner With Us","href":"/partners"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"High-Level Flow - Stash Documentation","deploymentId":"dpl_5nNsUVHqbVdUHouroPPzwztSbjmH","buildId":"dpl_5nNsUVHqbVdUHouroPPzwztSbjmH","dynamics":[],"chunks":[]}