Payment States
Every payment and payout moves through the same lifecycle.
| Status | Terminal | Meaning |
|---|---|---|
ACTIVE | ❌ | Created and waiting for the customer to send. Can be cancelled, and expires at expiresAt |
PROCESSING | ❌ | The customer sent the transaction. Usually resolves within seconds, and never expires |
SUCCESSFUL | ✅ | The transaction is confirmed on chain |
FAILED | ✅* | The transaction reverted or was never confirmed |
EXPIRED | ✅ | Reached expiresAt while ACTIVE |
CANCELLED | ✅ | You cancelled it |
* In very rare cases a FAILED payment is credited later, see Late Credit.
State Transitions
| From | To | Trigger | Webhook |
|---|---|---|---|
ACTIVE | PROCESSING | The customer sends the transaction | payment.processing, once the network accepts the transaction |
ACTIVE | CANCELLED | You cancel it | payment.cancelled |
ACTIVE | EXPIRED | It reaches expiresAt | payment.expired |
PROCESSING | ACTIVE | The network did not accept the transaction | None |
PROCESSING | SUCCESSFUL | The transaction is confirmed on chain | payment.completed |
PROCESSING | FAILED | The transaction reverted or was never confirmed | payment.failed |
FAILED | SUCCESSFUL | Rare: the transaction turns out to have gone through | payment.completed |
Payouts fire the matching payout.* events.
Late Credit
In very rare cases, a transaction we had given up on turns out to have gone through, and we credit the payment. You then
get payment.failed and payment.completed for the same paymentId, in either order. Treat completed as final. The
same applies to payouts.
We fail a payment only once its transaction can no longer confirm and the blockchain shows no trace of it. A chain reorganization, or a node answering from stale data, can make that reading wrong.
If you created a replacement under the same externalId in between, the replacement keeps the externalId and the
credited payment's externalId becomes null. Match the credited payment on paymentId.