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

# Checkout Payment Flow

> End-to-end sequence from the buyer tapping checkout to the merchant receiving the webhook.

The diagram below traces a full Checkout payment: the buyer taps checkout in the merchant's app, the merchant's backend creates a checkout intent, the buyer pays on the AllScale checkout page, and AllScale delivers a webhook once the transaction is confirmed on-chain.

```mermaid theme={null}
flowchart TB

subgraph U["User"]
  direction TB
  U1["Tap Checkout USDT"]
end

subgraph FE["3rd-party Frontend"]
  direction TB
  C1["Trigger AllScale Checkout"]
  C2["Open checkout_url"]
end

subgraph BE["3rd-party Backend"]
  direction TB
  TP1["Create checkout request"]
  TP2["POST /checkout-intents"]
  TP3["Receive checkout_url"]
  TP4["Return url to frontend"]
  TP5["Receive webhook"]
end

subgraph AS["AllScale Backend"]
  direction TB
  B1["Authenticate"]
  B2["Validate payload"]
  B3["Create checkout intent"]
  B4["Generate checkout_url"]
  B5["Return url"]

  B6["Receive payment completed"]
  B7["Wait for on-chain confirmation"]
  B8["Verify tx"]
  B9["Mark intent confirmed"]
  B10["Trigger webhook"]
end

subgraph FE2["AllScale Checkout Page"]
  direction TB
  F1["Render checkout UI"]
  F2["User submits payment"]
  F3["Notify backend"]
end

U1 --> C1 --> TP1 --> TP2 --> B1 --> B2 --> B3 --> B4 --> B5 --> TP3 --> TP4 --> C2 --> F1
F1 --> F2 --> F3 --> B6 --> B7 --> B8 --> B9 --> B10 --> TP5
```
