API reference
Create a payment
Create an INR payment order and receive its hosted checkout URL.
POST /api/v1/payments
Creates a pending payment order, reserves the required subscription volume, generates a unique checkout reference, and returns a hosted checkout URL. If a configured provider exists, a background verification job is scheduled.
| Field | Type | Rules |
|---|---|---|
merchant_order_id | string | Required, max 128, ASCII letters/numbers, dot, underscore, and hyphen. |
amount | decimal string | Required, 1–16 integer digits and up to 2 decimals. Stored as paise. |
currency | string | Required and must be INR. |
provider | string|null | Optional; paytm (default) or google_pay_legacy for Google Pay (GPay). |
environment | string|null | Optional; live (default) or sandbox when Sandbox Mode is enabled for the merchant. Sandbox orders are non-payable test orders. |
description | string|null | Optional, max 255. |
customer_reference | string|null | Optional, max 191. |
return_url | URL|null | Optional HTTPS URL, max 2048. |
expires_in | integer|null | Optional seconds, minimum 60 and maximum 86400. |
Idempotency-Key | header | Required, 8–128 characters. Reuse with the same request to retrieve the original order. |
Response
A new order returns HTTP 201. Replaying the same idempotency key and request returns HTTP 200 with the existing payment. The payload uses the common success envelope:
JSON · 201
{
"success": true,
"message": "Payment created.",
"data": {
"id": "pay_REPLACE_UUID",
"merchant_order_id": "order_2026_0001",
"status": "PENDING",
"environment": "live",
"is_test": false,
"amount": "499.00",
"currency": "INR",
"description": "Example order",
"expires_at": "2026-10-08T12:15:00.000000Z",
"created_at": "2026-10-08T12:00:00.000000Z",
"processed_at": null,
"transaction": null,
"checkout_url": "https://i-pay.im/checkout/REPLACE_TOKEN",
"upi_transaction_reference": "IPYREPLACE"
},
"request_id": null
}
Creation errors
Common responses are 401 for invalid credentials, 402 or 409 for unavailable subscription capacity, 409 idempotency_conflict for changed details, 409 payment_reference_conflict for a reused merchant order ID, and 422 validation_error or invalid_amount.