API & Integration Documentation
Base URL: https://infipay.in/api/v1 · All requests and responses are JSON · Amounts are in rupees as strings ("499.00").
Payment Lifecycle
- Your server or plugin calls Create payment with the order amount and your unique order ID.
- Redirect the customer to
payment_url(hosted checkout with dynamic QR and 1-tap UPI app buttons). - When payment is confirmed in your bank account, Infi Pay sends an HMAC-signed webhook and redirects the customer to your
redirect_url. - Always rely on the signed webhook (or a Get payment status call) to mark orders fulfilled.
Authentication
Generate an API key in Dashboard → API & Webhooks. Send it on every request:
Authorization: Bearer ip_live_xxxxxxxxxxxxxxxx
If your server strips the Authorization header you can send X-Api-Key: ip_live_… instead. Keep the key secret — use it only from your server, never in browser JavaScript.
Create payment
POST /payments
| Field | Type | Description | |
|---|---|---|---|
amount | string | required | Rupees, ₹1 – ₹1,00,000.00, e.g. "499.00" |
order_id | string | recommended | Your unique order reference (max 64). Repeating the same order_id + amount returns the same payment (safe retries). |
description | string | optional | Shown to the customer and in the UPI note. |
customer | object | optional | { "name", "phone", "email" } |
redirect_url | string | optional | Where to send the customer after payment. |
metadata | object | optional | Any JSON (max 4 KB), returned in webhooks. |
expires_in_minutes | int | optional | 2 – 60, default 10. |
curl -X POST https://infipay.in/api/v1/payments \
-H "Authorization: Bearer ip_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"amount": "499.00",
"order_id": "ORD-1001",
"description": "Premium Subscription",
"customer": { "name": "Ravi", "phone": "9876543210" },
"redirect_url": "https://yourshop.com/thank-you"
}'
Response 201:
{
"ok": true,
"existing": false,
"payment": {
"id": "pay_3f9c1a7d2b6e4f10",
"order_id": "ORD-1001",
"status": "CREATED",
"amount": "499.00",
"payable_amount": "499.00",
"currency": "INR",
"payment_url": "https://infipay.in/pay/pay_3f9c1a7d2b6e4f10",
"upi_intent": "upi://pay?pa=paytm.s3h81o7@pty&pn=...&am=499.00&cu=INR",
"expires_at": "2026-11-25T14:10:00+05:30"
}
}
Get payment
GET /payments/{id} — returns { "ok": true, "payment": { ... } }.
Status values: CREATED (waiting), PAID, EXPIRED, CANCELLED.
List payments
GET /payments?status=PAID&limit=20&order_id=ORD-1001&before=pay_xxx
Cancel payment
POST /payments/{id}/cancel — only for CREATED payments.
Payment links
POST /payment-links with { "title": "Invoice Payment", "amount": "999.00", "description": "..." }.
Webhooks
Set your URL in Dashboard → API & Webhooks. Infi Pay dispatches signed events: payment.paid, payment.expired, payment.cancelled.
POST https://yourshop.com/webhooks/infipay
X-InfiPay-Event: payment.paid
X-InfiPay-Timestamp: 1764063000
X-InfiPay-Signature: sha256=5d41402abc4b2a76b9719d911017c592...
{ "id": "evt_...", "event": "payment.paid", "created_at": "...", "data": { ...payment... } }
Verify signature: compute HMAC_SHA256(timestamp + "." + raw_body, webhook_secret) and compare with X-InfiPay-Signature.
Redirect after payment
When the customer completes the payment, they are redirected to redirect_url?payment_id=pay_…&order_id=…&status=paid.
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 400 | INVALID_AMOUNT, INVALID_ORDER_ID … | Fix request parameters |
| 401 | UNAUTHORIZED | Missing or incorrect API key |
| 402 | PLAN_LIMIT_REACHED | Monthly plan collection limit reached |
| 404 | NOT_FOUND | Payment ID not found |
| 409 | DUPLICATE_ORDER_ID | Order ID already exists |
| 429 | RATE_LIMITED | Too many requests, slow down |
PHP example
<?php
$ch = curl_init("https://infipay.in/api/v1/payments");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer ip_live_xxx", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"amount" => "499.00",
"order_id" => "ORD-1001",
"redirect_url" => "https://yourshop.com/thank-you",
]),
]);
$res = json_decode(curl_exec($ch), true);
header("Location: " . $res["payment"]["payment_url"]);
WordPress & WooCommerce Integration
Accept zero-commission UPI payments on your WooCommerce store with automated order status updates.
How to Install in 3 Easy Steps
- Download the ready-to-use plugin file: infipay-woocommerce.zip.
- In WordPress Admin, go to Plugins → Add New → Upload Plugin and select the zip file. Click Activate.
- Go to WooCommerce → Settings → Payments → Infi Pay (Direct UPI), paste your API Key and Webhook Secret from your Infi Pay Dashboard, and click Save.
https://your-wordpress-site.com/?wc-api=WC_Gateway_InfiPay