Developers
One API call creates a payment. The checkout takes it from there.
JSON over HTTPS with a secret key. Create a payment on your server, send the shopper to the checkout link, then confirm the result. Test keys use a built-in test gateway, so you can build before you connect a real one.
How it works
Four steps. Two of them are API calls.
01
Create a payment
Your server sends
POST /v1/paymentswith the amount, the currency, your order reference and a return URL. The answer includes acheckout_url.02
Send the shopper to the checkout
Redirect the shopper’s browser to
checkout_url. ZopPay passes them to the secure page of your active gateway. In test mode they see a test page with a Pay button.03
The shopper comes back
When the payment is done, the browser returns to your
return_urlwithpayment_idandstatusadded to the address.04
Confirm it on your server
Before you ship the order, check the payment with
GET /v1/payments/{id}or wait for the signedpayment.capturedwebhook.
The first call
Create a payment.
The same request in cURL and six languages. Pick yours and every sample on these pages follows.
# Create a payment. Needs: export ZOPPAY_SECRET_KEY=sk_test_… curl https://api.zoppay.in/v1/payments \ -H "Authorization: Bearer $ZOPPAY_SECRET_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order_1042" \ -d '{ "amount": 49900, "currency": "INR", "reference": "order_1042", "return_url": "https://shop.example.com/orders/1042/complete", "customer": { "name": "Asha Rao", "email": "asha@example.com", "phone": "+919876543210" } }' # The answer is 201 Created, with the payment under "data". # Send the shopper's browser to data.checkout_url.
At a glance
The basics. On one page.
| Topic | How it works |
|---|---|
| Base URL | https://api.zoppay.in. Test and live keys use the same address. |
| Authentication | A secret key in the header: Authorization: Bearer sk_test_…. Keys start with sk_test_ or sk_live_. |
| Requests | JSON bodies with Content-Type: application/json. Without that header the body is ignored. |
| Responses | Results are wrapped in {"data": …}. A create answers 201 Created. |
| Errors | {"error": {"message": "…"}} with an HTTP status code. |
| Amounts | Whole numbers in the currency’s smallest unit: 49900 is ₹499.00. |
| Retries | An optional Idempotency-Key header on creating payments and refunds, kept for 24 hours. |
| Rate limits | 300 requests a minute per key, and 1,200 a minute per IP address. Over that: 429 with Retry-After: 60. |
| Webhooks | Four events: payment.captured, payment.failed, refund.succeeded and refund.failed, signed with HMAC-SHA256. |
| SDKs | None. Every sample uses the language’s own HTTP client. |
Docs
Where to go next.
- QuickstartYour first test payment, step by step.
- API referenceEvery endpoint, field, status code and error.
- WebhooksEvents, signatures, retries and a signature tester.
- TestingTest mode, the test gateway and going live.
- Languages and samplesNo SDKs. Complete samples in cURL and six languages.
- GatewaysThe gateways you can connect and what each one takes.
Start in test mode.
Sign up, create a test key under API keys and make your first test payment. Connect a live gateway when you are ready.