Quick start
To accept a payment, follow these steps:
- Log in to your AniUPI merchant dashboard.
- Open Developers and copy your API token.
- Send a server-to-server POST request to Create Order API.
- Read
result.payment_urlfrom the successful response and redirect your customer to it. - After payment, verify the order using Check Order Status API. Do not trust only the customer's browser redirect.
The API examples below use sample values. Replace them with your own order/customer values and your actual token.
Authentication & request format
POST Send parameters using application/x-www-form-urlencoded.
Use the user_token generated in your AniUPI dashboard. The token below is randomly generated sample text, not a working credential.
1. Create Order API
Create a new payment order. Each order_id should be unique for your merchant account.
Order timeout: 30 minutes. According to the supplied API documentation, an unpaid order is automatically marked failed after 30 minutes.
Request parameters
| Parameter | Required | Description |
|---|---|---|
customer_mobile | Yes | Customer's mobile number. |
user_token | Yes | Your private AniUPI API token. |
amount | Yes | Payment amount, for example 1. |
order_id | Yes | Your unique order/reference ID. |
redirect_url | Yes | URL where the customer returns after the payment flow. |
remark1 | No | Optional reference/note. |
remark2 | No | Optional second reference/note. |
customer_mobile=9876543210&user_token=7f3a91c8e2b64d05a9f17c3e8b42d610&amount=1&order_id=ORD202611100001&redirect_url=https%3A%2F%2Fexample.com%2Fpayment-return&remark1=Website+Order&remark2=Invoice+1001
Create Order API responses
Success response
{
"status": true,
"message": "Order Created Successfully",
"result": {
"orderId": "1234561705047510",
"payment_url": "https://aniupi.in/payment/pay.php?data=EXAMPLE_TOKEN"
}
}
When status is true, send the customer to result.payment_url.
Failed response
{
"status": false,
"message": "Order_id Already Exist"
}
2. Check Order Status API
Check the latest payment status from your server. Use the same merchant token and order ID that you used when creating the order.
Request parameters
| Parameter | Required | Description |
|---|---|---|
user_token | Yes | Your private AniUPI API token. |
order_id | Yes | The order ID generated by your system. |
user_token=7f3a91c8e2b64d05a9f17c3e8b42d610&order_id=ORD202611100001
Check Order Status API responses
Success / completed response
{
"status": "COMPLETED",
"message": "Transaction Successfully",
"result": {
"txnStatus": "COMPLETED",
"resultInfo": "Transaction Success",
"orderId": "ORD202611100001",
"status": "SUCCESS",
"amount": "1",
"date": "2026-11-10 13:22:08",
"utr": "454525454245"
}
}
Failed / error response
{
"status": "ERROR",
"message": "Error Message"
}
A pending/failed status response may vary by API implementation. Treat only the documented final success status as paid; confirm exact status values with your AniUPI dashboard/provider before going live.
PHP cURL example
Run this code on your server, not in the customer's browser. Replace the sample token and order details.
<?php
$apiUrl = "https://aniupi.in/api/create-order";
// Keep the real token in server-side configuration/environment variables.
$userToken = "YOUR_REAL_ANIUPI_API_TOKEN";
$data = [
"customer_mobile" => "9876543210",
"user_token" => $userToken,
"amount" => "1",
"order_id" => "ORD" . date("YmdHis"),
"redirect_url" => "https://example.com/payment-return",
"remark1" => "Website Order",
"remark2" => "Invoice 1001"
];
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
CURLOPT_TIMEOUT => 30
]);
$response = curl_exec($ch);
if ($response === false) {
die("API request failed: " . curl_error($ch));
}
curl_close($ch);
$result = json_decode($response, true);
if (!empty($result["status"]) && !empty($result["result"]["payment_url"])) {
// Redirect customer to AniUPI checkout.
header("Location: " . $result["result"]["payment_url"]);
exit;
}
echo "Order could not be created: " .
htmlspecialchars($result["message"] ?? "Unknown error");
?>
Common errors & integration checklist
- Order ID already exists: generate a new unique
order_idfor every new payment attempt. - Invalid token: copy the current API token from your AniUPI Developers page; do not use the dummy token in this document.
- Invalid amount/mobile: send the values in the format accepted by your merchant account.
- Payment not confirmed: query Check Order Status API from your server before marking an order paid.
- API timeout: do not create duplicate customer orders blindly; check the original order status first.
This guide documents the endpoints and response examples supplied for AniUPI. Confirm any provider-specific status values, webhook behavior, and required fields with the live API before production use.