Concepts

Session lifecycle

Handle session statuses, phases, and checkout method locking.

A payment session moves through lifecycle statuses and UI phases until it reaches a terminal outcome. Understanding both layers helps you build reliable checkout UX and webhook handlers.

Session statuses

CreatedAwaiting PaymentCompletedExpiredCancelledFailed
Primary session path
Created

Session opened

Awaiting Payment

Payer attached

Completed

Payment succeeded

Expired

Idle or pay window elapsed

Cancelled

Payment cancelled

Failed

Payment failed

Status definitions

NameTypeDescription
CREATEDactiveSession opened. Checkout is available; payer not yet attached.
AWAITING_PAYMENTactivePayer attached and payment in progress in the Zippy mobile app.
COMPLETEDterminalPayment succeeded. Emits payment_session.completed.
EXPIREDterminalIdle or pay window elapsed without completion. Emits payment_session.expired.
CANCELLEDterminalCustomer cancelled checkout before completion.
FAILEDterminalPayment attempt failed. Customer may retry with a new session.

Phases and timers

Checkout UI also tracks a phase separate from lifecycle status:

IdlePaying
  • Idle — customer is choosing how to pay (QR, manual Zippy ID, or Pay with Zippy on phone). Session status is typically Created.
  • Paying — customer confirmed in the Zippy mobile app. Session status moves to Awaiting Payment and a pay window timer starts.

Three time boundaries

Timer fields on the session

NameTypeDescription
createdAtISO-8601When the session was opened.
expiresAtISO-8601Idle expiry while phase is IDLE. Customer must start payment before this instant.
payExpiresAtISO-8601Pay window expiry while phase is PAYING. Set when the customer starts payment in the app.
absoluteExpiresAtISO-8601Hard cap on total session lifetime regardless of phase.

Checkout methods

Customers can pay via QR code scan, manual Zippy ID entry, or — on phone with SDK 1.1.x+ — Pay with Zippy to open the Zippy Pay app. The chosen method is locked when the customer commits to that path.

Checkout method locking

NameTypeDescription
QRmethodCustomer scans the payment QR in the Zippy mobile app. Locked when QR flow starts.
ManualmethodCustomer enters a Zippy ID in checkout. Locked when payment starts.
Pay with Zippyphone onlyCustomer opens the Zippy Pay app from checkout. Default on phone in SDK 1.2.0+.

Transitions

Known transitions

NameTypeDescription
Create→ CREATEDPOST /api/v1/payment-sessions returns CREATED + clientToken.
Start paymentCREATED → AWAITING_PAYMENTCustomer confirms in mobile app. Emits payment_session.payment_started.
Success→ COMPLETEDPayment completed. Emits payment_session.completed and transaction events.
Idle timeout→ EXPIREDexpiresAt reached while still IDLE.
Pay timeout→ EXPIREDpayExpiresAt reached while PAYING.
Absolute cap→ EXPIREDabsoluteExpiresAt reached regardless of phase.
Cancel / fail→ CANCELLED | FAILEDCustomer aborts or payment attempt fails.

Terminal states

Once a session is Completed, Expired, Cancelled, or Failed, it cannot return to an active checkout state. Create a new session (with a fresh Idempotency-Key) for another payment attempt.

Webhook event catalog and payload fields are documented under Webhook events. Checkout SDK polling behavior is covered in Checkout flow and screens.