Payment sessions
One-shot hosted checkouts.
A PaymentSession is everything needed to render a hosted checkout for a single payment. Created server-side, paid by the customer in their wallet, confirmed by the indexer.
Create
Returns:
The response carries more fields than shown here, such as feeAmount, netAmount and payerWalletAddress.
Optional inputs: customer (walletAddress, email, externalRef), expiresInMinutes (default 30, max 1440) and metadata.
Retrieve
List
Filters: status, and customerId to list one customer's sessions. from and to limit the list to sessions created in a range. See List filters.
Cancel
Cancels an open session (created or awaiting_payment). Any other status returns 403 session_invalid_state. A confirmed payment can't be cancelled; refund it instead.
POST /v1/payment-sessions/{id}/expire works the same way and moves the session to expired.
Status lifecycle
Statuses: created, awaiting_payment, submitted, confirmed, failed, expired, cancelled.
A new session is created. When the relayer broadcasts the payment it becomes submitted, and the indexer moves it to confirmed. An open session (created or awaiting_payment) can be cancelled or can expire.
Sessions expire 30 minutes after creation by default. Set expiresInMinutes to change it. When expiresAt passes, the scheduler moves an open session to expired.
Webhook events
| Event | Fires when |
|---|---|
payment.created | The session was created, by the API or a storefront |
payment.completed | The on-chain transaction confirmed |
payment.failed | The scheduler expired the session |

