iiPayडेवलपर पोर्टल
उदाहरण OpenAPI सहायता
Docs/पेमेंट बनाएं
API संदर्भ

पेमेंट बनाएं

INR पेमेंट ऑर्डर बनाकर hosted checkout URL पाएं।

OpenAPI डाउनलोड करें ↗

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.

FieldTypeRules
merchant_order_idstringRequired, max 128, ASCII letters/numbers, dot, underscore, and hyphen.
amountdecimal stringRequired, 1–16 integer digits and up to 2 decimals. Stored as paise.
currencystringRequired and must be INR.
providerstring|nullOptional; paytm (default) or google_pay_legacy for Google Pay (GPay).
environmentstring|nullOptional; live (default) or sandbox when Sandbox Mode is enabled for the merchant. Sandbox orders are non-payable test orders.
descriptionstring|nullOptional, max 255.
customer_referencestring|nullOptional, max 191.
return_urlURL|nullOptional HTTPS URL, max 2048.
expires_ininteger|nullOptional seconds, minimum 60 and maximum 86400.
Idempotency-KeyheaderRequired, 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.