This page explains how a merchant should integrate CGPEY payment APIs (create checkout, redirect user, and verify status).
/api.https://pay.cgpey.com/api/checkout (proxied to the payment service).x-merchant-id — your merchant IDx-api-key — public API key (mode based)x-secret-key — secret key (mode based)POST /api/checkout. Requests from non-whitelisted IPs return 403 with IP_NOT_WHITELISTED.POST /api/checkout (auth required)checkoutUrlPOST /api/payments/verify or fetch status using GET /api/payments/:paymentId/status (auth required for status endpoint)/api/checkoutorderId (string, must start with ORDER_, e.g. ORDER_10078)amount (number/string) — INR amount (max ₹100,000)redirectUrl (string, optional) — customer redirect URL after paymentmeta (object, optional) — customer metadata: name, email, phonelat, lng (optional) — geo info (if available)curl -X POST "$BASE_URL/api/checkout" \
-H "Content-Type: application/json" \
-H "x-merchant-id: MERCHANT_123" \
-H "x-api-key: YOUR_PUBLIC_KEY" \
-H "x-secret-key: YOUR_SECRET_KEY" \
-d '{
"orderId": "ORDER_10001",
"amount": 199.00,
"redirectUrl": "https://merchant.example.com/payment/return",
"meta": { "name": "Customer", "email": "c@example.com", "phone": "9999999999" }
}'{
"success": true,
"data": {
"paymentId": "pay_1712470000000_abcdef123456",
"checkoutUrl": "https://business.cgpey.com/checkout/pay_1712470000000_abcdef123456",
"expiresAt": "2026-04-07T12:34:56.000Z",
"merchantOrderId": "ORDER_10001",
"amount": "199.00",
"currency": "INR",
"_token": "<checkoutToken>"
}
}paymentId./api/payments/:paymentId/statuscurl -X GET "$BASE_URL/api/payments/pay_1712470000000_abcdef123456/status" \
-H "x-merchant-id: MERCHANT_123" \
-H "x-api-key: YOUR_PUBLIC_KEY" \
-H "x-secret-key: YOUR_SECRET_KEY"404 if payment does not exist for that merchant.