checkoutOs
Core concepts

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.

PrefixResourceExample
chk_Paymentchk_a1b2c3d4e5f6a7b8
ref_Refundref_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:

FieldSet whenUsed for
gatewayOrderIdPayment creationPolling order status before a webhook arrives
gatewayPaymentIdA webhook arrivesInitiating 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.

RupeesAPI value
₹1.00100
₹500.0050000
₹1,250.00125000

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.

StatusMeaning
PENDINGCreated, user has not completed the payment
PROCESSINGGateway is processing it
SUCCESSPayment captured
FAILEDTerminal failure
CANCELLEDAbandoned by the user
EXPIREDPayment window elapsed
REFUNDEDFully refunded
PARTIALLY_REFUNDEDPartially 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

StatusMeaning
PENDINGAccepted, not yet submitted upstream
PROCESSINGGateway is processing it
SUCCESSRefunded
FAILEDTerminal 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.

KeyTypeContents
chk:pay:{chk_id}hashThe stored payment record
chk:pay:by-order:{orderId}stringorderId → chk_id, plus the pre-gateway reservation
chk:gw:{gateway}:{gw_id}stringReverse lookup from a gateway ID
chk:ref:{ref_id}hashThe stored refund record
chk:ref:by-pay:{chk_id}setAll refund IDs for a payment
chk:idem:{key}string (JSON)Idempotency record, 24-hour TTL

On this page