Payment model
Identifiers, amounts, currencies, statuses and the response envelope shared by every checkoutOs endpoint.
Identifiers
checkoutOs issues its own IDs for the API surface.
| Prefix | Resource | Example |
|---|---|---|
chk_ | Payment | chk_a1b2c3d4e5f6a7b8 |
ref_ | Refund | ref_9f8e7d6c5b4a3210 |
Gateway identifiers (order_XXXX, pay_XXXX) are stored internally and used for upstream
calls. They are not primary keys in your integration — use the chk_ payment ID for every
status poll and refund call, and the ref_ ID for refund status.
Two gateway IDs are tracked separately, and they must not be collapsed into one field:
| Field | Set when | Used for |
|---|---|---|
gatewayOrderId | Payment creation | Polling order status before a webhook arrives |
gatewayPaymentId | A webhook arrives | Initiating refunds |
The relay currently forwards gateway IDs
The normalized webhook relay is { paymentId, ...event }. Because the event spread is
pre-existing, gatewayPaymentId, gatewayOrderId and the raw gateway payload are forwarded
to WEBHOOK_RELAY_URL as well. Treat them as informational; keep paymentId as your key.
Amounts
All amounts are integers in paise. 1 INR = 100 paise.
| Rupees | API value |
|---|---|
| ₹1.00 | 100 |
| ₹500.00 | 50000 |
| ₹1,250.00 | 125000 |
Only INR is supported in V1.
Payment status
Every gateway's native status strings are normalized by that gateway's GatewayMapper into
one of these values. An unrecognized native status raises GatewayMappingError rather than
being guessed at.
| Status | Meaning |
|---|---|
PENDING | Created, user has not completed the payment |
PROCESSING | Gateway is processing it |
SUCCESS | Payment captured |
FAILED | Terminal failure |
CANCELLED | Abandoned by the user |
EXPIRED | Payment window elapsed |
REFUNDED | Fully refunded |
PARTIALLY_REFUNDED | Partially refunded; further refunds possible |
There is no AUTHORIZED state in V1
V1 is redirect checkout only. A gateway response can reserve an order, but only a verified webhook can report captured money. See Payment lifecycle.
Refund status
| Status | Meaning |
|---|---|
PENDING | Accepted, not yet submitted upstream |
PROCESSING | Gateway is processing it |
SUCCESS | Refunded |
FAILED | Terminal failure |
Response envelope
Every response — success or failure — is wrapped in the same envelope, so a client can narrow
on the success discriminant alone.
{
"success": true,
"data": {
"paymentId": "chk_a1b2c3d4e5f6a7b8",
"status": "PENDING",
"amount": 50000,
"currency": "INR",
"gateway": "razorpay",
"orderId": "order_abc123",
"createdAt": "2026-10-18T09:12:44.000Z",
"updatedAt": "2026-10-18T09:12:44.000Z"
}
}See Error reference for every code and its HTTP status.
Creating a payment
Prop
Type
orderId is deliberately not a UUID — merchants bring their own references, such as invoice
numbers. Reusing one with a different amount or currency is rejected with
ORDER_ID_AMOUNT_MISMATCH or ORDER_ID_CURRENCY_MISMATCH, regardless of the idempotency key.
Redis key layout
The store layer is the only code permitted to touch these.
| Key | Type | Contents |
|---|---|---|
chk:pay:{chk_id} | hash | The stored payment record |
chk:pay:by-order:{orderId} | string | orderId → chk_id, plus the pre-gateway reservation |
chk:gw:{gateway}:{gw_id} | string | Reverse lookup from a gateway ID |
chk:ref:{ref_id} | hash | The stored refund record |
chk:ref:by-pay:{chk_id} | set | All refund IDs for a payment |
chk:idem:{key} | string (JSON) | Idempotency record, 24-hour TTL |