Skip to main content
POST
/
checkout
/
sessions
/
select-payment
curl -X POST https://api.maash.io/checkout/sessions/select-payment \
  -H "Content-Type: application/json" \
  -H "x-maash-user-type: checkout" \
  -H "Authorization: Bearer <session_token>" \
  -d '{
    "token": "USDC",
    "chain": "ethereum"
  }'
{
  "data": {
    "payment_id": "pay_01ARZ3NDEKTSV4RRFFQ69G5FAV",
    "transaction_id": "txn_123456789",
    "status": "awaiting_payment",
    "wallet_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f5fB12",
    "payment_uri": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48@1/transfer?address=0x742d35Cc6634C0532925a3b844Bc9e7595f5fB12&uint256=100000000",
    "qr_code_url": "https://dev-maash-qr-codes.s3.amazonaws.com/qr/pay_01ARZ3...png?X-Amz-...",
    "amount_usd": 100,
    "token": "USDC",
    "chain": "ethereum",
    "token_amount_expected": "100.100000",
    "expires_at": "2024-02-02T15:25:00Z",
    "created_at": "2024-01-31T15:26:00Z",
    "updated_at": "2024-01-31T15:26:00Z"
  }
}
Select a payment method for a checkout session. Creates an ephemeral wallet address via Maash Bridge and generates a QR code for the payment. The session is identified by the session token passed in the Authorization header.

Authentication

x-maash-user-type
string
required
Must be set to checkout.
The session token (returned in the checkout URL when the session was created) must be passed as a Bearer token in the Authorization header.

Request body

token
string
required
Token to pay with. Must be one of the session’s supported tokens. Accepted values: USDC, USDT.
chain
string
required
Chain to pay on. Must be one of the session’s supported chains. Accepted values: ethereum, polygon, arbitrum, optimism, base, bsc, solana, tron.

Response

data
object
payment_id
string
Unique payment identifier (e.g., pay_01ARZ3NDEKTSV4RRFFQ69G5FAV).
transaction_id
string
Your transaction identifier.
status
string
Payment status. Returns awaiting_payment on success.
wallet_address
string
Ephemeral wallet address for the customer to send payment to.
payment_uri
string
Blockchain-specific payment URI. Format depends on the chain (EIP-681 for EVM, Solana Pay for Solana, Tron URI for Tron).
qr_code_url
string
Pre-signed S3 URL to a QR code image encoding the payment URI.
amount_usd
number
Payment amount in USD.
token
string
Selected token symbol. One of: USDC, USDT.
chain
string
Selected chain identifier.
token_amount_expected
string
Total token amount the customer should send (including fees).
expires_at
string
ISO 8601 timestamp when this payment expires.
created_at
string
ISO 8601 timestamp when the payment was created.
updated_at
string
ISO 8601 timestamp of the last update.
curl -X POST https://api.maash.io/checkout/sessions/select-payment \
  -H "Content-Type: application/json" \
  -H "x-maash-user-type: checkout" \
  -H "Authorization: Bearer <session_token>" \
  -d '{
    "token": "USDC",
    "chain": "ethereum"
  }'
{
  "data": {
    "payment_id": "pay_01ARZ3NDEKTSV4RRFFQ69G5FAV",
    "transaction_id": "txn_123456789",
    "status": "awaiting_payment",
    "wallet_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f5fB12",
    "payment_uri": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48@1/transfer?address=0x742d35Cc6634C0532925a3b844Bc9e7595f5fB12&uint256=100000000",
    "qr_code_url": "https://dev-maash-qr-codes.s3.amazonaws.com/qr/pay_01ARZ3...png?X-Amz-...",
    "amount_usd": 100,
    "token": "USDC",
    "chain": "ethereum",
    "token_amount_expected": "100.100000",
    "expires_at": "2024-02-02T15:25:00Z",
    "created_at": "2024-01-31T15:26:00Z",
    "updated_at": "2024-01-31T15:26:00Z"
  }
}