Authentication
Every API request requires your unique user token.
Store user_token on your server and proxy API requests through your backend in production. Do not expose a live token in public browser JavaScript.
Copy your token from the Settings panel in your UPI Gateway account. Include it in the JSON request body as user_token.
Test the API
Run a live request with your API token directly from this documentation page.
Your token is used in this browser session and is not stored by this page. Use a server-side proxy for production requests. The API must allow CORS requests from this website.
Response
Responses will appear here.
Create an order
Create a new payment order and receive a hosted payment URL.
https://upigateway.dev/api/create-order
Orders automatically transition to FAILURE if they remain pending for more than 30 minutes.
Request body
{
"customer_mobile": "8145344963",
"user_token": "${apiToken}",
"amount": "149",
"order_id": "ORDER_ID_12345",
"redirect_url": "https://yourwebsite.com/callback",
"remark1": "test_remark",
"remark2": "test_remark_2"
}
Success response
{
"status": true,
"message": "Order Created Successfully",
"result": {
"orderId": "ORDER_ID_12345",
"payment_url": "${window.location.origin}/pay/token_id..."
}
}
Error response
{
"status": false,
"message": "Order ID already exists"
}
Check order status
Retrieve the latest transaction status for an existing order.
https://upigateway.dev/api/check-order-status
Request body
{
"user_token": "${apiToken}",
"order_id": "ORDER_ID_12345"
}
Success response
{
"status": true,
"message": "Transaction Successfully",
"result": {
"txnStatus": "COMPLETED",
"orderId": "ORDER_ID_12345",
"status": "SUCCESS",
"amount": "149",
"date": "2024-01-12 13:22:08",
"utr": "412345678901"
}
}
Failed response
{
"status": false,
"message": "Transaction Failed",
"result": {
"txnStatus": "FAILURE",
"orderId": "ORDER_ID_12345",
"status": "FAILURE",
"amount": "149",
"date": "2024-01-12 13:22:08"
}
}
Webhooks & callbacks
Receive transaction updates, then verify every payment server-side.
After checkout, the customer returns to your required redirect_url. The platform also sends an HTTP POST webhook to your configured callback target.
{
"status": "SUCCESS",
"orderId": "UNIQUE_ORDER_ID_12345",
"amount": "149",
"utr": "412345678901",
"date": "2026-07-05 13:22:08",
"remark1": "optional_remark",
"remark2": "optional_remark_2"
}
Never mark an order as paid from the webhook body alone. Call the secure Check Order Status API from your server and validate the order ID, amount, final status, and UTR.
Permanent payment links
Use one reusable URL across websites, invoices, emails, or social media.
Every merchant receives a permanent payment URL. You can accept custom amounts or pre-select a fixed product at checkout.
https://upigateway.dev/store/YOUR_USER_TOKEN
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | number | Optional | Pre-fill payment amount, for example ?amount=500. |
product_id | string | Optional | Pre-select a store product ID for checkout. |
https://upigateway.dev/store/YOUR_USER_TOKEN?amount=500
Error codes & API limits
Handle these responses consistently in your integration.
| HTTP status | Error code / condition | Description & solution |
|---|---|---|
| 200 | SUCCESS | Request executed successfully. |
| 400 | MISSING_FIELDS | Required parameters such as user_token, amount, or order_id are missing from the request body. |
| 401 | INVALID_TOKEN | Token is invalid or expired. Copy the current token from the Settings panel. |
| 429 | RATE_LIMIT_EXCEEDED | Subscription rate limit exceeded. Upgrade your plan or space out requests. |
| 503 | MAINTENANCE_MODE | Platform or target gateway is undergoing scheduled maintenance. |
Integration checklist
A few practical steps for a reliable payment flow.
- 01Generate unique order IDs
Never reuse an order ID. Store it with your internal order record.
- 02Keep API calls server-side
Protect your user token and validate all payment data on your server.
- 03Poll pending orders responsibly
Check status with reasonable intervals and stop after the 30-minute timeout.
- 04Verify the final status
Only mark an order paid after validating the status, amount, order ID, and UTR.