Skip to the page

API reference

The merchant API, version 2.0.0: 20 operations on one gateway account. This page is generated from the API's own contract, so it cannot fall behind it.

https://api.bhimpay.online/api/v2

The file is the whole contract in OpenAPI 3.1. Any generator that reads OpenAPI can make a client from it in your language, and every sample below is plain HTTP with nothing to install.

A key belongs to one gateway account, so no path names an account or a provider. Every request carriesAuthorization: Bearer aqk_…, every POST carries an Idempotency-Key, and every answer carries AquaPay-Request-Id. Start here covers what the operations have in common; the errors page covers every code they can answer with.

OperationWhat it doesScope
GET /accountThe gateway account, its capabilities, limits and fees, and the calling key.read
GET /balanceWhat the account can pay out now, and what payouts in flight hold.read
GET /ledgerThe balance journal, newest first.read
POST /payinsOpen a pay-in and get what to show the payer.payins:write
GET /payinsPay-ins, newest first. Filter by status or by your reference.read
GET /payins/{payinId}One pay-in, as AquaPay has it recorded.read
POST /payins/{payinId}/refreshAsk the provider about the pay-in now, and apply what it says.read
POST /payins/{payinId}/bind-utrGive the provider the UTR the payer reports, so it can match the payment.payins:write
GET /payouts/quoteThe fee and total debit for a payout amount, and whether the balance covers it now.read
POST /payoutsSend money to a bank account, a UPI VPA or a UPay wallet.payouts:write and the payment password
GET /payoutsPayouts, newest first. Filter by status or by your reference.read
GET /payouts/{payoutId}One payout, as AquaPay has it recorded.read
POST /payouts/{payoutId}/refreshAsk the provider about the payout now, and apply what it says.read
GET /payout-attempts/{attemptKey}What became of a payout attempt key.read
POST /payout-attempts/{attemptKey}/closeRetire an attempt key that created nothing, so it never can.payouts:write
GET /eventsThe account's events, oldest first, for polling.read
GET /webhook-endpointsThe account's webhook endpoints (at most three).read
POST /webhook-endpointsAdd an HTTPS endpoint. The signing secret is in this answer only.webhooks:write and the payment password
DELETE /webhook-endpoints/{endpointId}Stop delivering to an endpoint.webhooks:write and the payment password
POST /webhook-endpoints/{endpointId}/rotate-secretReplace an endpoint's signing secret, with 24 hours of overlap.webhooks:write and the payment password

Account, balance and ledger

The gateway account the key belongs to, its balance and its ledger.

The gateway account, its capabilities, limits and fees, and the calling key.

GET/account

scope read

Everything an integration needs to decide what to offer: whether pay-ins and payouts are enabled, the payout methods, limits and fees in force, whether amounts must be whole, whether UTR binding works, and whether this key must send the payment password. Scope read.

Answers

curl https://api.bhimpay.online/api/v2/account \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/account", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/account",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/account");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/account", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/account"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "id": "ga_3k9d2m7q1x8vb",
  "name": "Example Store · COWPAY",
  "mode": "live",
  "status": "active",
  "provider": "cowpay",
  "currency": "INR",
  "wholeUnitsOnly": true,
  "payins": {
    "enabled": true,
    "limits": {
      "min": "100.00",
      "max": "50000.00"
    },
    "fee": {
      "percent": "2.5",
      "fixed": "0.00"
    },
    "utrBinding": true,
    "payerIpRequired": true
  },
  "payouts": {
    "enabled": true,
    "methods": [
      "bank",
      "upi"
    ],
    "limits": {
      "min": "100.00",
      "max": "25000.00"
    },
    "fee": {
      "percent": "1",
      "fixed": "0.00"
    },
    "paymentPasswordRequired": true
  },
  "key": {
    "id": "kid_p9w3k7e1y5t2r",
    "name": "store-backend",
    "scopes": [
      "read",
      "payins:write",
      "payouts:write",
      "webhooks:write"
    ],
    "ipAllowlist": [
      "13.234.10.21/32"
    ],
    "expiresAt": null
  }
}

What the account can pay out now, and what payouts in flight hold.

GET/balance

scope read

Scope read.

Answers

curl https://api.bhimpay.online/api/v2/balance \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/balance", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/balance",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/balance");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/balance", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/balance"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "currency": "INR",
  "available": "184250.00",
  "held": "15150.00",
  "asOf": "2026-12-03T09:20:00Z"
}

The balance journal, newest first.

GET/ledger

scope read

Every change to the balance, signed. The balance is the sum of the entries. Scope read.

Parameters

  • cursorstringin query

    The nextCursor of the previous page. Opaque.
  • limitintegerin query

    Default 25.

Answers

curl https://api.bhimpay.online/api/v2/ledger \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/ledger", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/ledger",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/ledger");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/ledger", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/ledger"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "items": [
    {
      "id": "entry_m5n1b7v3c9x2z",
      "type": "payout_hold",
      "amount": "-1515.00",
      "balanceAfter": "184250.00",
      "paymentId": "payout_c8n4r2v6y0jd5",
      "note": null,
      "createdAt": "2026-12-03T09:18:41Z"
    },
    {
      "id": "entry_k2j8h4g6f1d3s",
      "type": "fee",
      "amount": "-12.50",
      "balanceAfter": "185765.00",
      "paymentId": "payin_7h2kq9w3m1zt4",
      "note": null,
      "createdAt": "2026-12-03T09:15:07Z"
    },
    {
      "id": "entry_w9e3r7t1y5q2a",
      "type": "payin_credit",
      "amount": "500.00",
      "balanceAfter": "185777.50",
      "paymentId": "payin_7h2kq9w3m1zt4",
      "note": null,
      "createdAt": "2026-12-03T09:15:07Z"
    }
  ],
  "nextCursor": "c1.eyJ0IjoiMjAyNi0xMi0wM1QwOToxNTowN1oiLCJpIjo4ODQxMn0"
}

Pay-ins

Money in from a payer.

Open a pay-in and get what to show the payer.

POST/payins

scope payins:writeIdempotency-Key

AquaPay records the pay-in, then asks the provider for an order. On success the pay-in is pending and nextAction holds the payment page URL and, where the provider gives one, a UPI intent URI. Scope payins:write.

  • amount must lie within payins.limits, and be whole when wholeUnitsOnly is true (PAYME, COWPAY).
  • currency must equal the account’s currency.
  • payer.ip is required when payins.payerIpRequired is true (COWPAY).

A provider refusal (422 provider_refused) or a request that never reached the provider (424 provider_unreachable) leaves the pay-in failed. An unclear provider answer (502 provider_outcome_unknown) leaves it pending with no nextAction; it expires on its own, and opening a new pay-in with a new key is safe because the payer was shown nothing. Each of these bodies carries the pay-in as details.payin.

Parameters

  • Idempotency-Keystringin headerrequired

    Makes a retry safe. On POST /payouts it is also the payout’s permanent attempt key.

Body: CreatePayinRequest

  • amountstring (money)required

    A positive amount with at most two decimals.
  • currencystringrequired

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • referencestringrequired

    Your id for the order. Not unique: a retried order may reuse it.
  • payerobjectrequired

    • idstringrequired

      Your id for the payer. Providers use it for risk checks.
    • ipstring

      The payer’s public IPv4 or IPv6 address. Required when payins.payerIpRequired.
  • returnUrlstring (URL)required

    Where the payment page sends the payer afterwards.

Answers

curl -X POST https://api.bhimpay.online/api/v2/payins \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "500",
    "currency": "INR",
    "reference": "DEP-20261203-0042",
    "payer": {
      "id": "player-88123",
      "ip": "103.21.4.9"
    },
    "returnUrl": "https://store.example/deposit/return"
  }'
const response = await fetch("https://api.bhimpay.online/api/v2/payins", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "amount": "500",
    "currency": "INR",
    "reference": "DEP-20261203-0042",
    "payer": {
      "id": "player-88123",
      "ip": "103.21.4.9"
    },
    "returnUrl": "https://store.example/deposit/return"
  }),
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os
import uuid

import requests

response = requests.post(
    "https://api.bhimpay.online/api/v2/payins",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "amount": "500",
        "currency": "INR",
        "reference": "DEP-20261203-0042",
        "payer": {
            "id": "player-88123",
            "ip": "103.21.4.9",
        },
        "returnUrl": "https://store.example/deposit/return",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payins");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "amount" => "500",
        "currency" => "INR",
        "reference" => "DEP-20261203-0042",
        "payer" => [
            "id" => "player-88123",
            "ip" => "103.21.4.9",
        ],
        "returnUrl" => "https://store.example/deposit/return",
    ]),
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
body := strings.NewReader(`{
  "amount": "500",
  "currency": "INR",
  "reference": "DEP-20261203-0042",
  "payer": {
    "id": "player-88123",
    "ip": "103.21.4.9"
  },
  "returnUrl": "https://store.example/deposit/return"
}`)
req, err := http.NewRequest("POST", "https://api.bhimpay.online/api/v2/payins", body)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
key := make([]byte, 16)
rand.Read(key) // crypto/rand
req.Header.Set("Idempotency-Key", hex.EncodeToString(key))
req.Header.Set("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payins"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
        {
          "amount": "500",
          "currency": "INR",
          "reference": "DEP-20261203-0042",
          "payer": {
            "id": "player-88123",
            "ip": "103.21.4.9"
          },
          "returnUrl": "https://store.example/deposit/return"
        }"""))
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
201, an example
{
  "id": "payin_7h2kq9w3m1zt4",
  "reference": "DEP-20261203-0042",
  "status": "pending",
  "amount": "500.00",
  "paidAmount": null,
  "currency": "INR",
  "fee": "12.50",
  "net": "487.50",
  "utr": null,
  "orderId": "AQD2612030915000042",
  "providerOrderId": "CP88123409",
  "nextAction": {
    "redirectUrl": "https://pay.cowpay.example/c/CP88123409",
    "upiUri": "upi://pay?pa=cowpay.col@ybl&pn=COWPAY&am=500.00&tr=CP88123409&cu=INR"
  },
  "expiresAt": "2026-12-03T11:15:00Z",
  "failure": null,
  "version": 1,
  "createdAt": "2026-12-03T09:15:00Z",
  "updatedAt": "2026-12-03T09:15:00Z"
}

Pay-ins, newest first. Filter by status or by your reference.

GET/payins

scope read

reference finds every pay-in opened with that reference, newest first: this is the lookup by merchant reference. Answers come from AquaPay’s records; use POST /payins/{payinId}/refresh to ask the provider. Scope read.

Parameters

  • cursorstringin query

    The nextCursor of the previous page. Opaque.
  • limitintegerin query

    Default 25.
  • statusstringin query

    pending (waiting for the payer) → succeeded | failed | expired | needs_review. failed and expired can still become succeeded (or needs_review) on the provider’s proof of a late payment. needs_review is resolved by AquaPay staff to succeeded or failed. succeeded is final.
  • referencestringin query

    Your reference, matched exactly.

Answers

curl https://api.bhimpay.online/api/v2/payins \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/payins", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/payins",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payins");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/payins", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payins"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "items": [
    {
      "id": "payin_7h2kq9w3m1zt4",
      "reference": "DEP-20261203-0042",
      "status": "succeeded",
      "amount": "500.00",
      "paidAmount": "500.00",
      "currency": "INR",
      "fee": "12.50",
      "net": "487.50",
      "utr": "416512345678",
      "orderId": "AQD2612030915000042",
      "providerOrderId": "CP88123409",
      "nextAction": null,
      "expiresAt": "2026-12-03T11:15:00Z",
      "failure": null,
      "version": 3,
      "createdAt": "2026-12-03T09:15:00Z",
      "updatedAt": "2026-12-03T09:15:07Z"
    }
  ],
  "nextCursor": null
}

One pay-in, as AquaPay has it recorded.

GET/payins/{payinId}

scope read

Scope read.

Parameters

  • payinIdstringin pathrequired

Answers

curl https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4 \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "id": "payin_7h2kq9w3m1zt4",
  "reference": "DEP-20261203-0042",
  "status": "succeeded",
  "amount": "500.00",
  "paidAmount": "500.00",
  "currency": "INR",
  "fee": "12.50",
  "net": "487.50",
  "utr": "416512345678",
  "orderId": "AQD2612030915000042",
  "providerOrderId": "CP88123409",
  "nextAction": null,
  "expiresAt": "2026-12-03T11:15:00Z",
  "failure": null,
  "version": 3,
  "createdAt": "2026-12-03T09:15:00Z",
  "updatedAt": "2026-12-03T09:15:07Z"
}

Ask the provider about the pay-in now, and apply what it says.

POST/payins/{payinId}/refresh

scope readIdempotency-Key

Applies the provider’s answer under the same rules as a provider callback, and sends the webhook if the status changed. A pay-in checked with the provider in the last 10 seconds is answered from the record without a new provider call. Works on expired pay-ins too, which is how a late payment is found. Scope read.

A provider that cannot be asked answers 424 provider_unreachable with retry: same_key; nothing changed.

Parameters

  • payinIdstringin pathrequired

  • Idempotency-Keystringin headerrequired

    Makes a retry safe. On POST /payouts it is also the payout’s permanent attempt key.

Answers

curl -X POST https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/refresh \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
const response = await fetch("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/refresh", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os
import uuid

import requests

response = requests.post(
    "https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/refresh",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/refresh");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("POST", "https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/refresh", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
key := make([]byte, 16)
rand.Read(key) // crypto/rand
req.Header.Set("Idempotency-Key", hex.EncodeToString(key))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/refresh"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "id": "payin_7h2kq9w3m1zt4",
  "reference": "DEP-20261203-0042",
  "status": "succeeded",
  "amount": "500.00",
  "paidAmount": "500.00",
  "currency": "INR",
  "fee": "12.50",
  "net": "487.50",
  "utr": "416512345678",
  "orderId": "AQD2612030915000042",
  "providerOrderId": "CP88123409",
  "nextAction": null,
  "expiresAt": "2026-12-03T11:15:00Z",
  "failure": null,
  "version": 3,
  "createdAt": "2026-12-03T09:15:00Z",
  "updatedAt": "2026-12-03T09:15:07Z"
}

Give the provider the UTR the payer reports, so it can match the payment.

POST/payins/{payinId}/bind-utr

scope payins:writeIdempotency-Key

For a pending, failed or expired pay-in on a provider with payins.utrBinding (PAYME, COWPAY). AquaPay sends the UTR to the provider, then refreshes the pay-in. A UTR is bound to at most one pay-in of the account, ever (409 utr_in_use). A provider that refuses the UTR answers 422 provider_refused with the pay-in unchanged in details.payin. Scope payins:write.

Parameters

  • payinIdstringin pathrequired

  • Idempotency-Keystringin headerrequired

    Makes a retry safe. On POST /payouts it is also the payout’s permanent attempt key.

Body: BindUtrRequest

  • utrstringrequired

    The 12-digit UTR from the payer’s bank or UPI app.

Answers

curl -X POST https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/bind-utr \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "utr": "416512345678"
  }'
const response = await fetch("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/bind-utr", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "utr": "416512345678"
  }),
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os
import uuid

import requests

response = requests.post(
    "https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/bind-utr",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "utr": "416512345678",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/bind-utr");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "utr" => "416512345678",
    ]),
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
body := strings.NewReader(`{
  "utr": "416512345678"
}`)
req, err := http.NewRequest("POST", "https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/bind-utr", body)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
key := make([]byte, 16)
rand.Read(key) // crypto/rand
req.Header.Set("Idempotency-Key", hex.EncodeToString(key))
req.Header.Set("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payins/payin_7h2kq9w3m1zt4/bind-utr"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
        {
          "utr": "416512345678"
        }"""))
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "id": "payin_7h2kq9w3m1zt4",
  "reference": "DEP-20261203-0042",
  "status": "succeeded",
  "amount": "500.00",
  "paidAmount": "500.00",
  "currency": "INR",
  "fee": "12.50",
  "net": "487.50",
  "utr": "416512345678",
  "orderId": "AQD2612030915000042",
  "providerOrderId": "CP88123409",
  "nextAction": null,
  "expiresAt": "2026-12-03T11:15:00Z",
  "failure": null,
  "version": 3,
  "createdAt": "2026-12-03T09:15:00Z",
  "updatedAt": "2026-12-03T09:15:07Z"
}

Payouts

Money out to a beneficiary.

The fee and total debit for a payout amount, and whether the balance covers it now.

GET/payouts/quote

scope read

Pure arithmetic on the account’s fees and balance; nothing is reserved. total is what creation would debit (amount + fee). An amount outside payouts.limits or not whole where it must be is 400 validation_failed. Scope read.

Parameters

  • amountstring (money)in queryrequired

    A positive amount with at most two decimals.

Answers

curl "https://api.bhimpay.online/api/v2/payouts/quote?amount=1500" \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/payouts/quote?amount=1500", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/payouts/quote?amount=1500",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payouts/quote?amount=1500");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/payouts/quote?amount=1500", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payouts/quote?amount=1500"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "amount": "1500.00",
  "fee": "15.00",
  "total": "1515.00",
  "currency": "INR",
  "sufficientBalance": true
}

Send money to a bank account, a UPI VPA or a UPay wallet.

POST/payouts

scope payouts:writepayment passwordIdempotency-Key

Money safety, in order:

  1. Under the account’s lock, AquaPay checks the balance, the reference and the attempt key, and writes the payout processing, holding total, before anything is sent.
  2. Then it calls the provider once. The Idempotency-Key is the payout’s attempt key: it reaches a provider at most once, ever.
  3. A definite refusal fails the payout and releases the hold: 422 provider_refused, or 424 provider_unreachable when the request provably never left. Send a corrected payout with a new key.
  4. Anything unclear (a timeout, a 5xx, an unreadable answer) keeps the payout processing with the amount held: 502 provider_outcome_unknown, retry: refresh. Never create it again; refresh it or wait for its webhook.

Each of these bodies carries the payout as details.payout. Needs scope payouts:write and the payment password.

beneficiary.type must be one of payouts.methods. reference must not be held by another payout that is still processing, succeeded or needs_review (409 duplicate_reference); a failed payout’s reference may be reused.

Parameters

  • Idempotency-Keystringin headerrequired

    Makes a retry safe. On POST /payouts it is also the payout’s permanent attempt key.
  • AquaPay-Payment-Passwordstringin header

    The gateway account’s payment password, typed by the person approving the action. Required on payout creation and on webhook endpoint changes; checked whenever it is sent. Never logged or stored by AquaPay.

Body: CreatePayoutRequest

  • amountstring (money)required

    What the beneficiary receives. The fee is debited on top.
  • currencystringrequired

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • referencestringrequired

    Your id for the withdrawal.
  • beneficiaryBankBeneficiary, UpiBeneficiary or UpayWalletBeneficiaryrequired

    Where a payout goes. type must be one of the account’s payouts.methods.
  • narrationstring

    The remark sent to the provider. Defaults to “Payout ”.

Answers

curl -X POST https://api.bhimpay.online/api/v2/payouts \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "AquaPay-Payment-Password: $AQUAPAY_PAYMENT_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "1500",
    "currency": "INR",
    "reference": "WD-20261203-7781",
    "beneficiary": {
      "type": "bank",
      "name": "Ravi Kumar",
      "accountNumber": "50100123456789",
      "ifsc": "HDFC0001234"
    },
    "narration": "Payout from Example Store"
  }'
const response = await fetch("https://api.bhimpay.online/api/v2/payouts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "AquaPay-Payment-Password": process.env.AQUAPAY_PAYMENT_PASSWORD,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "amount": "1500",
    "currency": "INR",
    "reference": "WD-20261203-7781",
    "beneficiary": {
      "type": "bank",
      "name": "Ravi Kumar",
      "accountNumber": "50100123456789",
      "ifsc": "HDFC0001234"
    },
    "narration": "Payout from Example Store"
  }),
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os
import uuid

import requests

response = requests.post(
    "https://api.bhimpay.online/api/v2/payouts",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
        "AquaPay-Payment-Password": os.environ["AQUAPAY_PAYMENT_PASSWORD"],
    },
    json={
        "amount": "1500",
        "currency": "INR",
        "reference": "WD-20261203-7781",
        "beneficiary": {
            "type": "bank",
            "name": "Ravi Kumar",
            "accountNumber": "50100123456789",
            "ifsc": "HDFC0001234",
        },
        "narration": "Payout from Example Store",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payouts");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
        "AquaPay-Payment-Password: " . getenv("AQUAPAY_PAYMENT_PASSWORD"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "amount" => "1500",
        "currency" => "INR",
        "reference" => "WD-20261203-7781",
        "beneficiary" => [
            "type" => "bank",
            "name" => "Ravi Kumar",
            "accountNumber" => "50100123456789",
            "ifsc" => "HDFC0001234",
        ],
        "narration" => "Payout from Example Store",
    ]),
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
body := strings.NewReader(`{
  "amount": "1500",
  "currency": "INR",
  "reference": "WD-20261203-7781",
  "beneficiary": {
    "type": "bank",
    "name": "Ravi Kumar",
    "accountNumber": "50100123456789",
    "ifsc": "HDFC0001234"
  },
  "narration": "Payout from Example Store"
}`)
req, err := http.NewRequest("POST", "https://api.bhimpay.online/api/v2/payouts", body)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
key := make([]byte, 16)
rand.Read(key) // crypto/rand
req.Header.Set("Idempotency-Key", hex.EncodeToString(key))
req.Header.Set("AquaPay-Payment-Password", os.Getenv("AQUAPAY_PAYMENT_PASSWORD"))
req.Header.Set("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payouts"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .header("AquaPay-Payment-Password", System.getenv("AQUAPAY_PAYMENT_PASSWORD"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
        {
          "amount": "1500",
          "currency": "INR",
          "reference": "WD-20261203-7781",
          "beneficiary": {
            "type": "bank",
            "name": "Ravi Kumar",
            "accountNumber": "50100123456789",
            "ifsc": "HDFC0001234"
          },
          "narration": "Payout from Example Store"
        }"""))
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "id": "payout_c8n4r2v6y0jd5",
  "reference": "WD-20261203-7781",
  "attemptKey": "9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70",
  "status": "succeeded",
  "amount": "1500.00",
  "fee": "15.00",
  "total": "1515.00",
  "currency": "INR",
  "beneficiary": {
    "type": "bank",
    "name": "Ravi Kumar",
    "masked": "••••6789"
  },
  "utr": "633712004455",
  "orderId": "AQW2612030918000781",
  "providerOrderId": "CPW55012",
  "failure": null,
  "version": 3,
  "createdAt": "2026-12-03T09:18:41Z",
  "updatedAt": "2026-12-03T09:19:55Z"
}

Payouts, newest first. Filter by status or by your reference.

GET/payouts

scope read

Answers come from AquaPay’s records. Scope read.

Parameters

  • cursorstringin query

    The nextCursor of the previous page. Opaque.
  • limitintegerin query

    Default 25.
  • statusstringin query

    processing (recorded, amount held, at or on its way to the provider) → succeeded | failed | needs_review. succeeded → reversed only on the provider’s own word. needs_review (still held) is resolved by AquaPay staff to succeeded, failed or reversed. failed and reversed are final.
  • referencestringin query

    Your reference, matched exactly.

Answers

curl https://api.bhimpay.online/api/v2/payouts \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/payouts", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/payouts",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payouts");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/payouts", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payouts"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "items": [
    {
      "id": "payout_c8n4r2v6y0jd5",
      "reference": "WD-20261203-7781",
      "attemptKey": "9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70",
      "status": "processing",
      "amount": "1500.00",
      "fee": "15.00",
      "total": "1515.00",
      "currency": "INR",
      "beneficiary": {
        "type": "bank",
        "name": "Ravi Kumar",
        "masked": "••••6789"
      },
      "utr": null,
      "orderId": "AQW2612030918000781",
      "providerOrderId": "CPW55012",
      "failure": null,
      "version": 2,
      "createdAt": "2026-12-03T09:18:41Z",
      "updatedAt": "2026-12-03T09:18:42Z"
    }
  ],
  "nextCursor": "c1.eyJ0IjoiMjAyNi0xMi0wM1QwOToxODo0MVoiLCJpIjo0MjE3fQ"
}

One payout, as AquaPay has it recorded.

GET/payouts/{payoutId}

scope read

Scope read.

Parameters

  • payoutIdstringin pathrequired

Answers

curl https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5 \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "id": "payout_c8n4r2v6y0jd5",
  "reference": "WD-20261203-7781",
  "attemptKey": "9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70",
  "status": "succeeded",
  "amount": "1500.00",
  "fee": "15.00",
  "total": "1515.00",
  "currency": "INR",
  "beneficiary": {
    "type": "bank",
    "name": "Ravi Kumar",
    "masked": "••••6789"
  },
  "utr": "633712004455",
  "orderId": "AQW2612030918000781",
  "providerOrderId": "CPW55012",
  "failure": null,
  "version": 3,
  "createdAt": "2026-12-03T09:18:41Z",
  "updatedAt": "2026-12-03T09:19:55Z"
}

Ask the provider about the payout now, and apply what it says.

POST/payouts/{payoutId}/refresh

scope readIdempotency-Key

Applies only the provider’s evidence about this exact order: an answer that names another order, or no order, changes nothing. A paid payout is reversed only by the provider’s own word about it. A payout checked in the last 10 seconds is answered from the record. Scope read.

Parameters

  • payoutIdstringin pathrequired

  • Idempotency-Keystringin headerrequired

    Makes a retry safe. On POST /payouts it is also the payout’s permanent attempt key.

Answers

curl -X POST https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5/refresh \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
const response = await fetch("https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5/refresh", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os
import uuid

import requests

response = requests.post(
    "https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5/refresh",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5/refresh");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("POST", "https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5/refresh", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
key := make([]byte, 16)
rand.Read(key) // crypto/rand
req.Header.Set("Idempotency-Key", hex.EncodeToString(key))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payouts/payout_c8n4r2v6y0jd5/refresh"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "id": "payout_c8n4r2v6y0jd5",
  "reference": "WD-20261203-7781",
  "attemptKey": "9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70",
  "status": "succeeded",
  "amount": "1500.00",
  "fee": "15.00",
  "total": "1515.00",
  "currency": "INR",
  "beneficiary": {
    "type": "bank",
    "name": "Ravi Kumar",
    "masked": "••••6789"
  },
  "utr": "633712004455",
  "orderId": "AQW2612030918000781",
  "providerOrderId": "CPW55012",
  "failure": null,
  "version": 3,
  "createdAt": "2026-12-03T09:18:41Z",
  "updatedAt": "2026-12-03T09:19:55Z"
}

What became of a payout attempt key.

GET/payout-attempts/{attemptKey}

scope read

used with its payout, closed (retired; it can never create a payout) or unused (AquaPay never saw it). The answer after a lost or timed-out create call. Scope read.

Parameters

  • attemptKeystringin pathrequired

    The Idempotency-Key a payout was (or would be) created with.

Answers

curl https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70 \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "key": "9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70",
  "state": "used",
  "payout": {
    "id": "payout_c8n4r2v6y0jd5",
    "reference": "WD-20261203-7781",
    "attemptKey": "9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70",
    "status": "processing",
    "amount": "1500.00",
    "fee": "15.00",
    "total": "1515.00",
    "currency": "INR",
    "beneficiary": {
      "type": "bank",
      "name": "Ravi Kumar",
      "masked": "••••6789"
    },
    "utr": null,
    "orderId": "AQW2612030918000781",
    "providerOrderId": "CPW55012",
    "failure": null,
    "version": 2,
    "createdAt": "2026-12-03T09:18:41Z",
    "updatedAt": "2026-12-03T09:18:42Z"
  }
}

Retire an attempt key that created nothing, so it never can.

POST/payout-attempts/{attemptKey}/close

scope payouts:writeIdempotency-Key

Under the same lock payout creation takes: if the key already created a payout, the answer is used with that payout and nothing changes; otherwise the key is retired for good and the answer is closed. A later create with it is 409 attempt_closed. Closing is how a client that lost a create call proves that no payout will appear, before it tries again with a new key. Scope payouts:write.

Parameters

  • attemptKeystringin pathrequired

    The Idempotency-Key a payout was (or would be) created with.
  • Idempotency-Keystringin headerrequired

    Makes a retry safe. On POST /payouts it is also the payout’s permanent attempt key.

Answers

curl -X POST https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70/close \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
const response = await fetch("https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70/close", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os
import uuid

import requests

response = requests.post(
    "https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70/close",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70/close");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("POST", "https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70/close", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
key := make([]byte, 16)
rand.Read(key) // crypto/rand
req.Header.Set("Idempotency-Key", hex.EncodeToString(key))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/payout-attempts/9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70/close"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "key": "9b2f61c4-7d0e-4a8b-b3f5-2c6e8a1d4f70",
  "state": "closed",
  "payout": null
}

Events

The webhook stream, for polling.

The account's events, oldest first, for polling.

GET/events

scope read

The same events the webhooks deliver, kept for 30 days. Unlike the other lists this one runs oldest first, and nextCursor is never null: store it and poll again with it to get only newer events. Without a cursor the list starts at the oldest event kept. Scope read.

With wait, a page that would be empty is held open until an event arrives or wait seconds pass: a long poll, which follows the stream as it happens without a public endpoint.

Parameters

  • cursorstringin query

    The nextCursor of the previous page. Opaque.
  • limitintegerin query

    Default 25.
  • waitintegerin query

    Seconds to hold an empty page open for the next event (0 to 30; 0 answers at once). Default 0.

Answers

curl https://api.bhimpay.online/api/v2/events \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/events", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/events",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/events");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/events", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/events"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "items": [
    {
      "id": "event_q2w8e5r1t7y3v",
      "type": "payin.succeeded",
      "mode": "live",
      "account": "ga_3k9d2m7q1x8vb",
      "createdAt": "2026-12-03T09:15:07Z",
      "data": {
        "id": "payin_7h2kq9w3m1zt4",
        "reference": "DEP-20261203-0042",
        "status": "succeeded",
        "amount": "500.00",
        "paidAmount": "500.00",
        "currency": "INR",
        "fee": "12.50",
        "net": "487.50",
        "utr": "416512345678",
        "orderId": "AQD2612030915000042",
        "providerOrderId": "CP88123409",
        "nextAction": null,
        "expiresAt": "2026-12-03T11:15:00Z",
        "failure": null,
        "version": 3,
        "createdAt": "2026-12-03T09:15:00Z",
        "updatedAt": "2026-12-03T09:15:07Z"
      }
    }
  ],
  "nextCursor": "e1.88412"
}

Webhook endpoints

Where events are delivered.

The account's webhook endpoints (at most three).

GET/webhook-endpoints

scope read

Scope read. Signing secrets are never returned here.

Answers

curl https://api.bhimpay.online/api/v2/webhook-endpoints \
  -H "Authorization: Bearer $AQUAPAY_API_KEY"
const response = await fetch("https://api.bhimpay.online/api/v2/webhook-endpoints", {
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os

import requests

response = requests.get(
    "https://api.bhimpay.online/api/v2/webhook-endpoints",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/webhook-endpoints");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("GET", "https://api.bhimpay.online/api/v2/webhook-endpoints", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/webhook-endpoints"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "items": [
    {
      "id": "hook_a4s8d2f6g0h3j",
      "url": "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
      "description": "Example Store backend",
      "eventTypes": [],
      "createdAt": "2026-12-03T08:00:00Z",
      "secretRotatedAt": null
    }
  ]
}

Add an HTTPS endpoint. The signing secret is in this answer only.

POST/webhook-endpoints

scope webhooks:writepayment passwordIdempotency-Key

An endpoint receives every event of the account, or only the eventTypes it names. The URL must be https, public, without credentials or a fragment, and not already registered on the account; an account has at most three. Needs scope webhooks:write and the payment password.

Parameters

  • Idempotency-Keystringin headerrequired

    Makes a retry safe. On POST /payouts it is also the payout’s permanent attempt key.
  • AquaPay-Payment-Passwordstringin header

    The gateway account’s payment password, typed by the person approving the action. Required on payout creation and on webhook endpoint changes; checked whenever it is sent. Never logged or stored by AquaPay.

Body: CreateWebhookEndpointRequest

  • urlstring (URL)required

  • descriptionstring

  • eventTypesarray of string

    The event types to receive; empty or absent is every type. One of payin.succeeded, payin.failed, payin.expired, payin.needs_review, payout.succeeded, payout.failed, payout.needs_review, payout.reversed.

Answers

curl -X POST https://api.bhimpay.online/api/v2/webhook-endpoints \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "AquaPay-Payment-Password: $AQUAPAY_PAYMENT_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
    "description": "Example Store backend"
  }'
const response = await fetch("https://api.bhimpay.online/api/v2/webhook-endpoints", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "AquaPay-Payment-Password": process.env.AQUAPAY_PAYMENT_PASSWORD,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
    "description": "Example Store backend"
  }),
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os
import uuid

import requests

response = requests.post(
    "https://api.bhimpay.online/api/v2/webhook-endpoints",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
        "AquaPay-Payment-Password": os.environ["AQUAPAY_PAYMENT_PASSWORD"],
    },
    json={
        "url": "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
        "description": "Example Store backend",
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/webhook-endpoints");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
        "AquaPay-Payment-Password: " . getenv("AQUAPAY_PAYMENT_PASSWORD"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "url" => "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
        "description" => "Example Store backend",
    ]),
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
body := strings.NewReader(`{
  "url": "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
  "description": "Example Store backend"
}`)
req, err := http.NewRequest("POST", "https://api.bhimpay.online/api/v2/webhook-endpoints", body)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
key := make([]byte, 16)
rand.Read(key) // crypto/rand
req.Header.Set("Idempotency-Key", hex.EncodeToString(key))
req.Header.Set("AquaPay-Payment-Password", os.Getenv("AQUAPAY_PAYMENT_PASSWORD"))
req.Header.Set("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/webhook-endpoints"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .header("AquaPay-Payment-Password", System.getenv("AQUAPAY_PAYMENT_PASSWORD"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
        {
          "url": "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
          "description": "Example Store backend"
        }"""))
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
201, an example
{
  "id": "hook_a4s8d2f6g0h3j",
  "url": "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
  "description": "Example Store backend",
  "eventTypes": [],
  "createdAt": "2026-12-03T08:00:00Z",
  "secretRotatedAt": null,
  "secret": "aqwh_Zt8kP3vQ9mW2xR6nB1cY7hJ4gF0sD5aL8eT3uK6q",
  "previousSecretExpiresAt": null
}

Stop delivering to an endpoint.

DELETE/webhook-endpoints/{endpointId}

scope webhooks:writepayment password

Pending deliveries to it are dropped; the events stay in /events. Deleting an endpoint this account already deleted answers 204 again, so a retry is safe without an Idempotency-Key. Needs scope webhooks:write and the payment password.

Parameters

  • endpointIdstringin pathrequired

  • AquaPay-Payment-Passwordstringin header

    The gateway account’s payment password, typed by the person approving the action. Required on payout creation and on webhook endpoint changes; checked whenever it is sent. Never logged or stored by AquaPay.

Answers

curl -X DELETE https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "AquaPay-Payment-Password: $AQUAPAY_PAYMENT_PASSWORD"
const response = await fetch("https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "AquaPay-Payment-Password": process.env.AQUAPAY_PAYMENT_PASSWORD,
  },
});
if (!response.ok) throw new Error((await response.json()).code);
import os

import requests

response = requests.delete(
    "https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "AquaPay-Payment-Password": os.environ["AQUAPAY_PAYMENT_PASSWORD"],
    },
    timeout=30,
)
if not response.ok:
    raise RuntimeError(response.json()["code"])
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "AquaPay-Payment-Password: " . getenv("AQUAPAY_PAYMENT_PASSWORD"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
// A success has no body.
req, err := http.NewRequest("DELETE", "https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
req.Header.Set("AquaPay-Payment-Password", os.Getenv("AQUAPAY_PAYMENT_PASSWORD"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("AquaPay-Payment-Password", System.getenv("AQUAPAY_PAYMENT_PASSWORD"))
    .DELETE()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());

Replace an endpoint's signing secret, with 24 hours of overlap.

POST/webhook-endpoints/{endpointId}/rotate-secret

scope webhooks:writepayment passwordIdempotency-Key

For 24 hours every delivery to the endpoint carries two sha256 signatures, one per secret, so a receiver that holds either secret keeps verifying while it switches. Needs scope webhooks:write and the payment password.

Parameters

  • endpointIdstringin pathrequired

  • Idempotency-Keystringin headerrequired

    Makes a retry safe. On POST /payouts it is also the payout’s permanent attempt key.
  • AquaPay-Payment-Passwordstringin header

    The gateway account’s payment password, typed by the person approving the action. Required on payout creation and on webhook endpoint changes; checked whenever it is sent. Never logged or stored by AquaPay.

Answers

curl -X POST https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j/rotate-secret \
  -H "Authorization: Bearer $AQUAPAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "AquaPay-Payment-Password: $AQUAPAY_PAYMENT_PASSWORD"
const response = await fetch("https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j/rotate-secret", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AQUAPAY_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "AquaPay-Payment-Password": process.env.AQUAPAY_PAYMENT_PASSWORD,
  },
});
const data = await response.json();
if (!response.ok) throw new Error(`${data.code}: ${data.message}`);
import os
import uuid

import requests

response = requests.post(
    "https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j/rotate-secret",
    headers={
        "Authorization": f"Bearer {os.environ['AQUAPAY_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
        "AquaPay-Payment-Password": os.environ["AQUAPAY_PAYMENT_PASSWORD"],
    },
    timeout=30,
)
data = response.json()
if not response.ok:
    raise RuntimeError(f"{data['code']}: {data['message']}")
<?php
$ch = curl_init("https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j/rotate-secret");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("AQUAPAY_API_KEY"),
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
        "AquaPay-Payment-Password: " . getenv("AQUAPAY_PAYMENT_PASSWORD"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["code"] . ": " . $data["message"]);
}
req, err := http.NewRequest("POST", "https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j/rotate-secret", nil)
if err != nil {
	log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AQUAPAY_API_KEY"))
key := make([]byte, 16)
rand.Read(key) // crypto/rand
req.Header.Set("Idempotency-Key", hex.EncodeToString(key))
req.Header.Set("AquaPay-Payment-Password", os.Getenv("AQUAPAY_PAYMENT_PASSWORD"))

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
answer, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(answer))
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.bhimpay.online/api/v2/webhook-endpoints/hook_a4s8d2f6g0h3j/rotate-secret"))
    .header("Authorization", "Bearer " + System.getenv("AQUAPAY_API_KEY"))
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .header("AquaPay-Payment-Password", System.getenv("AQUAPAY_PAYMENT_PASSWORD"))
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
200, an example
{
  "id": "hook_a4s8d2f6g0h3j",
  "url": "https://api.store.example/aquapay/webhooks/COWPAY_MAIN",
  "description": "Example Store backend",
  "eventTypes": [],
  "createdAt": "2026-12-03T08:00:00Z",
  "secretRotatedAt": "2026-12-10T08:00:00Z",
  "secret": "aqwh_Qm4nX8bV2cZ6aS0dF3gH7jK1lP5oW9eR2tY4uI8o",
  "previousSecretExpiresAt": "2026-12-11T08:00:00Z"
}

Webhook events

AquaPay posts these to your webhook endpoints, signed. Each carries the whole pay-in or payout as it was when the event was made. The webhooks guide covers signatures, retries and ordering.

TypeSent whenWhat to do
payin.succeededThe payer paid and the amount matches, including a late payment on a failed or expired pay-in.The payer paid, the amount matches, and net was credited. Credit the payer paidAmount. Also sent for a late payment on a failed or expired pay-in.
payin.failedThe provider refused or failed the pay-in. Nothing was credited.The provider refused or failed the pay-in. Nothing was credited.
payin.expiredThe pay-in was still unpaid two hours after it was opened.Nobody paid before expiresAt. A later payment still arrives as payin.succeeded.
payin.needs_reviewThe evidence does not settle it, such as a paid amount that differs.The provider’s evidence does not settle the pay-in (a different amount, a partial payment). Nothing was credited; AquaPay staff resolve it.
payout.succeededThe provider confirmed the payout for exactly its amount.The provider confirmed the beneficiary was paid exactly amount.
payout.failedThe payout failed, at creation or later. Its hold is released.The payout failed and its hold was released. Nothing reached the beneficiary.
payout.needs_reviewThe evidence is contradictory. The amount stays held.The provider’s evidence is contradictory (a different amount, partial, frozen). The amount stays held; AquaPay staff resolve it.
payout.reversedThe payout was paid, then returned. Its hold is released.The provider returned a paid payout. total is back in the balance.
payin.succeeded, as delivered
{
  "id": "event_q2w8e5r1t7y3v",
  "type": "payin.succeeded",
  "mode": "live",
  "account": "ga_3k9d2m7q1x8vb",
  "createdAt": "2026-12-03T09:15:07Z",
  "data": {
    "id": "payin_7h2kq9w3m1zt4",
    "reference": "DEP-20261203-0042",
    "status": "succeeded",
    "amount": "500.00",
    "paidAmount": "500.00",
    "currency": "INR",
    "fee": "12.50",
    "net": "487.50",
    "utr": "416512345678",
    "orderId": "AQD2612030915000042",
    "providerOrderId": "CP88123409",
    "nextAction": null,
    "expiresAt": "2026-12-03T11:15:00Z",
    "failure": null,
    "version": 3,
    "createdAt": "2026-12-03T09:15:00Z",
    "updatedAt": "2026-12-03T09:15:07Z"
  }
}

Objects

Every object the API sends or takes. A type in the operations above links to its entry here.

FailureWhy a payment failed or was reversed; null otherwise.
  • reasonstring

    beneficiary_invalid and beneficiary_bank_unsupported: fix the beneficiary. amount_not_allowed: the provider will not take this amount. provider_balance_insufficient: the gateway’s own float at the provider is short; tell AquaPay. provider_refused: refused for another reason. provider_unreachable: never sent. provider_failed: accepted, then failed by the provider (for a pay-in, the payer did not complete). provider_reversed: paid, then returned. resolved_by_aquapay: AquaPay staff closed it after review. One of beneficiary_invalid, beneficiary_bank_unsupported, amount_not_allowed, provider_balance_insufficient, provider_refused, provider_unreachable, provider_failed, provider_reversed, resolved_by_aquapay.
  • messagestring

    The provider’s words where it gave any, else AquaPay’s.
LimitsThe limits in force (provider floors, the gateway’s and the account’s own, combined). null is no limit.
  • minstring (money) or null

  • maxstring (money) or null

FeeThe fee is amount × percent / 100 + fixed, each part rounded half away from zero to two decimals.
  • percentstring (percent)

    A percentage as a decimal string ("2.5" is 2.5 %).
  • fixedstring (money)

    A non-negative amount in canonical form (two to six decimals, no trailing zero after the second).
Account
  • idstring

  • namestring

    The account’s display name.
  • modestring

    One of live, test.
  • statusstring

    One of active, suspended.
  • providerstring

    The provider the account’s gateway uses. A test account reports the provider its sandbox imitates. One of payme, upayrpl, cowpay, rspay.
  • currencystring

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • wholeUnitsOnlyboolean

    Amounts must be whole (PAYME, COWPAY); "100.50" is refused.
  • payinsobject

    • enabledboolean

    • limitsLimits

    • feeFee

    • utrBindingboolean

      POST /payins/{payinId}/bind-utr works.
    • payerIpRequiredboolean

      payer.ip is required.
  • payoutsobject

    • enabledboolean

    • methodsarray of string

      One of bank, upi, upay_wallet.
    • limitsLimits

    • feeFee

    • paymentPasswordRequiredboolean

      Whether this key must send AquaPay-Payment-Password to create a payout: always true.
  • keyobject

    The key that made this request.
    • idstring

    • namestring

    • scopesarray of string

      One of read, payins:write, payouts:write, webhooks:write.
    • ipAllowlistarray of string

    • expiresAtstring (date and time) or null

      Set while the key is being rolled out of use.
Balance
  • currencystring

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • availablestring (money)

    What payouts may spend now: the sum of the ledger, holds already taken off.
  • heldstring (money)

    What processing and needs_review payouts hold, included in the ledger as holds.
  • asOfstring (date and time)

LedgerEntry
  • idstring

  • typestring

    One of payin_credit, fee, payout_hold, payout_release, payout_settle, adjustment.
  • amountstring (money)

    A signed amount in canonical form.
  • balanceAfterstring (money)

    A signed amount in canonical form.
  • paymentIdstring or null

    The pay-in or payout the entry belongs to; null for an adjustment.
  • notestring or null

    An adjustment’s reason.
  • createdAtstring (date and time)

LedgerPage
  • itemsarray of LedgerEntry

  • nextCursorstring or null

    null on the last page.
CreatePayinRequest
  • amountstring (money)

    A positive amount with at most two decimals.
  • currencystring

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • referencestring

    Your id for the order. Not unique: a retried order may reuse it.
  • payerobject

    • idstring

      Your id for the payer. Providers use it for risk checks.
    • ipstring

      The payer’s public IPv4 or IPv6 address. Required when payins.payerIpRequired.
  • returnUrlstring (URL)

    Where the payment page sends the payer afterwards.
NextActionWhat to show the payer, while the pay-in is pending; null otherwise. Redirect to redirectUrl, or, where upiUri is set, open it on a phone (UPI intent) or render it as a QR code on a desktop.
  • redirectUrlstring (URL)

  • upiUristring or null

    A upi://pay?… URI (COWPAY).
Payin
  • idstring

  • referencestring

  • statusstring

    pending (waiting for the payer) → succeeded | failed | expired | needs_review. failed and expired can still become succeeded (or needs_review) on the provider’s proof of a late payment. needs_review is resolved by AquaPay staff to succeeded or failed. succeeded is final.
  • amountstring (money)

    The order amount.
  • paidAmountstring (money) or null

    What the provider reports was paid; null until it reports. On succeeded it is what was credited, before the fee.
  • currencystring

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • feestring (money)

    The fee on this pay-in (on paidAmount once succeeded).
  • netstring (money)

    What the balance gains when it succeeds: paidAmount (or amount) minus fee.
  • utrstring or null

    The bank’s reference for the payment.
  • orderIdstring

    The order number AquaPay sent the provider. The same value v1 called orderId.
  • providerOrderIdstring or null

    The provider’s own id for the order.
  • nextActionNextAction

  • expiresAtstring (date and time)

    Two hours after creation. A pay-in still pending then is checked with the provider once and, if still unpaid, becomes expired.
  • failureFailure

  • versioninteger

    Grows by one on every change. Apply a webhook only if its version is newer than the one you hold.
  • createdAtstring (date and time)

  • updatedAtstring (date and time)

PayinPage
  • itemsarray of Payin

  • nextCursorstring or null

    null on the last page.
BindUtrRequest
  • utrstring

    The 12-digit UTR from the payer’s bank or UPI app.
BankBeneficiary
  • type"bank"

  • namestring

  • accountNumberstring

  • ifscstring

UpiBeneficiary
  • type"upi"

  • namestring

  • vpastring

UpayWalletBeneficiary
  • type"upay_wallet"

  • addressstring

BeneficiarySummaryThe beneficiary, masked.
  • typestring

    bank (account number and IFSC), upi (a VPA), upay_wallet (a UPay wallet, paid in RPL at ₹1 each). One of bank, upi, upay_wallet.
  • namestring or null

  • maskedstring

    The last characters only: ••••6789, ra•••@okhdfcbank, UPW•••7n4v1.
CreatePayoutRequest
  • amountstring (money)

    What the beneficiary receives. The fee is debited on top.
  • currencystring

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • referencestring

    Your id for the withdrawal.
  • beneficiaryBankBeneficiary, UpiBeneficiary or UpayWalletBeneficiary

    Where a payout goes. type must be one of the account’s payouts.methods.
  • narrationstring

    The remark sent to the provider. Defaults to “Payout ”.
Payout
  • idstring

  • referencestring

  • attemptKeystring

    The Idempotency-Key that created it.
  • statusstring

    processing (recorded, amount held, at or on its way to the provider) → succeeded | failed | needs_review. succeeded → reversed only on the provider’s own word. needs_review (still held) is resolved by AquaPay staff to succeeded, failed or reversed. failed and reversed are final.
  • amountstring (money)

    What the beneficiary receives. On succeeded the provider confirmed exactly this.
  • feestring (money)

    A non-negative amount in canonical form (two to six decimals, no trailing zero after the second).
  • totalstring (money)

    amount + fee: held while processing or needs_review, debited on succeeded, released on failed or reversed.
  • currencystring

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • beneficiaryBeneficiarySummary

  • utrstring or null

    The bank’s reference for the transfer, once the provider gives one.
  • orderIdstring

    The order number AquaPay sent the provider. The same value v1 called orderId.
  • providerOrderIdstring or null

  • failureFailure

  • versioninteger

    Grows by one on every change. Apply a webhook only if its version is newer than the one you hold.
  • createdAtstring (date and time)

  • updatedAtstring (date and time)

PayoutPage
  • itemsarray of Payout

  • nextCursorstring or null

    null on the last page.
PayoutQuote
  • amountstring (money)

    A non-negative amount in canonical form (two to six decimals, no trailing zero after the second).
  • feestring (money)

    A non-negative amount in canonical form (two to six decimals, no trailing zero after the second).
  • totalstring (money)

    A non-negative amount in canonical form (two to six decimals, no trailing zero after the second).
  • currencystring

    ISO 4217, the currency of the account’s gateway. Every account is INR today. One of INR, USD.
  • sufficientBalanceboolean

    Whether available covers total at this moment.
PayoutAttempt
  • keystring

  • statestring

    One of unused, used, closed.
  • payoutPayout or null

    The payout when used.
EventEnvelope
  • idstring

    Deduplicate on it. Delivery is at least once.
  • modestring

    Never credit anyone for a test event. One of live, test.
  • accountstring

  • createdAtstring (date and time)

PayinEvent
  • idstring

    Deduplicate on it. Delivery is at least once.
  • modestring

    Never credit anyone for a test event. One of live, test.
  • accountstring

  • createdAtstring (date and time)

  • typestring

    One of payin.succeeded, payin.failed, payin.expired, payin.needs_review.
  • dataPayin

    The pay-in as it was when the event was made.
PayoutEvent
  • idstring

    Deduplicate on it. Delivery is at least once.
  • modestring

    Never credit anyone for a test event. One of live, test.
  • accountstring

  • createdAtstring (date and time)

  • typestring

    One of payout.succeeded, payout.failed, payout.needs_review, payout.reversed.
  • dataPayout

    The payout as it was when the event was made.
EventPage
  • itemsarray of PayinEvent or PayoutEvent

  • nextCursorstring

    Never null: poll again with it. Before the first event it is e1.0.
WebhookEndpoint
  • idstring

  • urlstring (URL)

  • descriptionstring

  • eventTypesarray of string

    The event types it receives; empty is every type. One of payin.succeeded, payin.failed, payin.expired, payin.needs_review, payout.succeeded, payout.failed, payout.needs_review, payout.reversed.
  • createdAtstring (date and time)

  • secretRotatedAtstring (date and time) or null

WebhookEndpointWithSecret
  • idstring

  • urlstring (URL)

  • descriptionstring

  • eventTypesarray of string

    The event types it receives; empty is every type. One of payin.succeeded, payin.failed, payin.expired, payin.needs_review, payout.succeeded, payout.failed, payout.needs_review, payout.reversed.
  • createdAtstring (date and time)

  • secretRotatedAtstring (date and time) or null

  • secretstring

    The signing secret. Shown only in this answer.
  • previousSecretExpiresAtstring (date and time) or null

    Until when the replaced secret also signs; null on creation.
WebhookEndpointList
CreateWebhookEndpointRequest
  • urlstring (URL)

  • descriptionstring

  • eventTypesarray of string

    The event types to receive; empty or absent is every type. One of payin.succeeded, payin.failed, payin.expired, payin.needs_review, payout.succeeded, payout.failed, payout.needs_review, payout.reversed.
ProviderDetailThe provider’s side of a provider error; null for errors AquaPay raised itself.
  • namestring

    The provider the account’s gateway uses. A test account reports the provider its sandbox imitates. One of payme, upayrpl, cowpay, rspay.
  • stagestring

    One of create, query, bind_utr.
  • reasonstring or null

    Why it refused; null when the outcome is unknown.
  • codestring or null

    The provider’s own code, as text.
  • messagestring

    The provider’s own words, trimmed.
FieldErrorOne refused field. rule is what it broke, for example required, format, type, unknown, min, max, whole_units, decimals, account_currency, method, url, or for a webhook endpoint unique (the URL is already an endpoint of the account) and max (the account already has three endpoints).
  • fieldstring

  • rulestring

  • messagestring

  • limitstring (money)

    The limit an amount broke (min, max).
Error
  • statusfalse

    Always false, as in every AquaPay error body.
  • codestring

    code HTTP retry
    validation_failed 400 no
    api_key_invalid 401 no
    payment_password_required 401 no
    payment_password_invalid 401 no
    ip_not_allowed 403 no
    scope_missing 403 no
    account_suspended 403 no
    resource_not_found 404 no
    idempotency_conflict 409 new_key
    idempotency_key_busy 409 same_key
    duplicate_reference 409 no
    attempt_closed 409 new_key
    balance_insufficient 409 no
    wrong_state 409 no
    utr_in_use 409 no
    unsupported_by_provider 422 no
    provider_refused 422 new_key
    payment_password_locked 423 same_key after Retry-After
    provider_unreachable 424 new_key on create, same_key on refresh and bind
    too_many_requests 429 same_key after Retry-After
    server_error 500 same_key
    provider_outcome_unknown 502 refresh for a payout, new_key for a pay-in
    service_unavailable 503 same_key after Retry-After
  • messagestring

    For people. May be reworded.
  • requestIdstring (UUID)

    Same as the AquaPay-Request-Id header.
  • retrystring

    One of same_key, new_key, refresh, no.
  • providerProviderDetail

  • docUrlstring (URL)

    The code’s page in the docs: https://aquapay.bhimpay.online/docs/errors#<code>.
  • detailsobject

    Per code: validation_failed {fields: [{field, rule, message, limit?}]} (at most 10); scope_missing {scope}; payment_password_invalid {remaining}; payment_password_locked {lockedUntil}; resource_not_found {resource}; duplicate_reference {payout}; attempt_closed {key}; balance_insufficient {available, required}; wrong_state {status}; utr_in_use {payinId}; provider_refused, provider_unreachable and provider_outcome_unknown {payin} or {payout} when the error is about one.