Developer Documentation
PayEurasia API Documentation
Build wallet, UPI and bank payouts across Bangladesh, India, Pakistan and Nepal with a single REST API. All endpoints return JSON and use standard HTTP status codes.
Base URL
All requests are made over HTTPS to the regional gateway.
Production
https://api.payeurasia.com/v1Sandbox
https://sandbox.payeurasia.com/v1Authentication
The PayEurasia API uses HMAC-signed bearer tokens. Every request must include an Authorization header and a request signature.
- Create an API key pair in the developer dashboard — you receive a
key_idandsecret. - Generate a request signature:
HMAC_SHA256(secret, timestamp + "." + raw_body). - Send
Authorization: Bearer <key_id>,X-PE-Timestamp, andX-PE-Signatureheaders. - Rotate keys every 90 days. Sandbox keys never expire but cannot move real funds.
bash
curl https://api.payeurasia.com/v1/payments \
-H "Authorization: Bearer pe_live_8fH3..." \
-H "X-PE-Timestamp: 1718900000" \
-H "X-PE-Signature: 9a1c4e8b2f..." \
-H "Content-Type: application/json" \
-d '{
"amount": 250000,
"currency": "BDT",
"method": "bkash",
"customer": { "msisdn": "+8801XXXXXXXXX" },
"reference": "order_18A2",
"callback_url": "https://example.com/cb"
}'Core Endpoints
POST
/v1/paymentsCreate a payment intentGET
/v1/payments/:idRetrieve a paymentPOST
/v1/payments/:id/captureCapture an authorized paymentPOST
/v1/refundsRefund a captured paymentPOST
/v1/payoutsSend a payout to a wallet or bank accountGET
/v1/balancesList balances per currencyGET
/v1/eventsList recent API and webhook eventsExample: create a UPI payment
http
POST /v1/payments HTTP/1.1
Host: api.payeurasia.com
Authorization: Bearer pe_live_8fH3...
Content-Type: application/json
{
"amount": 49900,
"currency": "INR",
"method": "upi",
"customer": { "vpa": "user@okhdfcbank" },
"reference": "INV-2026-0042",
"callback_url": "https://merchant.example.com/webhooks/pe"
}Example response
json
{
"id": "pay_01HZX9K8M4R",
"object": "payment",
"status": "pending",
"amount": 49900,
"currency": "INR",
"method": "upi",
"reference": "INV-2026-0042",
"created_at": "2026-06-20T10:14:22Z",
"next_action": {
"type": "collect_request_sent",
"expires_at": "2026-06-20T10:19:22Z"
}
}Webhooks
Register an HTTPS endpoint and PayEurasia will POST a JSON event for every state change. Events are retried with exponential backoff for up to 24 hours until your endpoint returns a 2xx.
Event types
payment.created
payment.succeeded
payment.failed
payment.refunded
payout.completed
payout.failed
dispute.opened
Example payload
json
{
"id": "evt_01HZX9P2QN",
"type": "payment.succeeded",
"created_at": "2026-06-20T10:15:01Z",
"data": {
"id": "pay_01HZX9K8M4R",
"amount": 49900,
"currency": "INR",
"method": "upi",
"reference": "INV-2026-0042",
"status": "succeeded"
}
}Verifying signatures
Every webhook includes an X-PE-Signature header. Recompute the HMAC and use a constant-time comparison before trusting the payload.
javascript
import { createHmac, timingSafeEqual } from "crypto";
export function verifyWebhook(rawBody, signature, secret) {
const expected = createHmac("sha256", secret).update(rawBody).digest("hex");
const a = Buffer.from(signature, "hex");
const b = Buffer.from(expected, "hex");
return a.length === b.length && timingSafeEqual(a, b);
}Errors
PayEurasia uses conventional HTTP status codes.
200Successful request.400Invalid parameters or signature.401Missing or invalid authentication.404Resource does not exist.409Idempotency conflict.429Rate limited — retry with backoff.5xxTransient gateway error — safe to retry.