PAYIN GATEWAY
Create Deposit Order
Create programmatically matched INR deposit orders. Once created, redirect your customer to the returned checkout URL where they can pay local Indian vendors via bank coordinates or UPI.
Authentication Header Required
Pass your merchant secret API key in the custom request header: x-api-key: YOUR_MERCHANT_API_KEY.
Request Sample
BASH
curl -X POST https://checkout.onnxpay.com/api/create-order \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_MERCHANT_API_KEY" \
-d '{
"amount_inr": 1000,
"currency": "INR",
"order_id": "MERC_TEST_4821",
"customer_details": {
"name": "John Doe",
"merchant_user_id": "USR_109288"
},
"callback_url": "https://yourdomain.com/"
}'Request Parameters
| Field | Type | Requirement | Description |
|---|---|---|---|
| amount_inr | number | Required | The exact amount of INR fiat requested. Must be at least ₹100. |
| currency | string | Optional | The fiat currency denomination. Defaults to `"INR"`. |
| order_id | string | Required | Your custom internal order ID to track payments and callbacks. |
| customer_details | object | Required | Object containing customer info. Fields inside:name: string (Required)merchant_user_id: string (Optional) |
| callback_url | string | Required | The endpoint URL we trigger upon payment completion (status `'completed'`). Example: `https://yourdomain.com/` |
Response Payload
A successful response will return a `200 OK` status and the following JSON structure:
JSON
{
"success": true,
"payment_id": "pay_a75d6c7382fa4501",
"checkout_url": "https://checkout.onnxpay.com/pay/pay_a75d6c7382fa4501",
"amount_usdt": 11.52,
"exchange_rate": 86.8,
"expires_at": "2026-07-21T16:15:00.000Z"
}Payment Settlement & Customer Return Redirect
When the deposit order is settled (vendor approves payment proof), the checkout page automatically redirects the customer back to your merchant site URL (callback_url) while OnnXpay dispatches a backend POST webhook callback to your server:
JSON
{
"payment_id": "pay_a75d6c7382fa4501",
"order_id": "MERC_TEST_4821",
"status": "completed",
"amount_usdt": 11.52,
"amount_inr": 1000,
"tx_hash": "0x7d025b...3a9f02",
"payer_name": "John Doe",
"utr_number": "220912882711",
"vendor_id": "VND2026001",
"exchange_rate": 86.8,
"timestamp": 1784651100000
}