Payments
Payment statuses
The payment lifecycle — every status, what moves a payment between them, and which webhooks are sent.
requires_paymentpayer starts attemptprocessingacquirer approvessucceededpartial refundpartially_refundedrest refundedrefunded
processingattempt declined (failure set, payment.failed)requires_payment— payer may retry until expiry
succeededfull refundrefunded
requires_payment | processingcanceled / timed outcanceledorexpired
processinglegacy form-POST only (one-shot)failed
succeeded (until refunded), refunded, failed, canceled, expired.| Status | Meaning | Final? | Webhook when entered |
|---|---|---|---|
requires_payment | Created and waiting for the payer. Also the state after a declined attempt (failure is set). | No | payment.failed (after a declined attempt) |
processing | The payer started an attempt; waiting for the acquirer's result. | No | — |
succeeded | Paid. Funds are captured and will be settled to your balance. | Yes¹ | payment.succeeded |
partially_refunded | Succeeded, and part of the amount has been refunded (amount_refunded < amount). | Yes¹ | refund.succeeded |
refunded | The full amount has been refunded. | Yes | refund.succeeded |
failed | Legacy form-POST payments only: the single attempt was declined. | Yes | payment.failed |
canceled | Canceled by you (POST /v1/payments/:id/cancel) or by the payer on the checkout. | Yes | payment.canceled |
expired | Not paid before expires_at. | Yes | payment.expired |
¹ succeeded and partially_refunded can still move to partially_refunded / refunded through refunds.
Rules worth knowing
- Declines are retryable. For API, payment-link and invoice payments a declined attempt returns the payment from
processingtorequires_paymentwithfailure: { code, message }set, and emitspayment.failed. The payer can try again until the payment expires — sopayment.faileddoes not mean the order is lost. Only treatcanceledandexpiredas final non-payment. - Legacy form-POST payments are one-shot. A declined attempt moves them to
failed, matching the old gateway's behaviour. - Only
requires_paymentcan be canceled via the API. A payment that'sprocessingwill resolve on its own. - Transitions are atomic. Each change is a guarded update (
… WHERE status IN (…)), so a late acquirer callback can never "un-cancel" or double-succeed a payment, and eachpayment.succeededis emitted exactly once per payment (deliveries may still be retried — see webhooks). failuredescribes the most recent declined attempt. It's cleared when the payer starts a new attempt and when the payment succeeds. Typical codes:card_declined,insufficient_funds,expired_card,authentication_failed,processing_error,acquirer_timeout.
Fields that change with status
| Field | Set when |
|---|---|
payment_method | An attempt is made: { type: "card" | "lankaqr", card_brand, card_last4 } |
succeeded_at | The payment succeeds |
fee, net | The payment succeeds (net = amount − fee) |
amount_refunded | Refunds succeed |
settled_at | The funds are settled to your available balance |

