Developers

API keys and your first API payment

Create a key and accept a payment with one API call.

Updated

  1. 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.
  2. 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" }'
  1. Show the returned qr (or redirect to payment_url, the hosted payment page).
  2. Wait for the webhook — or poll GET /api/v1/payments/{payment_id} — until the status is SUCCESS. Returning to your app is never proof of payment.

Full reference: API documentation.

Was this helpful?