BitPays Docs

BitPays developer documentation

Everything you need to integrate payments.

Explore the BitPays API, understand payment flows and integrate payment processing into your platform.

Country guides


Host-to-host integration

BitPays Payments API

A single REST API for UPI & bank collections and payouts. Integrate server-to-server (H2H) — your backend calls ours directly, we return a payment link or UPI intent, and we notify you of the final result over signed webhooks.

Production live Base /v1 Auth Bearer JWT Amounts whole ₹ INR Content-Type application/json
How the flow works You authenticate with API keys → create a payment → show the customer the returned UPI intent / hosted checkout → we push a payment.success webhook the moment it clears. Everything below is copy-paste ready.
🌎 One API, six markets BitPays supports 🇮🇳 India, 🇹🇷 Türkiye, 🇧🇷 Brazil, 🇨🇴 Colombia, 🇲🇽 Mexico & 🇵🇪 Peru through this same API — see Countries & payment methods for each market's currency, method, payment instrument and pay-out fields. Code samples below use India (INR / UPI); swap currency + method for other markets. Every market also has its own page covering that country's exact request, checkout and test-mode behaviour: India, Türkiye, Brazil, Colombia, Mexico, Peru.
🌍 Selling into more than one market? One account and one set of credentials can serve several countries — you send a different currency and BitPays routes to that market’s acquirer. Multi-country integration → covers how a market is enabled, the wildcard-rule trap to avoid, and how to test each market.

Countries & payment methods

One API, every market. The endpoints, authentication, idempotency and webhooks in this guide are identical everywhere — only the currency and method you send change. BitPays routes each request to the correct local rail automatically.

CountryCurrencyMethodCustomer pays viaPay-out to
🇮🇳 India →INRUPI / BANKUPI app / QR / bank transferUPI ID, or account number + IFSC
🇹🇷 Türkiye →TRYBANKHAVALE / EFT bank transferIBAN
🇧🇷 Brazil →BRLBANKPIX (QR / copia e cola)PIX key — CPF / CNPJ / email / phone
🇨🇴 Colombia →COPBANKBre-B QRBank account + bank code
🇲🇽 Mexico →MXNBANKSPEI transfer to a CLABECLABE account + bank code
🇵🇪 Peru →PENBANKYape / PLIN / PagoEfectivoBank / wallet account
Amount units amount is an integer in every market — the whole major unit of the order currency, never minor units and never decimals. 500 means ₹500, 150 means R$ 150, 80000 means COP 80 000. A decimal such as 150.50 is rejected with 400. The validated range is 100–100000 in the order currency; per-merchant limits may be lower.

Pay-in — what the response gives you

MarketResponse containsShow the customer
🇮🇳 Indiapayment_url + intent_uri (upi://) + QRUPI intent / QR, or the hosted page
🇧🇷 Brazilqr_payload = PIX EMV (copia e cola)Render the PIX QR + a copy button
🇨🇴 Colombiaqr_payload = Bre-B EMV QRRender the Bre-B QR + a copy button
🇲🇽 MexicoCLABE account + receiving bank (SPEI)Show the CLABE, amount & concept “pago”
🇵🇪 Peru · 🇹🇷 Türkiyepayment_url (hosted checkout)Redirect the customer to payment_url

Pay-out — beneficiary fields by country

Send the common fields (amount, currency, method, merchant_payout_id) plus a beneficiary object. The local bank / PIX / CLABE details go under beneficiary (or order metadata):

CountryBeneficiary fields
🇮🇳 Indianame, phone (10-digit mobile — required by some rails), upi_id — or account_number + ifsc
🇹🇷 Türkiyename, iban
🇧🇷 Brazilname, pixType (CPF / CNPJ / EMAIL / PHONE / EVP), pixAccount, taxNumber
🇨🇴 Colombianame, bankCode, bankCard, accountType (CORRIENTE / AHORROS / BRE-B / WALLET), documentType (CC / CE / NIT / PAS), documento
🇲🇽 Mexiconame, bankCode, bankCard (CLABE)
🇵🇪 Peruname, bankCode, bankCard, accountNumber (20-digit), accountType (CORRIENTE / AHORROS / WALLET), documentType (DNI / CE / PAS), documento
Every terminal webhook carries the utr Both payment.success and payout.success include the bank / UPI reference (utr) once the provider settles.

Quickstart

Three calls take you from zero to a live payment. These calls create real orders — there is no test mode, and staging is connected to live payment channels too.

1

Get your API keys

From the merchant dashboard → API Keys, copy your client_id (bp_live_…; older accounts aqp_live_…) and client_secret (sk_live_…). The secret is shown once — store it securely.

2

Exchange them for a bearer token

POST /v1/auth/token returns a JWT valid for 1 hour. Send it as Authorization: Bearer … on every other call.

3

Create your first payment

POST /v1/payin/create returns an order_id, a hosted payment_url and a UPI intent_uri. Show one to the customer and wait for the webhook.

One-shot: token → payment
# 1 — get a token
TOKEN=$(curl -s -X POST https://api.bitpays.live/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{"client_id":"bp_live_xxx","client_secret":"sk_live_xxx"}' \
  | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)

# 2 — create a ₹500 UPI collection
curl -s -X POST https://api.bitpays.live/v1/payin/create \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: $(uuidgen)" \
  -d '{
    "merchant_order_id": "ORD-10001",
    "amount": 500,
    "currency": "INR",
    "method": "UPI",
    "customer": { "name": "Asha K", "email": "asha@example.com" }
  }'

Environments

Two stacks with independent keys and data and an identical request/response contract. Both are connected to live payment channels.

Staging is not a sandbox Staging is a pre-production environment connected to live payment channels. Transactions initiated in staging may move real money. Do not use staging for test payments or payouts. BitPays can route a staging account to a simulated channel on request — treat staging as live unless BitPays has confirmed that in writing for your account and market.
● Staging (pre-production)
https://api.staging.bitpays.live

Pre-production, with separate keys from the staging dashboard. Connected to live payment channels — transactions may move real money.

● Production
https://api.bitpays.live

Live money movement. Use production keys and whitelist your server IP before going live.

DetailValue
Path prefix/v1 on every endpoint
AmountsInteger whole units of the currency — 500 INR means ₹500, not paise
Content typeapplication/json on all requests
ConsolesMerchant app.bitpays.live · Admin admin.bitpays.live (staging: *.staging.bitpays.live)
Keep secrets server-side Never expose production or staging API keys or webhook secrets in a browser or mobile app.

Authentication

All API calls are authenticated with a short-lived bearer JWT. Exchange your API keys for a token, then send that token on every request. Tokens live for 1 hour; there is no separate refresh token — call /v1/auth/token again (or /v1/auth/refresh) with the same keys to mint a new one.

POST/v1/auth/token
FieldTypeReq.Notes
client_idstringrequiredYour client ID, bp_live_… (older accounts aqp_live_…)
client_secretstringrequiredYour secret key, sk_live_…
Request
curl -X POST https://api.bitpays.live/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{ "client_id": "bp_live_xxx", "client_secret": "sk_live_xxx" }'

Response 200 OK

application/json
{
  "success": true,
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6...",
  "token_type": "Bearer",
  "expires_in": 3600
}

Sending the token

Every subsequent request
Authorization: Bearer {access_token}
Guardrails The token endpoint is rate-limited to 20 requests / 60s. Bad keys return 401 INVALID_CREDENTIALS; a suspended account returns 403 MERCHANT_SUSPENDED.

Idempotency

Every create call (payin and payout) accepts an x-idempotency-key header. Send a unique key (a UUID) per logical order and safely retry on network failures — a repeated key returns the original result instead of creating a duplicate.

Header
x-idempotency-key: 6f1a2c9e-6b3d-4a1e-9f0c-2b7d5e4a1c8f
Behaviour Same key + same payload → the original response (HTTP 200 replay). Same key + a different payload → 409 IDEMPOTENCY_CONFLICT. Reusing a merchant_order_id across different keys → 409 DUPLICATE_ORDER.

Create a payment (collect)

Creates a UPI or bank collection order and returns the artifacts you present to the customer: a hosted payment_url, a UPI intent_uri, and a scannable qr_payload. The order expires at expires_at — 15 minutes by default, 30 minutes for TRY — after creation.

POST/v1/payin/create

Headers: Authorization: Bearer {token} · Content-Type: application/json · x-idempotency-key: {uuid} (recommended)

FieldTypeReq.Rules
amountintegerrequiredWhole units of the currency. INR ₹100–₹100,000; other currencies have their own band (see API reference)
methodenumrequiredUPI or BANK (card / wallet not yet processed)
currencystringoptional3-letter; defaults INR
merchant_order_idstringoptional1–100 chars; your reference. Auto-generated if omitted
customerobjectoptionalname, email, phone — all optional
return_urlstringoptionalWhere to send the customer after checkout
metadataobjectoptional≤20 keys; string values ≤500 chars
Request
curl -X POST https://api.bitpays.live/v1/payin/create \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: 6f1a2c9e-..." \
  -d '{
    "merchant_order_id": "ORD-10001",
    "amount": 1500,
    "method": "UPI",
    "customer": { "name": "Asha K", "phone": "9000000000" },
    "return_url": "https://shop.example.com/thanks",
    "metadata": { "cart_id": "c_8842" }
  }'

Response 201 Created · 200 on idempotent replay

application/json
{
  "success": true,
  "order_id": "cmabc123payin0001",
  "merchant_order_id": "ORD-10001",
  "status": "pending",
  "amount": 1500,
  "currency": "INR",
  "payment_url": "https://pay.bitpays.live/checkout/cmabc123payin0001",
  "intent_uri": "upi://pay?pa=merchant@upi&am=1500&cu=INR",
  "qr_payload": "upi://pay?pa=merchant@upi&am=1500",
  "expires_at": "2026-04-12T15:45:00.000Z"
}

payment_url, intent_uri and qr_payload appear only when applicable to the chosen method. Do not treat the create response as final — always wait for the payment.success webhook (or poll status).

Common errors 422 METHOD_NOT_SUPPORTED (use UPI/BANK) · 403 PAYIN_DISABLED · 409 DUPLICATE_ORDER · 503 PAYMENT_TEMPORARILY_UNAVAILABLE.

Payment status

Poll for the current state of a collection. Webhooks are the primary, real-time signal — use polling only as a reconciliation fallback.

GET/v1/payin/status/{order_id}
Response · application/json
{
  "success": true,
  "order_id": "cmabc123payin0001",
  "merchant_order_id": "ORD-10001",
  "status": "success",
  "amount": 1500,
  "currency": "INR",
  "created_at": "2026-04-12T15:35:00.000Z",
  "updated_at": "2026-04-12T15:37:12.000Z"
}

Also available: POST /v1/payin/{order_id}/refund — refunds a success order, fully or partly (else 409 NOT_REFUNDABLE). See Refund a payin.


Create a payout (disburse)

Sends money to a beneficiary by UPI or bank transfer. The payout is created in PENDING and the amount is debited from your payout wallet immediately; funds are released to the provider on approval.

POST/v1/payout/create

Headers: same as payin — Bearer token, JSON, optional x-idempotency-key.

FieldTypeReq.Rules
amountintegerrequiredWhole INR; min ₹1, max ₹100,000
methodenumrequiredUPI · BANK · WALLET
beneficiaryobjectconditionalSee rules below
beneficiary.phonestringoptionalBeneficiary mobile. Send it for India — some India payout rails refuse a payout without a 10-digit mobile. beneficiary.mobile is accepted as an alias
merchant_payout_idstringoptionalYour reference; auto-generated if omitted
currencystringoptionalDefaults INR
remarksstringoptional≤255 chars
metadataobjectoptionalFree-form
Beneficiary rules method: "UPI" requires beneficiary.upi_id. method: "BANK" requires beneficiary.account_number and beneficiary.ifsc. Missing fields → 422. beneficiary.phone is optional platform-wide, but an India payout that reaches a rail which requires it fails at the provider — send it whenever you have it.
Request · bank transfer
curl -X POST https://api.bitpays.live/v1/payout/create \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: 9a1f...-payout" \
  -d '{
    "merchant_payout_id": "PO-90001",
    "amount": 5000,
    "method": "BANK",
    "beneficiary": {
      "name": "Ravi Kumar",
      "phone": "9876543210",
      "account_number": "1234567890",
      "ifsc": "HDFC0000123"
    },
    "remarks": "Vendor settlement"
  }'

Response 201 Created

application/json
{
  "success": true,
  "order_id": "cmpayout1230001",
  "merchant_payout_id": "PO-90001",
  "status": "pending",
  "amount": 5000,
  "currency": "INR"
}
Wallet A payout debits your MERCHANT_PAYOUT wallet atomically. If the balance is short you get 422 INSUFFICIENT_BALANCE and no order is created.

Payout status

GET/v1/payout/status/{order_id}
Response · application/json
{
  "success": true,
  "order_id": "cmpayout1230001",
  "merchant_payout_id": "PO-90001",
  "status": "success",
  "amount": 5000,
  "currency": "INR",
  "processed_at": "2026-04-12T16:02:00.000Z",
  "created_at": "2026-04-12T15:58:00.000Z",
  "updated_at": "2026-04-12T16:02:00.000Z"
}

Webhooks

We POST a JSON event to your configured endpoint the moment an order reaches a terminal state. Webhooks are the source of truth for payment outcomes — never mark an order paid off the create response alone.

Delivery headers

HeaderValue
x-aquapay-eventCanonical event, e.g. payment.success
x-aquapay-timestampISO-8601 send time — part of the signature
x-aquapay-delivery-idwhdel_… unique per delivery attempt
x-aquapay-signatureHMAC-SHA256 hex signature (see below)

Events

Subscribe to any of the seven canonical events:

EventFires when
payment.createdA collection order is created
payment.successPayment cleared (carries utr)
payment.failedPayment failed
payment.expiredLink expired unpaid
payout.createdA payout is created
payout.successPayout settled to beneficiary
payout.failedPayout failed (amount refunded to wallet)

Payload — payment.success

POST to your endpoint
{
  "event": "payment.success",
  "delivery_id": "whdel_9f2a1c",
  "timestamp": "2026-04-12T15:37:12.000Z",
  "order_id": "cmabc123payin0001",
  "merchant_order_id": "ORD-10001",
  "status": "success",
  "amount": 1500,
  "currency": "INR",
  "utr": "UTR1234567890"
}

Payload — payout.success

POST to your endpoint
{
  "event": "payout.success",
  "delivery_id": "whdel_5b7e3d",
  "timestamp": "2026-04-12T16:02:00.000Z",
  "payout_id": "cmpayout1230001",
  "merchant_payout_id": "PO-90001",
  "status": "success",
  "amount": 5000,
  "currency": "INR",
  "processed_at": "2026-04-12T16:02:00.000Z"
}

Payout events key on payout_id / merchant_payout_id (not order_id). Respond 2xx to acknowledge. Non-2xx or a timeout (10s) triggers retries: up to 9 attempts with backoff 30s → 1m → 5m → 15m → 30m → 1h → 3h → 6h → 12h, with backup-URL failover.


Verify webhook signatures

Every webhook is signed so you can confirm it came from BitPays and wasn't tampered with. Compute an HMAC-SHA256 over "{timestamp}.{rawBody}" using your webhook signing secret (whsec_…) and compare it, in constant time, to the x-aquapay-signature header.

Signed string signature = HMAC_SHA256( secret, timestamp + "." + rawBody ) — hex-encoded. Use the exact raw request bytes, before any JSON re-serialization. timestamp is the value of the x-aquapay-timestamp header.
Express — verify & handle
import express from "express";
import crypto from "crypto";

const SECRET = process.env.BITPAYS_WEBHOOK_SECRET; // whsec_...

// capture the RAW body — required for signature verification
app.post("/webhooks/bitpays",
  express.raw({ type: "application/json" }),
  (req, res) => {
    const ts  = req.header("x-aquapay-timestamp");
    const sig = req.header("x-aquapay-signature");
    const raw = req.body.toString("utf8");

    const expected = crypto.createHmac("sha256", SECRET)
      .update(`${ts}.${raw}`).digest("hex");

    const ok = sig && crypto.timingSafeEqual(
      Buffer.from(sig), Buffer.from(expected));
    if (!ok) return res.sendStatus(400);

    const event = JSON.parse(raw);
    if (event.event === "payment.success") {
      // idempotent: mark order paid by event.merchant_order_id
    }
    res.sendStatus(200); // ack fast
  });
Best practice Acknowledge with 2xx immediately and process asynchronously. Treat every event as at-least-once — dedupe on delivery_id (or merchant_order_id + event). Secrets rotate with a version window, so keep verifying the current secret and accept a brief overlap during rotation.

Disputes — raise a UTR query

When a customer says they paid but the order is still pending, submit the UTR (bank reference) for that transaction and we open a dispute your team can action. A payment screenshot is optional — when you include one we store it and return a signed document_url (valid ~7 days). Authenticate with the same bearer token from /v1/auth/token.

POST/v1/disputes

Headers: Authorization: Bearer {token} · Content-Type: application/json

FieldTypeReq.Rules
utrstringrequiredThe bank UTR / transaction reference
payin_order_idstringone ofOur order_id for the transaction
transaction_refstringone ofYour merchant_order_id (alternative to payin_order_id)
screenshot_base64stringoptionalPayment proof as raw base64 or a data: URI (image/PDF, ≤10 MB)
screenshot_urlstringoptionalPublic URL we fetch the proof from (instead of base64)
screenshot_filenamestringoptionalName for the stored file, e.g. proof.png
amountnumberoptionalDisputed amount
descriptionstringoptionalFree text; defaults to a generic proof note
issue_categorystringoptionalDefaults PAYMENT_NOT_CREDITED
priorityenumoptionalLOW · MEDIUM (default) · HIGH · CRITICAL
customer_name, customer_numberstringoptionalWho made the payment
Reference the transaction Send at least one of payin_order_id, transaction_ref or utr so we can match the payment.
Request
curl -X POST https://api.bitpays.live/v1/disputes \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "payin_order_id": "cmabc123payin0001",
    "utr": "402912345678",
    "description": "Customer paid but order still pending",
    "screenshot_base64": "data:image/png;base64,iVBORw0KGgo..."
  }'

Response 201 Created

application/json
{
  "success": true,
  "dispute_code": "DISPUTE-F6187697",
  "dispute_id": "cms7bxk5h0004rv01y5kb3xic",
  "status": "OPEN",
  "utr": "402912345678",
  "document_url": "https://…s3…/disputes/…/proof.png?X-Amz-…",
  "document_expires_in": 604800
}

document_url is returned only when you sent a screenshot; it is a signed link valid ~7 days. The dispute also appears in your Disputes dashboard and, if you have linked a Telegram group, pops into that group.

List & track

GET/v1/disputes

Paginated list of your disputes. Filter with ?status=, ?priority= or ?query=.

GET/v1/disputes/{id}

A single dispute with its full event timeline and attachments.

GET/v1/disputes/{id}/attachments/{attachmentId}/url

Mint a fresh signed download_url for an attachment later (the link from create expires).

Errors 422 utr is required when no UTR is sent · 404 ORDER_NOT_FOUND when payin_order_id doesn't belong to you · 413 SCREENSHOT_TOO_LARGE above 10 MB.

Embed the cashier in an iframe

The hosted cashier can run inside an <iframe> on your own checkout, so the customer never leaves your site. Put the payment_url returned by /v1/payin/create straight into the frame.

<iframe
  src="PAYMENT_URL_FROM_THE_API"
  width="100%"
  height="640"
  style="border:0;max-width:480px"
  allow="clipboard-write"
  title="Payment"></iframe>
Allow clipboard-write The India cashier offers a “copy UPI ID” button. Without that allow attribute the copy silently fails inside a frame.

Knowing when the payment finished

When the payment reaches a final state the cashier navigates itself to a result page. Inside a frame that only swaps the frame’s document — your page is not reloaded and would otherwise never find out. So the embedded page posts a message to its parent:

window.addEventListener('message', function (event) {
  // Always check the origin before trusting a postMessage.
  if (event.origin !== 'https://api.bitpays.live') return;

  var msg = event.data;
  if (!msg || msg.source !== 'bitpays') return;

  if (msg.type === 'cashier_ready') {
    // The cashier rendered. msg.order_id is available.
    return;
  }

  if (msg.type === 'payment_status') {
    // msg.status is 'success' | 'failed' | 'expired'
    if (msg.status === 'success') {
      window.location = '/order/complete?order=' + encodeURIComponent(msg.order_id);
    }
  }
});
FieldValuesMeaning
source"bitpays"Always this. Ignore any message without it.
typecashier_ready · payment_statuscashier_ready fires once when the cashier loads; payment_status when the order reaches a final state.
statuspending · success · failed · expiredpending accompanies cashier_ready.
order_idstringThe BitPays order id.
The message is a UI signal, not proof of payment It comes from the browser, so it can be forged by anything running on the page. Use it to update what the customer sees — close the frame, show a receipt, move them on. Credit the order only on the signed webhook or a server-side status check.

Restricting who may embed

By default any site may frame the cashier (Content-Security-Policy: frame-ancestors *). To limit it to your own domains, ask BitPays support to set an explicit allowlist — framing from anywhere else is then refused by the browser. Only the /checkout/* pages are framable; the dashboards are not, and never will be.

Full-page alternative You do not have to embed. Redirecting the customer to payment_url and relying on return_url works too, and is simpler if you have no need to keep them on your page.

API reference

Every public endpoint, with its exact fields, validation, responses and errors. Base URL https://api.bitpays.live; every path is under /v1. Request and response bodies are JSON. Field names, codes and statuses below are taken from the API implementation; anything that could not be verified is marked Requires confirmation.

MethodEndpointPurpose
POST/v1/auth/tokenGet an access token
POST/v1/auth/refreshRefresh an access token
POST/v1/payin/createCreate a payin
GET/v1/payin/status/:orderIdGet payin status
POST/v1/payin/:orderId/refundRefund a payin
POST/v1/payout/createCreate a payout
GET/v1/payout/status/:orderIdGet payout status
GET/v1/disputesList disputes
POST/v1/disputesRaise a dispute
GET/v1/disputes/:idGet a dispute
GET/v1/disputes/:id/attachments/:attId/urlGet a dispute attachment link

There is no payment-methods endpoint: the methods for each market are listed in Countries & methods and the country guides. There is no official BitPays SDK; the examples use each language’s standard HTTP client.

Authentication

POST/v1/auth/token

Get an access token

Exchange your API credentials for a short-lived bearer token. Tokens are valid for 3600 seconds; request a new one before expiry.

Authentication

None — credentials go in the body. Limited to 20 requests per 60 s by default.

Headers

HeaderRequiredValue
Content-Typerequiredapplication/json

Request body · application/json

FieldTypeRequiredValidation & notes
client_idstringrequiredYour client ID (bp_live_…; older accounts aqp_live_…). Non-empty.
client_secretstringrequiredYour client secret (sk_live_…). Non-empty.

Responses

200 Token issued

{
  "success": true,
  "access_token": "eyJhbGciOi…",
  "token_type": "Bearer",
  "expires_in": 3600
}

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
400INVALID_REQUESTA required field is missing or has the wrong JSON type (message: “Invalid request.”).
422INVALID_REQUESTValidation failed (message: “Validation failed”). details maps field → messages; issues[] carries a stable code for issues that define one.
401INVALID_CREDENTIALSUnknown client_id, wrong secret, or the credential is inactive/revoked.
403MERCHANT_SUSPENDEDThe merchant account is suspended or inactive.
429RATE_LIMIT_EXCEEDEDMore than the token-endpoint limit (default 20 / 60 s).

Examples

curl -X POST https://api.bitpays.live/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "bp_live_xxx",
    "client_secret": "sk_live_xxx"
  }'
const res = await fetch("https://api.bitpays.live/v1/auth/token", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "client_id": "bp_live_xxx",
    "client_secret": "sk_live_xxx"
  }),
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$body = <<<'JSON'
{
  "client_id": "bp_live_xxx",
  "client_secret": "sk_live_xxx"
}
JSON;
$headers = [
  "Content-Type: application/json",
];
$ch = curl_init("https://api.bitpays.live/v1/auth/token");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.post(
    "https://api.bitpays.live/v1/auth/token",
    json={
        "client_id": "bp_live_xxx",
        "client_secret": "sk_live_xxx"
    },
    timeout=30,
)
data = resp.json()
POST/v1/auth/refresh

Refresh an access token

Issues a new token. It takes the same client_id and client_secret as /v1/auth/token — there is no separate refresh token.

Authentication

None — credentials go in the body.

Headers

HeaderRequiredValue
Content-Typerequiredapplication/json

Request body · application/json

FieldTypeRequiredValidation & notes
client_idstringrequiredYour client ID. Non-empty.
client_secretstringrequiredYour client secret. Non-empty.

Responses

200 Token issued

{
  "success": true,
  "access_token": "eyJhbGciOi…",
  "token_type": "Bearer",
  "expires_in": 3600
}

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
400INVALID_REQUESTA required field is missing or has the wrong JSON type (message: “Invalid request.”).
422INVALID_REQUESTValidation failed (message: “Validation failed”). details maps field → messages; issues[] carries a stable code for issues that define one.
401INVALID_CREDENTIALSUnknown client_id, wrong secret, or the credential is inactive/revoked.
401MERCHANT_SUSPENDEDThe merchant account is suspended or inactive. (This endpoint answers 401 here; /v1/auth/token answers 403.)

Examples

curl -X POST https://api.bitpays.live/v1/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "bp_live_xxx",
    "client_secret": "sk_live_xxx"
  }'
const res = await fetch("https://api.bitpays.live/v1/auth/refresh", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "client_id": "bp_live_xxx",
    "client_secret": "sk_live_xxx"
  }),
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$body = <<<'JSON'
{
  "client_id": "bp_live_xxx",
  "client_secret": "sk_live_xxx"
}
JSON;
$headers = [
  "Content-Type: application/json",
];
$ch = curl_init("https://api.bitpays.live/v1/auth/refresh");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.post(
    "https://api.bitpays.live/v1/auth/refresh",
    json={
        "client_id": "bp_live_xxx",
        "client_secret": "sk_live_xxx"
    },
    timeout=30,
)
data = resp.json()

Payins

POST/v1/payin/create

Create a payin

Creates a collection order and returns what you present to the customer: a hosted payment_url and, where the market supports it, a UPI intent_uri / qr_payload. Credit the customer on the payment.success webhook, never on this response.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}
Content-Typerequiredapplication/json
x-idempotency-keyrecommendedUnique per logical order (a UUID). Same key + same body replays the original response with HTTP 200; same key + different body is 409 IDEMPOTENCY_CONFLICT.

Request body · application/json

FieldTypeRequiredValidation & notes
amountintegerrequiredWhole units of the currency (no decimals, not paise). Per-currency band: INR 100–100,000 · TRY 40–200,000 · BRL 5–30,000 · MXN 20–100,000 · COP 4,000–20,000,000 · PEN 4–20,000. Your account’s own min/max may be narrower.
currencystringrequired3-letter ISO code of the market: INR, TRY, BRL, MXN, COP, PEN.
methodenumrequiredUPI · CARD · BANK · WALLET. Use the method listed for the market in Countries.
merchant_order_idstringoptional1–100 chars, unique per merchant. Generated if omitted.
customerobjectoptionalname (≤100), full_name (≤100, alias of name), email (valid email), phone (≤20). Türkiye TRY + BANK requires a full name (first and last).
return_urlstring (URL)optionalWhere the hosted checkout sends the customer afterwards.
metadataobjectoptional≤20 keys; key ≤64 chars; string values ≤500 chars.
raw_requisitesbooleanoptionalTürkiye TRY + BANK only: also return the bank details in bank_transfer so you can render your own checkout.

Responses

201 Order created

{
  "success": true,
  "order_id": "cmabc123payin0001",
  "merchant_order_id": "ORD-10001",
  "status": "pending",
  "amount": 500,
  "currency": "INR",
  "payment_url": "https://api.bitpays.live/checkout/cmabc123payin0001",
  "intent_uri": "upi://pay?…",
  "qr_payload": "upi://pay?…",
  "expires_at": "2026-11-13T12:15:00.000Z"
}

200 Idempotent replay — the original response for a repeated x-idempotency-key

Optional fields appear only when the channel supplies them: intent_uri, qr_payload, app_intents (app-specific deep links), collectible_amount (when the channel asks the payer for a slightly different amount — display this one), and bank_transfer (beneficiary_iban, beneficiary_name, bank_name, amount, currency) when raw_requisites was requested. expires_at is 15 minutes after creation by default and 30 minutes for TRY.

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
400INVALID_REQUESTA required field is missing or has the wrong JSON type (message: “Invalid request.”).
422INVALID_REQUESTValidation failed (message: “Validation failed”). details maps field → messages; issues[] carries a stable code for issues that define one.
422INVALID_REQUEST + issues[].codeAMOUNT_BELOW_MINIMUM / AMOUNT_ABOVE_MAXIMUM (currency band), CUSTOMER_NAME_REQUIRED / CUSTOMER_NAME_INCOMPLETE (Türkiye bank transfer).
422AMOUNT_BELOW_MINIMUM / AMOUNT_ABOVE_MAXIMUMOutside your account’s own limits.
422METHOD_NOT_SUPPORTEDThe method is not offered at all.
422ROUTE_NOT_CONFIGUREDNo route is enabled for this currency and method on your account — permanent until enabled; do not retry.
422AMOUNT_OUTSIDE_LIMITSNo available channel accepts this amount.
403PAYIN_DISABLEDCollections are switched off for your account.
403COUNTRY_NOT_ENABLEDThe market is not enabled for your account. Body adds country and reason.
409IDEMPOTENCY_CONFLICTKey reused with a different body.
409DUPLICATE_ORDERmerchant_order_id already exists.
503PAYMENT_TEMPORARILY_UNAVAILABLENo channel has capacity, or the provider rejected the attempt. When an order was created it is failed and the body adds order_id, merchant_order_id, optional reason and retryable. A provider-specific code may appear instead.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Statuses

New orders are created or pending, then become success, failed or expired.

Idempotency

Supported via x-idempotency-key. Same key and body within the retention window returns the original response with HTTP 200 and creates nothing new; a different body is 409 IDEMPOTENCY_CONFLICT. Generate a new key per logical order. Requires confirmation the key retention period is not published.

Examples

curl -X POST https://api.bitpays.live/v1/payin/create \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: $(uuidgen)" \
  -d '{
    "merchant_order_id": "ORD-10001",
    "amount": 500,
    "currency": "INR",
    "method": "UPI",
    "customer": {
      "name": "Asha K",
      "email": "asha@example.com"
    },
    "return_url": "https://shop.example.com/thanks"
  }'
const res = await fetch("https://api.bitpays.live/v1/payin/create", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
    "x-idempotency-key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "merchant_order_id": "ORD-10001",
    "amount": 500,
    "currency": "INR",
    "method": "UPI",
    "customer": {
      "name": "Asha K",
      "email": "asha@example.com"
    },
    "return_url": "https://shop.example.com/thanks"
  }),
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$body = <<<'JSON'
{
  "merchant_order_id": "ORD-10001",
  "amount": 500,
  "currency": "INR",
  "method": "UPI",
  "customer": {
    "name": "Asha K",
    "email": "asha@example.com"
  },
  "return_url": "https://shop.example.com/thanks"
}
JSON;
$headers = [
  "Authorization: Bearer " . $token,
  "Content-Type: application/json",
  "x-idempotency-key: " . bin2hex(random_bytes(16)),
];
$ch = curl_init("https://api.bitpays.live/v1/payin/create");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests, uuid

resp = requests.post(
    "https://api.bitpays.live/v1/payin/create",
    headers={"Authorization": f"Bearer {token}", "x-idempotency-key": str(uuid.uuid4())},
    json={
        "merchant_order_id": "ORD-10001",
        "amount": 500,
        "currency": "INR",
        "method": "UPI",
        "customer": {
            "name": "Asha K",
            "email": "asha@example.com"
        },
        "return_url": "https://shop.example.com/thanks"
    },
    timeout=30,
)
data = resp.json()
GET/v1/payin/status/:orderId

Get payin status

Returns the current state of one of your orders. Use webhooks as the real-time signal and this endpoint to reconcile.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}

Path parameters

ParameterTypeRequiredDescription
orderIdstringrequiredOur order_id from the create response (not your merchant_order_id).

Responses

200 Order found

{
  "success": true,
  "order_id": "cmabc123payin0001",
  "merchant_order_id": "ORD-10001",
  "status": "success",
  "amount": 500,
  "currency": "INR",
  "payment_url": "https://api.bitpays.live/checkout/cmabc123payin0001",
  "expires_at": "2026-11-13T12:15:00.000Z",
  "created_at": "2026-11-13T12:00:00.000Z",
  "updated_at": "2026-11-13T12:02:41.000Z"
}

Same fields as the create response, plus created_at and updated_at. The UTR is delivered on the payment.success webhook.

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
404NOT_FOUNDNo order with that id belongs to your account.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Statuses

created · pending · processing · success · failed · expired · refunded · cancelled.

Examples

curl -X GET https://api.bitpays.live/v1/payin/status/ORDER_ID \
  -H "Authorization: Bearer $TOKEN"
const res = await fetch("https://api.bitpays.live/v1/payin/status/ORDER_ID", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$headers = [
  "Authorization: Bearer " . $token,
];
$ch = curl_init("https://api.bitpays.live/v1/payin/status/ORDER_ID");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.get(
    "https://api.bitpays.live/v1/payin/status/ORDER_ID",
    headers={"Authorization": f"Bearer {token}"},
    timeout=30,
)
data = resp.json()
POST/v1/payin/:orderId/refund

Refund a payin

Submits a full or partial refund of a successful payin to the payment channel. The refund is recorded only once the channel accepts it.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}
Content-Typerequiredapplication/json

Path parameters

ParameterTypeRequiredDescription
orderIdstringrequiredOur order_id.

Request body · application/json

FieldTypeRequiredValidation & notes
amountnumberoptionalPartial refund amount. Omit for the full refundable balance. Must be > 0 and within the amount not yet refunded.
reasonstringoptionalFree text for your records.

Responses

200 Refund accepted by the channel

{
  "success": true,
  "refund": {
    "ref": "RFND-…",
    "status": "…",
    "amount": 500,
    "currency": "INR",
    "fully_refunded": true,
    "total_refunded": 500
  },
  "order": {
    "id": "cmabc123payin0001",
    "status": "refunded"
  }
}

refund.status is the channel’s own value. Requires confirmation the set of values differs per channel and is not normalised.

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
404NOT_FOUNDNo such order on your account.
409NOT_REFUNDABLEThe order is not success, or has no channel reference to refund.
422INVALID_AMOUNTAmount is not positive, or exceeds the refundable balance.
422REFUND_UNSUPPORTEDThe order’s payment channel does not support automated refunds.
502REFUND_FAILEDThe channel rejected the refund.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Statuses

Only success orders can be refunded. A full refund moves the order to refunded.

Examples

curl -X POST https://api.bitpays.live/v1/payin/ORDER_ID/refund \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 500,
    "reason": "Customer request"
  }'
const res = await fetch("https://api.bitpays.live/v1/payin/ORDER_ID/refund", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "amount": 500,
    "reason": "Customer request"
  }),
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$body = <<<'JSON'
{
  "amount": 500,
  "reason": "Customer request"
}
JSON;
$headers = [
  "Authorization: Bearer " . $token,
  "Content-Type: application/json",
];
$ch = curl_init("https://api.bitpays.live/v1/payin/ORDER_ID/refund");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.post(
    "https://api.bitpays.live/v1/payin/ORDER_ID/refund",
    headers={"Authorization": f"Bearer {token}"},
    json={
        "amount": 500,
        "reason": "Customer request"
    },
    timeout=30,
)
data = resp.json()

Payouts

POST/v1/payout/create

Create a payout

Sends money to a beneficiary. The amount is debited from your payout wallet when the order is created; a failed payout returns it.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}
Content-Typerequiredapplication/json
x-idempotency-keyrecommendedUnique per logical order (a UUID). Same key + same body replays the original response with HTTP 200; same key + different body is 409 IDEMPOTENCY_CONFLICT.

Request body · application/json

FieldTypeRequiredValidation & notes
amountintegerrequiredWhole units of the currency. Per-currency band: INR 1–100,000 · TRY 40–200,000 · BRL 5–30,000 · MXN 20–100,000 · COP 4,000–20,000,000 · PEN 4–20,000.
methodenumrequiredBANK · UPI · WALLET.
currencystringoptional3-letter ISO code. Defaults to INR.
merchant_payout_idstringoptional1–100 chars, your reference. merchant_order_id is accepted as an alias. Generated if omitted.
beneficiaryobjectconditionalname, phone (or alias mobile; 7–15 digits), account_number, ifsc, iban, upi_id. Rules: UPI needs upi_id; BANK needs account_number or iban, and INR bank payouts also need ifsc; WALLET needs account_number or upi_id.
remarksstringoptional≤255 chars.
metadataobjectoptionalFree-form key/value pairs.

Responses

201 Payout created

{
  "success": true,
  "order_id": "cmabc123payout001",
  "merchant_payout_id": "PO-10001",
  "merchant_order_id": "PO-10001",
  "status": "pending",
  "amount": 1000,
  "currency": "INR"
}

200 Idempotent replay — the original response for a repeated x-idempotency-key

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
400INVALID_REQUESTA required field is missing or has the wrong JSON type (message: “Invalid request.”).
422INVALID_REQUESTValidation failed (message: “Validation failed”). details maps field → messages; issues[] carries a stable code for issues that define one.
422INVALID_REQUEST + issues[].codeAMOUNT_BELOW_MINIMUM / AMOUNT_ABOVE_MAXIMUM; beneficiary rule messages are in details.
422INSUFFICIENT_BALANCEYour payout wallet cannot cover the amount.
403PAYOUT_DISABLEDPayouts are switched off for your account.
403COUNTRY_NOT_ENABLED / FLOW_NOT_ENABLED_IN_MARKETThe market, or payouts in that market, are not enabled for your account.
409IDEMPOTENCY_CONFLICTKey reused with a different body.
409DUPLICATE_ORDERmerchant_payout_id already exists.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Statuses

Payouts start pending, move through processing and end success or failed.

Idempotency

Supported via x-idempotency-key. Same key and body within the retention window returns the original response with HTTP 200 and creates nothing new; a different body is 409 IDEMPOTENCY_CONFLICT. Generate a new key per logical order. Requires confirmation the key retention period is not published.

Examples

curl -X POST https://api.bitpays.live/v1/payout/create \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: $(uuidgen)" \
  -d '{
    "merchant_payout_id": "PO-10001",
    "amount": 1000,
    "currency": "INR",
    "method": "BANK",
    "beneficiary": {
      "name": "Jane Doe",
      "phone": "9876543210",
      "account_number": "ACCOUNT_NUMBER",
      "ifsc": "IFSC_CODE"
    },
    "remarks": "Withdrawal 4471"
  }'
const res = await fetch("https://api.bitpays.live/v1/payout/create", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
    "x-idempotency-key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "merchant_payout_id": "PO-10001",
    "amount": 1000,
    "currency": "INR",
    "method": "BANK",
    "beneficiary": {
      "name": "Jane Doe",
      "phone": "9876543210",
      "account_number": "ACCOUNT_NUMBER",
      "ifsc": "IFSC_CODE"
    },
    "remarks": "Withdrawal 4471"
  }),
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$body = <<<'JSON'
{
  "merchant_payout_id": "PO-10001",
  "amount": 1000,
  "currency": "INR",
  "method": "BANK",
  "beneficiary": {
    "name": "Jane Doe",
    "phone": "9876543210",
    "account_number": "ACCOUNT_NUMBER",
    "ifsc": "IFSC_CODE"
  },
  "remarks": "Withdrawal 4471"
}
JSON;
$headers = [
  "Authorization: Bearer " . $token,
  "Content-Type: application/json",
  "x-idempotency-key: " . bin2hex(random_bytes(16)),
];
$ch = curl_init("https://api.bitpays.live/v1/payout/create");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests, uuid

resp = requests.post(
    "https://api.bitpays.live/v1/payout/create",
    headers={"Authorization": f"Bearer {token}", "x-idempotency-key": str(uuid.uuid4())},
    json={
        "merchant_payout_id": "PO-10001",
        "amount": 1000,
        "currency": "INR",
        "method": "BANK",
        "beneficiary": {
            "name": "Jane Doe",
            "phone": "9876543210",
            "account_number": "ACCOUNT_NUMBER",
            "ifsc": "IFSC_CODE"
        },
        "remarks": "Withdrawal 4471"
    },
    timeout=30,
)
data = resp.json()
GET/v1/payout/status/:orderId

Get payout status

Returns the current state of one of your payouts.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}

Path parameters

ParameterTypeRequiredDescription
orderIdstringrequiredOur payout order_id from the create response.

Responses

200 Payout found

{
  "success": true,
  "order_id": "cmabc123payout001",
  "merchant_payout_id": "PO-10001",
  "merchant_order_id": "PO-10001",
  "status": "success",
  "amount": 1000,
  "currency": "INR",
  "processed_at": "2026-11-13T12:06:10.000Z",
  "created_at": "2026-11-13T12:00:00.000Z",
  "updated_at": "2026-11-13T12:06:10.000Z"
}

The disbursement UTR is delivered on the payout.success webhook.

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
404NOT_FOUNDNo payout with that id belongs to your account.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Statuses

pending · processing · success · failed.

Examples

curl -X GET https://api.bitpays.live/v1/payout/status/ORDER_ID \
  -H "Authorization: Bearer $TOKEN"
const res = await fetch("https://api.bitpays.live/v1/payout/status/ORDER_ID", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$headers = [
  "Authorization: Bearer " . $token,
];
$ch = curl_init("https://api.bitpays.live/v1/payout/status/ORDER_ID");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.get(
    "https://api.bitpays.live/v1/payout/status/ORDER_ID",
    headers={"Authorization": f"Bearer {token}"},
    timeout=30,
)
data = resp.json()

Disputes

GET/v1/disputes

List disputes

Paginated list of your disputes.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}

Query parameters

ParameterTypeRequiredDescription
statusstringoptionalFilter by dispute status, e.g. OPEN, UNDER_REVIEW, RESOLVED, REJECTED, CLOSED.
prioritystringoptionalLOW · MEDIUM · HIGH · CRITICAL.
querystringoptionalFree-text search.
pageintegeroptionalDefault 1.
limitintegeroptionalDefault 20, maximum 100.

Responses

200 List

{
  "success": true,
  "disputes": [
    "…"
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 3
  }
}

Requires confirmation The full field list of a dispute object is not yet documented; read it from a live response and rely only on fields you observe.

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
422INVALID_REQUESTValidation failed (message: “Validation failed”). details maps field → messages; issues[] carries a stable code for issues that define one.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Statuses

Dispute statuses: OPEN, UNDER_REVIEW, PROVIDER_REVIEW, MERCHANT_RESPONSE_REQUIRED, WAITING_FOR_BANK, RESOLVED, REJECTED, ESCALATED, CLOSED.

Examples

curl -X GET https://api.bitpays.live/v1/disputes \
  -H "Authorization: Bearer $TOKEN"
const res = await fetch("https://api.bitpays.live/v1/disputes", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$headers = [
  "Authorization: Bearer " . $token,
];
$ch = curl_init("https://api.bitpays.live/v1/disputes");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.get(
    "https://api.bitpays.live/v1/disputes",
    headers={"Authorization": f"Bearer {token}"},
    timeout=30,
)
data = resp.json()
POST/v1/disputes

Raise a dispute

Submit the UTR (bank reference) for a payment the customer made but that is not credited, optionally with a screenshot.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}
Content-Typerequiredapplication/json

Request body · application/json

FieldTypeRequiredValidation & notes
utrstringrequiredBank / UPI transaction reference, at least 2 chars.
payin_order_idstringoptionalOur order_id for the payment.
transaction_refstringoptionalYour merchant_order_id (alternative to payin_order_id).
amountnumberoptionalPositive.
currencystringoptionalDefaults to INR.
customer_namestringoptional
customer_numberstringoptional
issue_categorystringoptionalDefaults to PAYMENT_NOT_CREDITED.
descriptionstringoptional≥3 chars. Defaults to “Merchant-submitted payment proof.”
priorityenumoptionalLOW · MEDIUM (default) · HIGH · CRITICAL.
screenshot_base64stringoptionalRaw base64 or a data: URI (image or PDF, ≤10 MB).
screenshot_urlstring (URL)optionalPublic URL we fetch the screenshot from.
screenshot_filenamestringoptional≤120 chars.

Responses

201 Dispute created

{
  "success": true,
  "dispute_id": "cms8ab12x0001…",
  "dispute_code": "DISPUTE-9F3A21B7",
  "status": "OPEN",
  "utr": "402912345678",
  "attachment_id": null,
  "document_url": null,
  "document_expires_in": null
}

When a screenshot was stored, attachment_id and a signed document_url (valid 7 days, document_expires_in = 604800) are returned. A warning appears if the upload failed but the dispute was still created.

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
422INVALID_REQUESTValidation failed (message: “Validation failed”). details maps field → messages; issues[] carries a stable code for issues that define one.
404ORDER_NOT_FOUNDThe referenced transaction was not found on your account.
422BAD_SCREENSHOTscreenshot_base64 could not be decoded.
422SCREENSHOT_FETCH_FAILEDscreenshot_url could not be fetched.
413SCREENSHOT_TOO_LARGEThe screenshot exceeds 10 MB.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Examples

curl -X POST https://api.bitpays.live/v1/disputes \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "payin_order_id": "cmabc123payin0001",
    "utr": "402912345678",
    "amount": 1500,
    "currency": "INR",
    "description": "Paid but order still pending"
  }'
const res = await fetch("https://api.bitpays.live/v1/disputes", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "payin_order_id": "cmabc123payin0001",
    "utr": "402912345678",
    "amount": 1500,
    "currency": "INR",
    "description": "Paid but order still pending"
  }),
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$body = <<<'JSON'
{
  "payin_order_id": "cmabc123payin0001",
  "utr": "402912345678",
  "amount": 1500,
  "currency": "INR",
  "description": "Paid but order still pending"
}
JSON;
$headers = [
  "Authorization: Bearer " . $token,
  "Content-Type: application/json",
];
$ch = curl_init("https://api.bitpays.live/v1/disputes");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.post(
    "https://api.bitpays.live/v1/disputes",
    headers={"Authorization": f"Bearer {token}"},
    json={
        "payin_order_id": "cmabc123payin0001",
        "utr": "402912345678",
        "amount": 1500,
        "currency": "INR",
        "description": "Paid but order still pending"
    },
    timeout=30,
)
data = resp.json()
GET/v1/disputes/:id

Get a dispute

Fetch one dispute, including its events and attachments.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}

Path parameters

ParameterTypeRequiredDescription
idstringrequiredThe dispute_id.

Responses

200 Dispute found

{
  "success": true,
  "dispute": {
    "id": "cms8ab12x0001…",
    "status": "UNDER_REVIEW",
    "events": [
      "…"
    ]
  }
}

Requires confirmation Only id, status and events are shown here; the remaining dispute fields are not yet documented.

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
404NOT_FOUNDNo such dispute on your account.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Examples

curl -X GET https://api.bitpays.live/v1/disputes/DISPUTE_ID \
  -H "Authorization: Bearer $TOKEN"
const res = await fetch("https://api.bitpays.live/v1/disputes/DISPUTE_ID", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$headers = [
  "Authorization: Bearer " . $token,
];
$ch = curl_init("https://api.bitpays.live/v1/disputes/DISPUTE_ID");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.get(
    "https://api.bitpays.live/v1/disputes/DISPUTE_ID",
    headers={"Authorization": f"Bearer {token}"},
    timeout=30,
)
data = resp.json()
GET/v1/disputes/:id/attachments/:attId/url

Get a dispute attachment link

Returns a fresh signed download URL for a dispute attachment.

Authentication

Bearer token from POST /v1/auth/token in the Authorization header.

Headers

HeaderRequiredValue
AuthorizationrequiredBearer {access_token}

Path parameters

ParameterTypeRequiredDescription
idstringrequiredThe dispute_id.
attIdstringrequiredThe attachment id.

Responses

200 Link issued

{
  "success": true,
  "download_url": "https://…signed-url…",
  "file_name": "proof.png",
  "content_type": "image/png"
}

Errors

Every error body is { "success": false, "code": "…", "message": "…" }. Branch on code; retry only 5xx and 429.

HTTPcodeWhen
404NOT_FOUNDDispute or attachment not found.
503STORAGE_UNCONFIGUREDFile storage is not configured.
401UNAUTHORIZEDMissing, malformed or expired bearer token.
401SESSION_REVOKEDYour session was ended (for example “log out all devices”). Get a new token.
403MERCHANT_SUSPENDEDThe merchant account is suspended.
403IP_NOT_WHITELISTEDAn IP allow-list is set and the calling IP is not on it.
429RATE_LIMIT_EXCEEDEDToo many requests in the window — back off and retry.

Examples

curl -X GET https://api.bitpays.live/v1/disputes/DISPUTE_ID/attachments/ATTACHMENT_ID/url \
  -H "Authorization: Bearer $TOKEN"
const res = await fetch("https://api.bitpays.live/v1/disputes/DISPUTE_ID/attachments/ATTACHMENT_ID/url", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.message}`);
<?php
$headers = [
  "Authorization: Bearer " . $token,
];
$ch = curl_init("https://api.bitpays.live/v1/disputes/DISPUTE_ID/attachments/ATTACHMENT_ID/url");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
import requests

resp = requests.get(
    "https://api.bitpays.live/v1/disputes/DISPUTE_ID/attachments/ATTACHMENT_ID/url",
    headers={"Authorization": f"Bearer {token}"},
    timeout=30,
)
data = resp.json()

Order statuses

Payins and payouts share one status set. On the wire they are lowercase.

StatusMeaning
createdOrder created, awaiting the customer / provider
pendingAwaiting confirmation
processingIn flight at the provider/bank
successCompleted — terminal
failedFailed — terminal
expiredPayment window elapsed — terminal
refundedRefunded — terminal
cancelledCancelled — terminal

Errors, limits & security

All errors share one envelope. Branch on code, show message.

Error envelope
{ "success": false, "code": "INVALID_CREDENTIALS", "message": "Invalid client_id or client_secret." }
HTTPCodeWhen
401INVALID_CREDENTIALS / UNAUTHORIZED / SESSION_REVOKEDBad keys, or a missing, invalid or expired token
403MERCHANT_SUSPENDED / IP_NOT_WHITELISTED / PAYIN_DISABLEDAccount/feature disabled, or calling IP not allowed
404NOT_FOUNDOrder not found or not yours
409DUPLICATE_ORDER / IDEMPOTENCY_CONFLICTReused order id or idempotency key
422INVALID_REQUEST / METHOD_NOT_SUPPORTED / INSUFFICIENT_BALANCEValidation failed or business rule violated
429RATE_LIMIT_EXCEEDEDToo many requests
503PAYMENT_TEMPORARILY_UNAVAILABLENo provider available — safe to retry

Rate limits

ScopeLimit
Unauthenticated, per IP100 requests / 60s
Authenticated, per merchant300 requests / 60s
POST /v1/auth/token20 requests / 60s

IP whitelist

Optionally lock API access to specific source IPs from the merchant dashboard → Security. When set, calls from any other IP return 403 IP_NOT_WHITELISTED. Leave it empty to allow all IPs. Whitelist your production server's egress IP before going live.

BitPays Payments API · v1 · server-to-server integration. Amounts in whole units of the currency. Base URLs — production api.bitpays.live, staging api.staging.bitpays.live (pre-production, connected to live payment channels). Keep API keys and webhook secrets server-side only.