Session Lifecycle
Every session follows the same lifecycle, regardless of type.Status Descriptions
| Status | Description | Next States |
|---|---|---|
open | Created, waiting for payment | pending, expired |
pending | Payment detected, confirming on-chain | routing, settled, failed |
routing | Cross-chain routing | settled, failed |
settled | Complete — funds received by merchant | refunded |
expired | Session timed out with no payment | (terminal) |
failed | Routing failed, auto-refund initiated | (terminal) |
refunded | Merchant-initiated refund | (terminal) |
Same-Chain vs Cross-Chain
- Same-chain:
open→pending→settled(sub-second) - Cross-chain:
open→pending→routing→settled(3–15 seconds)
Webhook Events
| Transition | Webhook Event |
|---|---|
→ pending | payment.pending |
→ routing | payment.routing |
→ settled | payment.settled |
→ failed | payment.failed |
→ expired | session.expired |
| Refund initiated | refund.created |
| Refund completed | refund.settled |
Refunds
POST /v2/sessions/:id/refundwith amount and reason- Partial refunds allowed (multiple times)
- Total refunded cannot exceed original amount
- Auto-refund on payment failure (Stableyard handles this)