Skip to main content
Version: v2

Payment Lifecycle States

Overview

Every payment in the v2 system follows a state machine. Understanding which states are transient, which are terminal, and what triggers each transition is fundamental to working on payment code.


Complete State Machine


State Reference

Transient States (non-terminal)

StateTriggerNext StatesNotes
INITIATEDPOST /v2/payments acceptedPENDING, PROCESSING, PENDING_FOR_CUSTOMER_CREATION, PENDING_FOR_PAYMENT_METHOD_CREATIONEntry state for all payments
PENDINGPayment queuedPROCESSING, CANCEL_INITIALIZEDWaiting for processing slot
PENDING_FOR_CUSTOMER_CREATIONCustomer lookup failed, creation neededINITIATED, FAILEDRetries customer resolution
PENDING_FOR_PAYMENT_METHOD_CREATIONPayment method needs setupINITIATED, FAILEDRetries PM setup
PROCESSINGVendor request in flightCOMPLETED, FAILED, AUTHORIZED, ACCEPTED, AUTH_REQUIRED, PROCESSING_DEDUP_CHECKActive Stripe call
PROCESSING_DEDUP_CHECKPay-and-save dedupPROCESSINGChecks for duplicate PM before saving
AUTH_REQUIRED3DS challenge issuedCONFIRMATION_INITIALIZEDWaiting for customer 3DS completion
CONFIRMATION_INITIALIZED3DS challenge completedAUTHORIZED, COMPLETED, FAILEDPost-3DS confirmation
AUTHORIZEDPre-auth hold placedCAPTURE_INITIALIZED, CANCEL_INITIALIZEDFunds held, awaiting merchant action. Expires after 7 days.
ACCEPTEDACH accepted by processorCOMPLETED, FAILED, CANCEL_INITIALIZEDBank account settlement pending
CAPTURE_INITIALIZEDPATCH /capture receivedCOMPLETED, FAILEDStripe capture in progress
CANCEL_INITIALIZEDPATCH /cancel receivedCANCELLED, CANCEL_FAILEDStripe void/cancel in progress

Terminal States

StateMeaningWebhook Event
COMPLETEDPayment fully processed and settledPAYMENT_SUCCEEDED
FAILEDPayment permanently failedPAYMENT_FAILED
CANCELLEDPayment cancelled by merchant or systemPAYMENT_CANCELLED
CANCEL_FAILEDCancellation attempt failed; original state unchanged— (requires manual intervention)

Allocation-Level States

In split-tender payments, each allocation has its own state independent of the payment-level state.

Allocation StatusDescriptionUnique to Split-Tender?
PENDINGQueuedNo
AUTH_REQUIRED3DS neededNo
CONFIRMATION_INITIALIZEDPost-3DSNo
AUTHORIZEDFunds heldNo
CAPTURE_INITIALIZEDCapturingNo
ACCEPTEDACH acceptedNo
CANCEL_INITIALIZEDCancellingNo
CANCELEDSuccessfully cancelledNo
ROLLED_BACKSystem reversed (sibling failed)Yes
COMPLETEDSettledNo
FAILEDDeclined/errorNo

State Transition Rules

Cancellation Eligibility

Only payments in these states can be cancelled:

StateCancel Allowed?Notes
AUTHORIZEDPre-auth void
ACCEPTEDACH reversal
PENDINGBefore processing starts
COMPLETEDUse refund instead
FAILEDAlready terminal
CANCELLEDAlready terminal
PROCESSINGIn-flight — wait for terminal state

Capture Eligibility

StateCapture Allowed?Notes
AUTHORIZEDFull or partial capture
All othersOnly AUTHORIZED payments can be captured

Standard Flow Patterns

FlowState Path
Card — SaleINITIATEDPROCESSINGCOMPLETED
Card — Pre-Auth + CaptureINITIATEDPROCESSINGAUTHORIZEDCAPTURE_INITIALIZEDCOMPLETED
Card — Pre-Auth + CancelINITIATEDPROCESSINGAUTHORIZEDCANCEL_INITIALIZEDCANCELLED
Card — 3DSINITIATEDPROCESSINGAUTH_REQUIREDCONFIRMATION_INITIALIZEDCOMPLETED
Bank Account (ACH)INITIATEDPROCESSINGACCEPTEDCOMPLETED
Pay-and-SaveINITIATEDPROCESSINGPROCESSING_DEDUP_CHECKPROCESSINGCOMPLETED
Split-Tender (both succeed)INITIATEDPROCESSINGCOMPLETED (both allocations)
Split-Tender (one fails)INITIATEDPROCESSING → allocation[0]=COMPLETED, allocation[1]=FAILED → rollback → allocation[0]=ROLLED_BACK → payment=FAILED