Skip to content

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.

  1. 01

    Create a payment

    Your server sends POST /v1/payments with the amount, the currency, your order reference and a return URL. The answer includes a checkout_url.

  2. 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.

  3. 03

    The shopper comes back

    When the payment is done, the browser returns to your return_url with payment_id and status added to the address.

  4. 04

    Confirm it on your server

    Before you ship the order, check the payment with GET /v1/payments/{id} or wait for the signed payment.captured webhook.

The first call

Create a payment.

The same request in cURL and six languages. Pick yours and every sample on these pages follows.

POST /v1/payments
# 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.

API basics
TopicHow it works
Base URLhttps://api.zoppay.in. Test and live keys use the same address.
AuthenticationA secret key in the header: Authorization: Bearer sk_test_…. Keys start with sk_test_ or sk_live_.
RequestsJSON bodies with Content-Type: application/json. Without that header the body is ignored.
ResponsesResults are wrapped in {"data": …}. A create answers 201 Created.
Errors{"error": {"message": "…"}} with an HTTP status code.
AmountsWhole numbers in the currency’s smallest unit: 49900 is ₹499.00.
RetriesAn optional Idempotency-Key header on creating payments and refunds, kept for 24 hours.
Rate limits300 requests a minute per key, and 1,200 a minute per IP address. Over that: 429 with Retry-After: 60.
WebhooksFour events: payment.captured, payment.failed, refund.succeeded and refund.failed, signed with HMAC-SHA256.
SDKsNone. Every sample uses the language’s own HTTP client.

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.