How payments work
The life of a payment, from creation to capture.
A payment moves through a few states. Each change is announced by
webhook, and the payment's status always says where it is.
payer approves
(automatic capture)
CREATED ─────────────────────────────────▶ CAPTURED
│ ▲
│ payer approves │ you capture
│ (manual capture) │
└──────────────▶ AUTHORIZED ───────────────┘
CREATED or AUTHORIZED ──▶ CANCELLED you cancel, or the payer declines
CREATED ──▶ EXPIRED not approved within 15 minutes
AUTHORIZED ──▶ EXPIRED not captured within 7 days| Status | Means |
|---|---|
CREATED | Waiting for the payer to approve it at the checkout_url. |
AUTHORIZED | The payer approved it and the money is held in their wallet, waiting for you to capture it. Manual capture only. |
CAPTURED | The money has moved to your business. Ship the order. |
CANCELLED | You cancelled it, or the payer declined. cancellation_reason says which. Any held money went back to the payer. |
EXPIRED | Nobody finished it in time. Any held money went back to the payer. |
CAPTURED, CANCELLED and EXPIRED are final. A captured payment can still be
refunded, but it stays CAPTURED.
All monetary fields use major-unit decimal strings.
Creating a payment
curl https://api.joingladys.com/api/v1/payments \
-H "Authorization: Bearer access_…" \
-H "Idempotency-Key: order-1042" \
-H "Content-Type: application/json" \
-d '{
"amount": "1500.00",
"description": "Order #1042",
"merchant_reference": "order_1042",
"return_url": "https://shop.example/payment-complete",
"capture_method": "AUTOMATIC",
"metadata": { "order_id": "1042" }
}'Prop
Type
The response is the payment. Send the payer to its checkout_url; see
Hosted checkout.
The payment object
Prop
Type
Times are RFC 3339, in UTC. Optional fields are left out when empty.
Time limits
- Approval: 15 minutes. A payment still
CREATED15 minutes after you made it becomesEXPIRED. Create a new one if the payer comes back later. - Capture: 7 days. A manual-capture payment still
AUTHORIZED7 days after approval becomesEXPIRED, and the held money goes back to the payer.
Reading payments
GET /payments/{reference}returns one payment. Payments made by other apps are404.GET /paymentslists your app's payments, newest first, with filters onstatus,environment,capture_methodandmerchant_reference. See Pagination.