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 (auth required)checkoutUrlPOST /api/payments/verify or fetch status using GET /api/payments/:paymentId/status (auth required for status endpoint)/api/checkoutorderId (string, max 100 chars, [a-zA-Z0-9_-])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./api/payments/verifycurl -X POST "$BASE_URL/api/payments/verify" \
-H "Content-Type: application/json" \
-d '{
"gateway": "PHONEPE",
"orderId": "ORDER_10001"
}'success: false and an error code.{
"success": false,
"error": "INVALID_ORDER_ID",
"message": "Order ID must be alphanumeric (a-z, A-Z, 0-9, _, -) with max 100 characters"
}