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.
| Id | Format today |
|---|---|
| request_id | req_ + 20 hex characters (24 in all), in test and live alike. |
| user_code | Live: usr_ + 32 hex (36 in all). Test: usr_test_ + 24 hex (33 in all). |
| withdrawal_id | Live: 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_id | A 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
| Field | Type | Description | |
|---|---|---|---|
| INVALID_AMOUNT | 400 | optional | Amount 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_ID | 400 | optional | Withdrawals: bank_account_id is missing or not a positive whole number. details.field names it. |
| INVALID_USER_CODE | 400 | optional | user_code is missing or doesn't look like usr_…. |
| INVALID_SIP_ID | 400 | optional | A 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_STATUS | 400 | optional | GET /partner/sips: a status filter value isn't one of pending_authorisation, active, paused, cancelled, completed, failed or all. |
| INVALID_RECEIVER | 400 | optional | Mobile number malformed. |
| QUOTE_EXPIRED | 400 | optional | Quote confirmed after its 10-minute TTL. |
| INSUFFICIENT_BALANCE | 400 | optional | You 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_ONLY | 400 | optional | Endpoint is sandbox-only (e.g. /sandbox/reset). |
| INVALID_ASSET | 400 | optional | Asset was not "gold" or "silver". |
| INVALID_FUNDING_SOURCE | 400 | optional | funding_source on /buy/quote was not "partner_wallet" or "user_inr_wallet". |
| INVALID_INTERVAL | 400 | optional | Price-history interval was not "day" or "hour". |
| INVALID_FROM | 400 | optional | Price-history from date was not YYYY-MM-DD. |
| INVALID_TO | 400 | optional | Price-history to date was not YYYY-MM-DD. |
| INVALID_RANGE | 400 | optional | Price-history from is later than to. |
| INVALID_CODE | 400 | optional | KYC: the email verification code is wrong or has expired. |
| DISPOSABLE_EMAIL | 400 | optional | KYC: disposable email addresses are refused. Ask for a permanent one. |
| KYC_FAILED | 400 | optional | KYC: the step failed for a reason without a more specific code. Show error.message to the user. |
| KYC_REJECTED | 400 | optional | Test mode only: the magic PAN ZZZZZ9999Z, which always fails the PAN check. |
| INVALID_INPUT | 400 | optional | A 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_VERIFIED | 400 | optional | KYC: verify the user's email before the PAN step. |
| PAN_REQUIRED | 400 | optional | KYC: verify the PAN before the Aadhaar step. |
| PAN_PHOTO_NOT_ALLOWED | 400 | optional | KYC: the PAN photo route opens only after a verification-service outage or two failed instant PAN checks. Check v2.panPhotoAllowed in kyc/status. |
| INVALID_DOCUMENT | 400 | optional | KYC image isn't a readable base64 JPEG, PNG or PDF. |
| DOCUMENT_TOO_LARGE | 400 | optional | KYC image is over 4 MB. |
| INVALID_RETURN_URL | 400 | optional | DigiLocker returnUrl isn't a valid https URL. |
| RETURN_URL_NOT_ALLOWED | 400 | optional | DigiLocker returnUrl's origin isn't registered in your panel under Webhooks → Return origins. |
| INVALID_TOKEN | 401 | optional | Missing, malformed or unrecognised bearer token. |
| INVALID_OTP | 401 | optional | Wrong OTP. 5 attempts, then the quote locks. |
| INSUFFICIENT_PARTNER_FUNDS | 402 | optional | Your wallet float / credit line can't cover this buy. |
| INSUFFICIENT_USER_BALANCE | 402 | optional | The 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_ALLOWED | 403 | optional | Your profile isn't enabled for this capability. |
| IP_NOT_ALLOWED | 403 | optional | This 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_ENABLED | 403 | optional | Live mode not activated yet. Sandbox keeps working. |
| SANDBOX_DISABLED | 403 | optional | Sandbox access disabled for your partner. |
| PARTNER_DISABLED | 403 | optional | Master kill-switch; both modes disabled. |
| KYC_REQUIRED | 403 | optional | The user must complete KYC first. |
| SERVICE_RESTRICTED | 403 | optional | OroPocket 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_BLOCKED | 403 | optional | This 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_CONFIGURED | 403 | optional | Partner wallet not set up — a separate onboarding step. |
| FEATURE_DISABLED | 403 | optional | That feature isn't switched on for your account. |
| DIGILOCKER_OFF | 403 | optional | DigiLocker is switched off for your account. Verify Aadhaar with photos instead. |
| QUOTE_NOT_FOUND | 404 | optional | quote_id was never issued, or isn't yours. |
| USER_CODE_NOT_FOUND | 404 | optional | user_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_FOUND | 404 | optional | The 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_FOUND | 404 | optional | No 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_FOUND | 404 | optional | That DigiLocker session id doesn't exist for this user. |
| USER_CODE_CONSUMED | 409 | optional | Single-use embed code already exchanged. |
| QUOTE_ALREADY_CONSUMED | 409 | optional | Quote already used. Replay with the original Idempotency-Key. |
| SIP_NOT_STOPPABLE | 409 | optional | POST /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_WITHDRAW | 409 | optional | POST /partner/sips/:sip_id/withdraw: the SIP's wallet holds no metal and no sats. |
| USER_INR_WALLET_UNAVAILABLE | 409 | optional | The 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_REVIEW | 409 | optional | KYC: the user's KYC is already with OroPocket's review. Wait for kyc.approved or kyc.rejected. |
| ALREADY_APPROVED | 409 | optional | KYC: the user is already approved. Nothing to do. |
| ALREADY_VERIFIED | 409 | optional | KYC: the user's Aadhaar is already verified. |
| AADHAAR_OTP_RETIRED | 410 | optional | The Aadhaar OTP endpoints are retired. Verify Aadhaar with DigiLocker or photos — see KYC. |
| DAILY_LIMIT_EXCEEDED | 429 | optional | The send breaches your daily INR limit. |
| RATE_LIMITED | 429 | optional | Too many requests in the window — see below. |
| SANDBOX_DAILY_LIMIT | 429 | optional | Sandbox daily budget spent. Live keys are unaffected. |
| BUY_STATUS_UNKNOWN | 502 | optional | Rare, 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_FAILED | 502 | optional | Fulfilment 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_UNAVAILABLE | 503 | optional | Upstream price feed is down. |
| PRICE_UNAVAILABLE | 503 | optional | Live 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_UNAVAILABLE | 503 | optional | The 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"}'QUOTE_ALREADY_CONSUMED you can't safely interpret.Rate limits
| Field | Type | Description | |
|---|---|---|---|
| POST /auth/request-otp | 5 / 15 min | optional | Per (IP, mobile). |
| POST /auth/verify-otp | 10 / 15 min | optional | Per (IP, mobile). |
| Authenticated endpoints | 1,200 / min | optional | Per 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 endpoints | 120 / min | optional | Per IP. The embed exchange and OTP routes have tighter limits of their own. |
| Sandbox, all endpoints | 1000 / day | optional | Per 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.