Reference

Webhooks

Get notified the moment something happens — no polling. Every delivery is signed and retried.

Set your webhook URL and reveal your signing secret from the Webhooks page. We POST a JSON event to your URL and retry with backoff until you return a 2xx.

Events

FieldTypeDescription
buy.completedeventoptionalA buy was fulfilled and the asset credited. payment_id names the payment order it came from, or is null. funding_source says who paid for a /partner/buy/confirm buy — "partner_wallet" or "user_inr_wallet" — and is null for every other buy. rate_inr_per_gram is the rate stored on the buy: GST included for a buy paid through a payment order, GST excluded for a /partner/buy/confirm buy (the quote's rate).
sell.completedeventoptionalA sell settled into the user's INR wallet.
sip.createdeventoptionalA recurring plan (SIP) was created. status is "pending_authorisation": nothing is debited until sip.activated. See SIP events below.
sip.activatedeventoptionalA SIP's mandate was approved, or its first payment was collected, whichever comes first. Sent once per SIP for every mandate provider, and again each time a paused SIP resumes.
sip.installmenteventoptionalA SIP debit was collected and the metal credited. One per debit, with legs[] and the metal and grams at the top level. No per-gram rate (removed 25 Nov 2026).
sip.cancelledeventoptionalNew in live. A SIP has ended and will not debit again: the customer revoked the mandate, the provider cancelled it, you cancelled it, or it was stopped in the app. Sent once per SIP, with reason and cancelled_at.
sip.mandate_failedeventoptionalA SIP was never approved and has been closed. status is "cancelled" and reason "not_authorised".
sip.withdrawneventoptionalNew. A SIP's metal and cashback sats moved to the customer's main wallet, where /partner/sell can sell them: a withdraw or stop through the API or the app, or the settlement of an ended SIP. trigger says which. See sip.withdrawn below.
withdrawal.pendingeventoptionalAn INR withdrawal was created and is queued for payout.
withdrawal.completedeventoptionalThe money was sent to the user's bank account. Carries completed_at and, when known, utr.
withdrawal.failedeventoptionalThe withdrawal could not be paid, or the bank sent it back. The full amount is back in the user's INR balance (refunded: true).
payment.completedeventoptionalA payment order was paid and the metal credited. See Collect payments.
payment.failedeventoptionalA payment order closed without a purchase. refund.status "pending" means the money arrived and is being refunded or retried.
payment.expiredeventoptionalNobody paid a payment order before it expired.
payment.refundedeventoptionalA refund_due payment order was refunded to the customer.
kyc.approvedeventoptionalA user's KYC was approved — instantly (PAN + DigiLocker) or after our review. Also fires for kyc/submit and the embed's kyc.
kyc.under_revieweventoptionalA user's KYC went to OroPocket's review. data.reason says why (see KYC events below). kyc.approved or kyc.rejected follows.
kyc.rejectedeventoptionalA user's KYC was rejected. data.reason is the reviewer's message; the PAN and Aadhaar are released so the user can try again.
test.pingeventoptionalSent when you use “Send test event” in the dashboard.

Payload

Every delivery has the same envelope: event, event_id, created_at and data, nothing else. event_id is stable across retries — deduplicate on it. There is no top-level mode: sandbox deliveries carry "mode": "sandbox" inside data, and live deliveries carry no mode at all.

{
  "event": "buy.completed",
  "event_id": "evt_9f2c1a7b3d…",
  "created_at": "2026-08-08T09:12:44.000Z",
  "data": {
    "user_code": "usr_xxx",
    "transaction_id": "…",
    "asset_type": "gold",
    "amount_inr": 1000,
    "quantity_grams": 0.094907,
    "rate_inr_per_gram": 10204.08,
    "status": "completed",
    "source": "s2s",
    "payment_id": null,
    "funding_source": "partner_wallet"
  }
}

KYC events

kyc.* events go to the partner whose API drove the KYC and to the partner the user signed up through. In test mode, data also carries "mode": "sandbox". The full flow is in KYC.

{
  "event": "kyc.approved",
  "event_id": "evt_4b1e9c0a2f",
  "created_at": "2026-10-17T10:04:12.000Z",
  "data": {
    "user_code": "usr_xxx",
    "status": "approved"
  }
}

kyc.under_review reasons — informational; you don't need to act, just show the user that their KYC is being checked:

reasonWhy the KYC is in review
documents_reviewThe user sent a PAN photo or Aadhaar photos. A person checks them, usually within 24–48 h.
name_mismatchThe name on the PAN and on the Aadhaar don't match closely enough to approve automatically.
dob_unconfirmedThe date of birth couldn't be confirmed from both documents.
possible_duplicateThe identity may already belong to another OroPocket account.
identity_mismatchThe PAN and the Aadhaar may not belong to the same person.
manual_reviewAnything else our team wants to look at.

SIP events

sip.* events go to the partner the SIP was created through and to the partner the user signed up through. sip_id is the same whole number in every one of them, in GET /partner/payments/sips and in GET /partner/sips. For a SIP created through POST /partner/payments/sips, id is its ppo_… id. A SIP goes sip.created → sip.activated → one sip.installment per debit → sip.cancelled, or sip.created → sip.mandate_failed if it is never approved. What each status means is under SIP statuses. sip.withdrawn is the exception to who receives it: it goes only to the partner the SIP came through, since that is whose sellable balance the move credits.

{
  "event": "sip.created",
  "event_id": "evt_…",
  "created_at": "2026-11-24T09:00:04.000Z",
  "data": {
    "user_code": "usr_xxx",
    "sip_id": 16176,
    "sip_name": "Wedding gold",
    "asset_type": "gold",
    "frequency": "monthly",
    "installment_amount_inr": 500,
    "status": "pending_authorisation"
  }
}

sip.created, sip.activated, sip.cancelled and sip.mandate_failed share sip_id, sip_name, asset_type ("gold", "silver", or "both" for a plan that buys both), frequency, installment_amount_inr and status. sip.activated is sent once when the SIP first comes alive, for every mandate provider, and again each time a paused SIP resumes, so treat it as "this SIP will debit again" rather than as a one-off. It is usually sent before the first sip.installment, but don't rely on the order: with some mandate providers the first debit's sip.installment is sent first, and a retried delivery can arrive late.

sip.installment fields

FieldTypeDescription
user_codestringThe customer.
sip_idnumberThe SIP.
installment_refstringThis debit's reference. Unique per debit; use it to de-duplicate instalments.
amount_inrnumberWhat the customer's bank debited.
funded_amount_inrnumberWhat went to the purchase: amount_inr − fee_inr. GST-inclusive — the platform fee and the 3% GST come out of it, and the rest is metal.
fee_inrnumberGateway fee taken from this debit. 0 unless the SIP was created through POST /partner/payments/sips with the customer bearing the fee.
legs[]arrayOne entry per metal bought: asset_type, amount_inr (that metal's share of funded_amount_inr), quantity_grams and transaction_id. A plan that buys both metals has two.
statusstring"completed".
idstring | nullNew. The ppo_… id when the SIP was created through POST /partner/payments/sips, else null.
asset_typestringNew. "gold" or "silver" for one leg, "both" for two.
quantity_gramsnumberNew. Grams credited by this debit: the sum of the legs.
transaction_idstring | nullNew. The leg's transaction_id when there is one leg; null for two.
installment_numbernumber | nullNew. Which debit of the plan this is, 1 being the first, counted per metal for a plan that buys both. The same number as sip.installment_number on /partner/transactions/all. null if it could not be read.
sip_statusstring | nullNew. The SIP's status after this debit, normally "active". null if it could not be read.
Removed on 25 Nov 2026: legs[].rate_inr_per_gram and the top-level rate_inr_per_gram. SIP data no longer carries a per-gram rate. Use quantity_grams and the amounts, or the instalment's invoice (GET /partner/transactions/:transaction_id/invoice with a leg's transaction_id), which shows the price per gram. Deliveries stored before the change and replayed later keep the fields.

sip.cancelled reasons

Sent once per SIP when it stops after its mandate was approved, and also when a SIP created through POST /partner/payments/sips is stopped on purpose (by you, or in the app) before it was approved. A SIP that simply never gets approved gets sip.mandate_failed instead. Gold and silver already bought stay with the customer. For a SIP created through the payments API, id and reference are included.

reasonWho or what stopped it
customer_cancelledThe mandate provider reported that the customer revoked the mandate in their UPI app or bank.
partner_cancelledYou called POST /partner/payments/sips/:id/cancel.
stoppedIt was stopped in the OroPocket app or the embed, or by OroPocket.
mandate_cancelledThe mandate provider reported the mandate cancelled without saying who cancelled it. Most providers report a customer revoking the mandate this way, so don't read it as "not the customer".
mandate_expiredThe mandate expired.

In sandbox, POST /partner/payments/sips/:id/simulate sends sip.activated, sip.installment, sip.cancelled and sip.mandate_failed (see Collect payments → Sandbox), each with "mode": "sandbox" in data. sip.installment has the live fields above, with no per-gram rate, as in live. The other three carry the sandbox SIP object (id, sip_id, status, name, fee, …) with the live fields added, and a simulated failure's sip.mandate_failed has status "failed". POST /partner/sips/:sip_id/stop on a sandbox SIP sends sip.cancelled with reason partner_cancelled. Sandbox does not send sip.created or sip.withdrawn: sandbox SIP debits are credited straight to the test user's sellable balance, so nothing ever moves out of a SIP wallet.

sip.withdrawn fields

Sent after a SIP's holdings move to the customer's main wallet, where /partner/sell can sell them: once per move, to the partner the SIP came through only. That covers POST /partner/sips/:sip_id/withdraw and /stop, POST /partner/payments/sips/:id/cancel, a withdraw or stop by the customer in the app, and the settlement of a SIP that ended another way (for example, the customer revoked the mandate). It is not sent when nothing moved.

FieldTypeDescription
user_codestringThe customer.
sip_idnumberThe SIP.
idstring | nullThe ppo_… id when the SIP was created through POST /partner/payments/sips, else null, as on the other sip.* events.
withdrawn[]arrayOne entry per metal moved: asset_type, quantity_grams, value_inr (the grams at our sell rate at the moment of the move; nothing is sold) and transaction_id (the move's reference). Empty when only cashback sats moved.
cashback_sats_withdrawnnumberBitcoin cashback sats moved, as a count.
total_value_inrnumberThe sum of withdrawn[].value_inr. Sats are not included.
triggerstring"withdraw" (a withdraw through the API or the app, including one that settled an ended SIP), "stop" (a stop or cancel through the API, or a stop in the app) or "settle" (an ended SIP settled by OroPocket).
sip_statusstring | nullThe SIP's status after the move: "active" after a withdraw on a running SIP, "cancelled" after a stop. null if it could not be read.

There is no per-gram rate. Milestone sats that are forfeited are not in the event; the stop response and GET /partner/sips/:sip_id/stop-preview give them.

Withdrawal events

withdrawal.* events go to the partner that placed the withdrawal and to the partner the user signed up through. withdrawal_id is the id POST …/withdrawals gave (also its transaction_id) and the id on each GET …/withdrawals row. See Bank accounts & withdrawals.

FieldTypeDescription
user_codestringThe customer.
withdrawal_idstringINR_WD_… in live, wd_test_… in sandbox. Treat it as opaque: live ids made from 25 Nov 2026 are INR_WD_ + a base-36 time + _ + 16 hex characters, and older ones keep their earlier form.
statusstring"pending", "completed" or "failed", matching the event.
amount_inr · fee_inr · net_amount_inrnumberGross amount, payout fee, and what reaches the bank.
created_atstringWhen the withdrawal was created.
completed_at · utrstringwithdrawal.completed only. utr, the bank reference, is present when known.
failed_at · failure_reason · refundedstring · string | null · truewithdrawal.failed only. The amount is back in the user's INR balance.
reversedtruewithdrawal.failed only, when a payout that had completed was sent back by the bank.
{
  "event": "withdrawal.completed",
  "event_id": "evt_…",
  "created_at": "2026-11-24T10:02:41.000Z",
  "data": {
    "user_code": "usr_xxx",
    "withdrawal_id": "INR_WD_…",
    "status": "completed",
    "amount_inr": 2500,
    "fee_inr": 0,
    "net_amount_inr": 2500,
    "created_at": "2026-11-24T08:15:02.000Z",
    "completed_at": "2026-11-24T10:02:40.000Z",
    "utr": "…"
  }
}

Headers

FieldTypeDescription
X-OroPocket-Signaturestringoptionalsha256=<hex HMAC>. See below — signed over `{timestamp}.{rawBody}`, NOT the body alone.
X-OroPocket-TimestampstringoptionalUnix seconds. Part of the signed payload; reject old timestamps to stop replays.
X-OroPocket-EventstringoptionalThe event name, e.g. buy.completed.
X-OroPocket-Event-IdstringoptionalSame value as event_id in the body — use it to dedupe.

If your receiver authenticates us with its own credential (e.g. x-access-key), add it under Webhooks in your dashboard — up to 10 static headers, attached to every delivery including retries. One set covers both sandbox and live. OroPocket-set headers can never be overridden.

Verify the signature

The signature is computed over `${timestamp}.${rawBody}` — the timestamp, a literal dot, then the raw request body. Hashing the body on its own will fail every time. Use the raw bytes, before any JSON parsing or re-serialisation.
import crypto from "crypto";

// rawBody must be the raw string/Buffer, e.g. express.raw({type:"application/json"})
function verify(rawBody, headers, secret) {
  const signature = headers["x-oropocket-signature"] || "";
  const timestamp = headers["x-oropocket-timestamp"] || "";

  // Reject replays: ignore anything older than 5 minutes.
  const age = Math.abs(Date.now() / 1000 - Number(timestamp));
  if (!timestamp || age > 300) return false;

  const expected =
    "sha256=" +
    crypto
      .createHmac("sha256", secret)
      .update(`${timestamp}.${rawBody}`)
      .digest("hex");

  const a = Buffer.from(expected);
  const b = Buffer.from(signature);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Retries

We make one immediate attempt with a 10 second timeout, then retry failures up to 5 attempts total. Any 2xx acknowledges the delivery; non-2xx responses and timeouts are retried on this backoff:

FieldTypeDescription
After attempt 130 secondsoptionalFirst retry.
After attempt 22 minutesoptional
After attempt 310 minutesoptional
After attempt 460 minutesoptional
After attempt 56 hoursoptionalFinal attempt; then the delivery is marked failed.

The retry queue lives in the database, so retries survive restarts. Return a 2xx as soon as you've persisted the event and do slow work asynchronously — otherwise the 10s timeout will cause duplicate deliveries.

Test-fire an event and watch deliveries (with replay) from the Webhooks page — no need to wait for a real transaction.
To register an endpoint and fire a test event from the dashboard, see Set up and test-fire a webhook.