Skip to Content
Pymstr

Payment States

Every payment and payout moves through the same lifecycle.

StatusTerminalMeaning
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

FromToTriggerWebhook
ACTIVEPROCESSINGThe customer sends the transactionpayment.processing, once the network accepts the transaction
ACTIVECANCELLEDYou cancel itpayment.cancelled
ACTIVEEXPIREDIt reaches expiresAtpayment.expired
PROCESSINGACTIVEThe network did not accept the transactionNone
PROCESSINGSUCCESSFULThe transaction is confirmed on chainpayment.completed
PROCESSINGFAILEDThe transaction reverted or was never confirmedpayment.failed
FAILEDSUCCESSFULRare: the transaction turns out to have gone throughpayment.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.