Get started

Errors & rate limits

Predictable error shapes, idempotent writes and documented limits.

Error shape

Every failure returns the same envelope. request_id identifies the exact call — include it when you contact support. details is present on validation failures.

{
  "success": false,
  "request_id": "req_9f2c…",
  "mode": "live",
  "error": {
    "code": "QUOTE_EXPIRED",
    "message": "This quote expired. Request a new one.",
    "details": { }
  }
}

IDs

Treat every id as an opaque string and store it in a column of up to 64 characters. Check the prefix if you need to tell kinds apart, never the length: today's lengths are listed so you can size columns, not to validate against.

IdFormat today
request_idreq_ + 20 hex characters (24 in all), in test and live alike.
user_codeLive: usr_ + 32 hex (36 in all). Test: usr_test_ + 24 hex (33 in all).
withdrawal_idLive: INR_WD_… (from 25 Nov 2026, INR_WD_ + a base-36 time + _ + 16 hex; older ids keep their form). Test: wd_test_ + 16 hex (24 in all). The same value as a withdrawal's transaction_id.
sip_idA whole number in webhooks and the payments API; the activity feed and GET /partner/sips also give it as sip_ + that number. Endpoints that take a SIP id accept both forms.

Error codes

FieldTypeDescription
INVALID_AMOUNT400optionalAmount missing or non-positive. On a withdrawal: missing, not a number, or outside ₹100–₹5,00,000 (details.field is "amount_inr").
INVALID_BANK_ACCOUNT_ID400optionalWithdrawals: bank_account_id is missing or not a positive whole number. details.field names it.
INVALID_USER_CODE400optionaluser_code is missing or doesn't look like usr_….
INVALID_SIP_ID400optionalA SIP id isn't a number. Send it as 16176 or sip_16176 (GET /partner/sips/:sip_id and its …/installments, …/stop-preview, …/withdraw and …/stop, sip_id on /partner/transactions/all).
INVALID_STATUS400optionalGET /partner/sips: a status filter value isn't one of pending_authorisation, active, paused, cancelled, completed, failed or all.
INVALID_RECEIVER400optionalMobile number malformed.
QUOTE_EXPIRED400optionalQuote confirmed after its 10-minute TTL.
INSUFFICIENT_BALANCE400optionalYou don't hold enough of the asset. On a withdrawal: the user's withdrawable INR, or the INR held through your integration, is below amount_inr. Sandbox withdrawals give this code too (they used to give INSUFFICIENT_USER_BALANCE).
SANDBOX_ONLY400optionalEndpoint is sandbox-only (e.g. /sandbox/reset).
INVALID_ASSET400optionalAsset was not "gold" or "silver".
INVALID_FUNDING_SOURCE400optionalfunding_source on /buy/quote was not "partner_wallet" or "user_inr_wallet".
INVALID_INTERVAL400optionalPrice-history interval was not "day" or "hour".
INVALID_FROM400optionalPrice-history from date was not YYYY-MM-DD.
INVALID_TO400optionalPrice-history to date was not YYYY-MM-DD.
INVALID_RANGE400optionalPrice-history from is later than to.
INVALID_CODE400optionalKYC: the email verification code is wrong or has expired.
DISPOSABLE_EMAIL400optionalKYC: disposable email addresses are refused. Ask for a permanent one.
KYC_FAILED400optionalKYC: the step failed for a reason without a more specific code. Show error.message to the user.
KYC_REJECTED400optionalTest mode only: the magic PAN ZZZZZ9999Z, which always fails the PAN check.
INVALID_INPUT400optionalA KYC field failed a check (bad format, PAN not valid, name or date of birth doesn't match, under 18, already registered). details.field names it.
EMAIL_NOT_VERIFIED400optionalKYC: verify the user's email before the PAN step.
PAN_REQUIRED400optionalKYC: verify the PAN before the Aadhaar step.
PAN_PHOTO_NOT_ALLOWED400optionalKYC: the PAN photo route opens only after a verification-service outage or two failed instant PAN checks. Check v2.panPhotoAllowed in kyc/status.
INVALID_DOCUMENT400optionalKYC image isn't a readable base64 JPEG, PNG or PDF.
DOCUMENT_TOO_LARGE400optionalKYC image is over 4 MB.
INVALID_RETURN_URL400optionalDigiLocker returnUrl isn't a valid https URL.
RETURN_URL_NOT_ALLOWED400optionalDigiLocker returnUrl's origin isn't registered in your panel under Webhooks → Return origins.
INVALID_TOKEN401optionalMissing, malformed or unrecognised bearer token.
INVALID_OTP401optionalWrong OTP. 5 attempts, then the quote locks.
INSUFFICIENT_PARTNER_FUNDS402optionalYour wallet float / credit line can't cover this buy.
INSUFFICIENT_USER_BALANCE402optionalThe end user doesn't hold enough to sell or redeem — or, for a buy with funding_source "user_inr_wallet", the user's INR available to you can't cover it (details.available_inr, details.required_inr). Withdrawals use INSUFFICIENT_BALANCE instead.
API_NOT_ALLOWED403optionalYour profile isn't enabled for this capability.
IP_NOT_ALLOWED403optionalThis key is restricted by IP and the request came from an address not on its list. The message names the address we saw. See Authentication → IP restriction.
LIVE_NOT_ENABLED403optionalLive mode not activated yet. Sandbox keeps working.
SANDBOX_DISABLED403optionalSandbox access disabled for your partner.
PARTNER_DISABLED403optionalMaster kill-switch; both modes disabled.
KYC_REQUIRED403optionalThe user must complete KYC first.
SERVICE_RESTRICTED403optionalOroPocket has switched this service off for this user (for example withdrawals, or buys paid from the user's INR); details.service names it. Show error.message to the user. It stays until OroPocket lifts it, so don't retry.
BANK_ACCOUNT_BLOCKED403optionalThis bank account can't be used on OroPocket: it can't be added, an account can't be edited into it, and nothing can be withdrawn to it, for any user. Ask the user for a different account.
WALLET_NOT_CONFIGURED403optionalPartner wallet not set up — a separate onboarding step.
FEATURE_DISABLED403optionalThat feature isn't switched on for your account.
DIGILOCKER_OFF403optionalDigiLocker is switched off for your account. Verify Aadhaar with photos instead.
QUOTE_NOT_FOUND404optionalquote_id was never issued, or isn't yours.
USER_CODE_NOT_FOUND404optionaluser_code isn't recognised for your partner. Also the answer to an unknown user_code filter on /partner/transactions/all and /partner/sips.
BANK_ACCOUNT_NOT_FOUND404optionalThe bank account id isn't an active account of this user (someone else's, removed, or unknown). Given by DELETE …/bank-accounts/:id and by withdrawals.
SIP_NOT_FOUND404optionalNo SIP with that id is visible to you. Another partner's SIP answers the same way. POST /partner/sips/:sip_id/withdraw, …/stop and GET …/stop-preview also answer it for a SIP not created through POST /partner/payments/sips.
SESSION_NOT_FOUND404optionalThat DigiLocker session id doesn't exist for this user.
USER_CODE_CONSUMED409optionalSingle-use embed code already exchanged.
QUOTE_ALREADY_CONSUMED409optionalQuote already used. Replay with the original Idempotency-Key.
SIP_NOT_STOPPABLE409optionalPOST /partner/sips/:sip_id/stop and GET …/stop-preview: the SIP has already ended (details.status), or its mandate was never approved, so there is nothing to stop; details.cancel_endpoint then names POST /partner/payments/sips/:id/cancel, which discards it.
NOTHING_TO_WITHDRAW409optionalPOST /partner/sips/:sip_id/withdraw: the SIP's wallet holds no metal and no sats.
USER_INR_WALLET_UNAVAILABLE409optionalThe user's INR wallet needs a check by OroPocket before it can pay for a buy. Pay from your wallet (funding_source "partner_wallet") or contact support.
UNDER_REVIEW409optionalKYC: the user's KYC is already with OroPocket's review. Wait for kyc.approved or kyc.rejected.
ALREADY_APPROVED409optionalKYC: the user is already approved. Nothing to do.
ALREADY_VERIFIED409optionalKYC: the user's Aadhaar is already verified.
AADHAAR_OTP_RETIRED410optionalThe Aadhaar OTP endpoints are retired. Verify Aadhaar with DigiLocker or photos — see KYC.
DAILY_LIMIT_EXCEEDED429optionalThe send breaches your daily INR limit.
RATE_LIMITED429optionalToo many requests in the window — see below.
SANDBOX_DAILY_LIMIT429optionalSandbox daily budget spent. Live keys are unaffected.
BUY_STATUS_UNKNOWN502optionalRare, user-funded buys only: the buy did not complete, but we couldn't confirm whether the user's INR was taken. Don't retry the quote. If it was taken it goes back to the user's INR wallet automatically within the hour; quote again after that.
BUY_PROCESSING_FAILED502optionalFulfilment failed after the debit; whoever paid — your wallet, or the user's INR wallet — is refunded and the order voided. For a user-funded buy, details.refunded says whether the INR is already back.
PRICES_UNAVAILABLE503optionalUpstream price feed is down.
PRICE_UNAVAILABLE503optionalLive prices can't be read for a SIP call: POST /partner/sips/:sip_id/withdraw, …/stop, GET …/stop-preview, or a sandbox installment simulate. Nothing has changed; retry in a minute.
PROVIDER_UNAVAILABLE503optionalThe verification service is briefly unavailable. Retry later; for PAN, the photo route opens.

Idempotency

Send an Idempotency-Key header on mutating endpoints (buy, sell, send, gift and delivery confirms, payment orders and SIPs, and the SIP withdraw and stop calls) to make retries safe. On SIP withdraw and stop, a key is tied to its SIP: the same key on another SIP is a new request. Any string up to 100 characters — a UUID is ideal.

POST /partner/users/:user_code/withdrawals does not honour it. Before you resubmit a withdrawal whose outcome you don't know, check GET /partner/users/:user_code/withdrawals.

Keys are scoped to your partner profile and endpoint and stay valid for at least 24 hours. Reusing one returns the original response with no new side effects, flagged by an idempotent_replay field in the envelope and an Idempotent-Replayed: true response header.

curl -X POST https://api.oropocket.com/partner/buy/confirm \
  -H "Authorization: Bearer oro_live_xxx" \
  -H "Idempotency-Key: 8f14e45f-cea1-4b2c-9d3a-1f2e3d4c5b6a" \
  -d '{"quote_id":"tqt_xxx"}'
If a confirm times out, retry it with the same key. Without one you risk a duplicate — or a QUOTE_ALREADY_CONSUMED you can't safely interpret.

Rate limits

FieldTypeDescription
POST /auth/request-otp5 / 15 minoptionalPer (IP, mobile).
POST /auth/verify-otp10 / 15 minoptionalPer (IP, mobile).
Authenticated endpoints1,200 / minoptionalPer partner, sandbox and live together, by default — not per IP, so calls from all your servers share it. OroPocket can set a different limit for your account. Counted per calendar minute.
Unauthenticated endpoints120 / minoptionalPer IP. The embed exchange and OTP routes have tighter limits of their own.
Sandbox, all endpoints1000 / dayoptionalPer partner, cumulative. Resets 00:00 IST. Live is not capped this way.

The per-minute limit on authenticated calls is per partner: every Bearer call your account makes in the calendar minute counts, from however many servers. Every authenticated response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (epoch seconds, the start of the next minute) for it, so you can see where you stand without waiting to be blocked. Past the limit you get 429 RATE_LIMITED with a Retry-After in seconds.

The sandbox daily cap is per partner too and counts every authenticated request you make in sandbox, whatever the endpoint and whether it succeeds or fails validation — so a tight polling loop spends it just as fast as real testing does. Rotating your sandbox token does not reset it. Past the cap you get 429 SANDBOX_DAILY_LIMIT with a Retry-After, and on that response the X-RateLimit headers describe the daily cap (reset at the next 00:00 IST). Your live token keeps working throughout.

If a genuine integration needs more than 1000 sandbox calls a day, ask — the ceiling is configurable per partner.

Responses also carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (no X- prefix). They count per IP: 120 a minute for unauthenticated calls, and a flood ceiling of 6,000 a minute for Bearer calls, far above the per-partner limit. Back off when either Remaining reaches zero rather than retrying blindly.

Every request you make is logged in the dashboard with its status and error code — debug a failed call with request logs.