API keys and your first API payment
Create a key and accept a payment with one API call.
Updated
- Open Developers → API keys and create a key. Keys starting
sk_test_use the sandbox;sk_live_keys create real payments. Keep keys on your server — never in apps or browsers — and optionally limit them to your server's IP addresses. - Create a payment:
curl -X POST https://shubhgateway.com/api/v1/payments \
-H "Authorization: Bearer $SHUBHGATEWAY_KEY" \
-H "Idempotency-Key: order-10001-attempt-1" \
-H "Content-Type: application/json" \
-d '{ "client_txn_id": "ORDER-10001", "amount": 500, "currency": "INR",
"customer": { "name": "Rahul" }, "description": "Order payment" }'
- Show the returned
qr(or redirect topayment_url, the hosted payment page). - Wait for the webhook — or poll
GET /api/v1/payments/{payment_id}— until the status isSUCCESS. Returning to your app is never proof of payment.
Full reference: API documentation.