Payment lifecycle
The canonical state machine for a 505pay payment intent — from created to completed, refunded, expired, or failed
Every payment in 505pay is modelled as a payment intent. The intent is created by your server, presented to the payer, and moves through a well-defined set of states until it is terminal. Understanding the lifecycle is the foundation for building correct payment, refund, and reconciliation logic.
State diagram
State reference
| State | Meaning | Terminal? |
|---|---|---|
created | Intent exists; no checkout page opened yet | No |
pending | Payer is on the checkout page or has initiated the payment | No |
completed | PSP has confirmed the payment; funds captured | No (refund possible) |
partially_refunded | One or more partial refunds issued | No (more refunds possible) |
refunded | Full amount refunded | Yes |
failed | PSP rejected or an unrecoverable error occurred | Yes |
expired | TTL elapsed before the payer completed payment | Yes |
Webhook events
Your server receives a webhook for each state transition. See Webhooks for signature verification and retry behaviour.
| Event | Fired when | Recommended action |
|---|---|---|
payment.created | Intent created | Log; start UI loading state |
payment.pending | Payer initiates checkout | Show pending UI |
payment.completed | PSP confirms — funds captured | Fulfil order; send receipt |
payment.failed | PSP rejects | Prompt payer to retry or use another method |
payment.expired | TTL elapsed | Close checkout UI; optionally re-create intent |
payment.refunded | Full refund processed | Update order status; send refund confirmation |
Do not fulfil on the API response alone
Always wait for the payment.completed webhook before fulfilling an order. The Payments API response confirms the intent was accepted, not that funds have settled. Webhooks carry the authoritative payment confirmation from the PSP.
Method-specific notes
| Method | TTL (default) | Refundable? | Settlement |
|---|---|---|---|
| QRIS Dynamic | 15 min | No | T+0 |
| QRIS Static | N/A (reusable) | No | T+0 |
| Virtual Account | 24 h | No | T+1 |
| GoPay | 15 min | Yes (via 505pay dashboard) | T+1 |
| OVO | 5 min | Yes | T+1 |
| DANA | 15 min | Yes | T+1 |
| ShopeePay | 15 min | Yes | T+1 |
| Card 3DS | 15 min | Yes | T+2 |
Related
- Webhooks guide — signature verification, retry logic, delivery guarantees
- Idempotency guide — safe intent re-creation
- Accept your first payment — end-to-end recipe
- Issue a refund — refund recipe
Was this page helpful?