1. Connect an account
Link your merchant UPI account and verify the connection in your dashboard.
Connect a server-side integration, create a checkout and verify your first payment event.
Link your merchant UPI account and verify the connection in your dashboard.
Send your order ID and amount from your server, then share the checkout URL.
ZexiPay matches the payment and sends a signed webhook to your endpoint.
Generate an API key and secret under API Keys. Keep both on the server and use sandbox mode during development.
curl https://zexipay.com/api/create-order \
-H "X-API-Key: $ZEXIPAY_KEY" \
-H "X-API-Secret: $ZEXIPAY_SECRET" \
-H 'Content-Type: application/json' \
-d '{"order_id":"shop-1042","amount":"499.00",
"customer_name":"Sample customer"}'const response = await fetch("https://zexipay.com/api/create-order", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.ZEXIPAY_KEY,
"X-API-Secret": process.env.ZEXIPAY_SECRET
},
body: JSON.stringify({order_id: "shop-1042",
amount: "499.00", customer_name: "Sample customer"})
});
console.log(response.status, await response.json());import os, requests
response = requests.post("https://zexipay.com/api/create-order",
headers={"X-API-Key": os.environ["ZEXIPAY_KEY"],
"X-API-Secret": os.environ["ZEXIPAY_SECRET"]},
json={"order_id": "shop-1042", "amount": "499.00",
"customer_name": "Sample customer"}, timeout=15)
response.raise_for_status()
print(response.json())$ch = curl_init('https://zexipay.com/api/create-order');
curl_setopt_array($ch, [
CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 15, CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: '.getenv('ZEXIPAY_KEY'),
'X-API-Secret: '.getenv('ZEXIPAY_SECRET')],
CURLOPT_POSTFIELDS => json_encode(['order_id' => 'shop-1042',
'amount' => '499.00', 'customer_name' => 'Sample customer'])
]);
echo curl_exec($ch);
curl_close($ch);Use the signing secret configured for the endpoint. Check the timestamp and signature before parsing JSON.
$raw = file_get_contents('php://input');
$stamp = $_SERVER['HTTP_X_ZEXIPAY_TIMESTAMP'] ?? '';
$id = $_SERVER['HTTP_X_ZEXIPAY_EVENT_ID'] ?? '';
$sig = $_SERVER['HTTP_X_ZEXIPAY_SIGNATURE_V2'] ?? '';
$secret = getenv('ZEXIPAY_WEBHOOK_SECRET');
if (!$secret || !$id || !ctype_digit($stamp)
|| abs(time() - (int)$stamp) > 300
|| !hash_equals(hash_hmac('sha256',
$stamp.'.'.$id.'.'.$raw, $secret), $sig)) {
http_response_code(401);
exit;
}
// Persist the event ID and fulfill once in one transaction.
// Acknowledge only after the transaction commits.| Status | Meaning | Next step |
|---|---|---|
| 200 / 201 | Order returned / created | Read data.payment_url |
| 400 / 422 | Invalid input | Correct the request fields |
| 401 / 403 | Access denied | Check server credentials |
| 404 | Order not found | Check order_id |
| 409 | Order conflict | Retry the original payload |
| 429 | Limit reached | Check quota and back off |
| 503 | Service unavailable | Retry with bounded backoff |
Import the OpenAPI specification, select Create Order and set your server credentials in a private environment.
Open specification