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

# High-Level Flow

> Learn how Stash Webshop connects players to your game economy through a web-based storefront. Understand the core flow including account linking, catalog presentation, and event processing, plus the failsafe purchase flow that ensures secure transactions.

Stash Webshop connects players to your game economy through a web-based storefront.

```mermaid theme={null}
sequenceDiagram
actor Player
participant Webshop
participant Stash
participant Game Server

Player->>Webshop: Visit webshop
Webshop->>Stash: Authenticate player
Stash->>Webshop: Confirm login

Webshop->>Stash: Request catalog
alt Static catalog
Stash->>Webshop: Return managed offers
else Real-time catalog
Stash->>Game Server: Fetch live offers
Game Server->>Stash: Return personalized offers
Stash->>Webshop: Deliver catalog
end
Webshop->>Player: Show offers

Player->>Webshop: Make purchase
Webshop->>Stash: Process payment
Stash->>Game Server: Send purchase event
Game Server->>Stash: Confirm item grant
Stash->>Webshop: Confirm transaction
```

### Core Flow

Stash Webshop integration has three main steps. Each step defines how players connect, view offers, and complete transactions.

**1. Account linking**

Players link their in-game account with Apple, Google, Facebook, or a custom JWT/OIDC login provider.

**2. Catalog presentation**

Players see offers from either **managed catalog** or **real-time catalog**.

**3. Event Processing**

The webshop sends real-time notifications to your game server through webhooks for item granting and analytics.

## Failsafe purchase flow

When your game server grants items through [`ConfirmPayment`](https://docs.stash.gg/api/egress/purchase/confirmpayment), players are only charged after your server confirms delivery.

Stash authorizes the payment and holds the funds, then calls `ConfirmPayment` on your server and waits. It captures the charge only once your server returns success. If your server declines, or the call fails, Stash does not capture the payment.

```mermaid theme={null}
flowchart LR
A[PURCHASE STARTED] --> B[AUTHORIZE\nfunds held]
B --> C[CONFIRM PAYMENT\nyour server grants items]
C --> D[CAPTURE\nfunds taken]
```

Shops that grant from the `PURCHASE_SUCCEEDED` webhook instead do not have this gate: that event is sent after Stash requests the capture. For the full sequence, and for the checks only your backend can enforce, see [Real-time Catalog Payment Flow](https://docs.stash.gg/guides/stash-webshop/catalog/real-time-catalog/payment-flow.md).


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