Conversions
Convert USD from your custody account into INR in your balance. Quote, accept, and follow the conversion to the end.
A conversion turns US dollars into INR in your Superpay balance, which payouts spend. The dollars come from the stablecoins in your custody account: when you accept a quote, Superpay pulls what the conversion needs from one of your wallets.
| Step | Call | Result |
|---|---|---|
| 1 | POST /v1/conversions/quotes | A quote with the exact sell, buy and expires_at |
| 2 | POST /v1/conversions | A conversion in CREATED |
| 3 | GET /v1/conversions/{id}, or the fx.executed and fx.failed events | EXECUTED: the buy amount is in your balance. Or FAILED |
Before you convert:
- Your business verification is
ACTIVE: itsconversions_enabledistrue. - One of your custody wallets holds at least the USD value you will sell. See Deposit stablecoins.
| Endpoint | Scope | Idempotency-Key |
|---|---|---|
POST /v1/conversions/quotes | fx:quote | Required |
GET /v1/conversions/quotes/{id} | fx:read | — |
POST /v1/conversions/quotes/{id}/reject | fx:quote | — |
POST /v1/conversions | fx:execute | Required |
GET /v1/conversions/{id} | fx:read | — |
/v1/fx/quotes, /v1/fx/quotes/{id}, /v1/fx/orders and /v1/fx/orders/{id} are older names for the same endpoints and return the same objects. Use the /v1/conversions paths. An Idempotency-Key belongs to the path you first used it on: it does not replay across the two names.
Amounts are integers in minor units (Money):
| Currency | Minor units | 1 unit is |
|---|---|---|
USD | 2 | 100 |
INR | 2 | 100 |
Create a quote#
/v1/conversions/quotesfx:quotePrices converting a fixed amount of USD into INR. A quote moves no money: it reserves nothing, and reads neither your balance nor your wallets. A quote that sells USD does check that your business verification lets you convert.
sell_currencystringRequiredUSD, upper case. Your custody account funds conversions that sell USD: your stablecoins are sold for their dollar value. Do not send USDC or USDT here: conversions sell dollars only, and a quote that sells a stablecoin is refused with 422 QUOTE_UNAVAILABLE.
buy_currencystringRequiredINR. Must differ from sell_currency.
sell_amountobjectRequiredThe amount to convert, as a money object: amount (integer in minor units, greater than 0) and currency (must equal sell_currency). The spread is taken out of this amount.
buy_amountobjectInstead of sell_amount: the amount to receive, in buy_currency. Only for conversions priced by Superpay's dealing desk; any other quote that sends it returns 422 QUOTE_UNAVAILABLE. Send sell_amount or buy_amount, never both.
curl https://api.withsuperpay.com/v1/conversions/quotes \
-H "Authorization: Bearer $SUPERPAY_TOKEN" \
-H "Idempotency-Key: 3f6c1a52-8e4b-4d0a-9b7e-2c5d9f1e6a07" \
-H "Content-Type: application/json" \
-d '{
"sell_currency": "USD",
"buy_currency": "INR",
"sell_amount": { "amount": 100000, "currency": "USD" }
}'{
"object": "fx_quote",
"id": "fxq_01M2FPWJ40B1MVJFJRHGFWTP27",
"status": "ACTIVE",
"sell": { "amount": 100000, "currency": "USD" },
"buy": { "amount": 8308250, "currency": "INR" },
"rate": { "value": "83.08250000", "base": "USD", "quote": "INR" },
"spread": { "amount": 500, "currency": "USD" },
"spread_bps": 50,
"origin": "API",
"expires_at": "2026-09-30T10:21:00Z",
"livemode": false,
"created_at": "2026-09-30T10:20:00Z"
}This quote sells 1,000.00 USD. The spread is 5.00 USD, and the remaining 995.00 USD converts into ₹83,082.50. The figures are illustrative: your spread and rate are on each quote. The response has no Location header.
How a quote is priced#
sellequals yoursell_amountexactly. It includes the spread.spreadis Superpay's spread, in the sell currency:spread_bpsofsell, rounded half to even to a whole minor unit. On very small amounts it can be0.buyis exactly what an executed conversion credits to your balance.rate.valueis the all-in rate after the spread:buydivided bysellin whole units, rounded to 8 decimal places. The amounts are authoritative; the rate is for display.- The price comes from Superpay's banking partner at the moment you ask. A currency it does not sell, or a pair or amount it cannot price, returns
422 QUOTE_UNAVAILABLE. - A price that had already expired when it reached Superpay is not handed out: the request returns
503 PROVIDER_UNAVAILABLE, no quote is created, and you ask again.
A dealing-desk quote that fixes buy_amount works the other way round: buy is your amount, and sell is what it costs, spread included and rounded up.
Quote expiry#
A quote can be accepted until expires_at. That is at most 60 seconds after created_at, and can be sooner. Always read expires_at rather than assuming 60 seconds.
After expires_at the quote reads as EXPIRED, and accepting it returns 422 QUOTE_EXPIRED. An expired quote costs nothing. Request a new one.
Large conversions#
Superpay can have its dealing desk price conversions at or above a set amount, counted in the currency of the side you fix. Ask Superpay whether this is enabled, and from what amount. Such a quote comes back 201 with status PENDING_OTC and origin OTC:
While PENDING_OTC | Once priced |
|---|---|
The side you fixed has your amount. The other side, rate and spread are zero | status becomes ACTIVE, with the desk's sell, buy, rate and spread |
expires_at is how long the desk has to price it, a few hours by default. Unpriced by then, it reads EXPIRED | expires_at is reset: accept before it, typically within 15 minutes |
Accepting returns 422 QUOTE_PENDING_OTC | Accept it like any quote |
No event announces that a desk quote is priced. Retrieve the quote to see it. created_at stays the time you asked.
Retrieve a quote#
/v1/conversions/quotes/{id}fx:readReturns the quote with its current status. The example is the quote above after the conversion below used it.
idstringRequiredPath parameter. An fxq_ id.
curl https://api.withsuperpay.com/v1/conversions/quotes/fxq_01M2FPWJ40B1MVJFJRHGFWTP27 \
-H "Authorization: Bearer $SUPERPAY_TOKEN"{
"object": "fx_quote",
"id": "fxq_01M2FPWJ40B1MVJFJRHGFWTP27",
"status": "CONSUMED",
"sell": { "amount": 100000, "currency": "USD" },
"buy": { "amount": 8308250, "currency": "INR" },
"rate": { "value": "83.08250000", "base": "USD", "quote": "INR" },
"spread": { "amount": 500, "currency": "USD" },
"spread_bps": 50,
"origin": "API",
"expires_at": "2026-09-30T10:21:00Z",
"livemode": false,
"created_at": "2026-09-30T10:20:00Z"
}There is no endpoint to list quotes.
Decline a quote#
/v1/conversions/quotes/{id}/rejectfx:quoteTells Superpay you will not take an ACTIVE quote. It becomes REJECTED and can no longer be accepted. Returns 200 OK with the quote.
curl -X POST https://api.withsuperpay.com/v1/conversions/quotes/fxq_01M2FPWJ40B1MVJFJRHGFWTP27/reject \
-H "Authorization: Bearer $SUPERPAY_TOKEN"- No body and no
Idempotency-Key. Repeating it is safe: a quote that is alreadyREJECTEDorEXPIREDis returned unchanged, with200. - A quote that a conversion has used returns
409 QUOTE_CONSUMED. - Declining is optional: a quote you ignore simply expires.
The quote object#
| Field | Type | Description |
|---|---|---|
object | string | Always fx_quote. |
id | string | fxq_ followed by 26 characters. |
status | string | ACTIVE, PENDING_OTC, EXPIRED, CONSUMED or REJECTED. See Quote statuses. |
sell | money | The amount you sell, spread included. |
buy | money | The amount an executed conversion credits to you. |
rate | object | value: decimal string with 8 decimal places, buy units per sell unit after the spread. base: the sell currency. quote: the buy currency. |
spread | money | Superpay's spread, in the sell currency. Included in sell. |
spread_bps | integer | The spread in basis points. |
origin | string | API: priced automatically when you asked. OTC: priced by Superpay's dealing desk. |
expires_at | string | When the quote stops being acceptable. UTC, whole seconds, e.g. 2026-09-30T10:21:00Z. |
livemode | boolean | true for live credentials, false for test. |
created_at | string | When you asked for the quote. UTC, whole seconds. |
Quote statuses#
| Status | Meaning | What you do |
|---|---|---|
ACTIVE | Priced and acceptable until expires_at. | Accept it before expires_at, or decline it. |
PENDING_OTC | Waiting for Superpay's dealing desk to price it. | Retrieve it until it is ACTIVE. |
EXPIRED | expires_at passed without an acceptance. Final. | Request a new quote. |
CONSUMED | A conversion was created from it. Final, even after expires_at. | Track the conversion. |
REJECTED | You declined it. Final. | Request a new quote if you need one. |
| From | To |
|---|---|
ACTIVE | CONSUMED, REJECTED or EXPIRED |
PENDING_OTC | ACTIVE or EXPIRED |
Each quote backs at most one conversion.
Accept a quote#
/v1/conversionsfx:executeAccepts an ACTIVE quote at exactly its quoted amounts, and creates the conversion. The quote becomes CONSUMED in the same step.
quote_idstringRequiredThe fxq_ id of an ACTIVE quote created with credentials in the same mode.
Before it creates the conversion, Superpay checks that your custody account can fund it:
- Your business verification is
ACTIVE. - It works out the shortfall: the quote's
sellless any USD alreadyavailablein your balance. - One wallet on its own holds at least the shortfall, read live. If none does, the request returns
422 CUSTODY_BALANCE_INSUFFICIENT, and itsdetailgives the largest single wallet's balance.
It does not move or reserve anything yet.
curl https://api.withsuperpay.com/v1/conversions \
-H "Authorization: Bearer $SUPERPAY_TOKEN" \
-H "Idempotency-Key: 9a2e7d14-5c3b-4f8e-a1d6-0b7c4e2f9d53" \
-H "Content-Type: application/json" \
-d '{ "quote_id": "fxq_01M2FPWJ40B1MVJFJRHGFWTP27" }'{
"object": "fx_order",
"id": "fxo_01M2FPY3K8D5N2Q7R9S4T6V8WX",
"quote_id": "fxq_01M2FPWJ40B1MVJFJRHGFWTP27",
"status": "CREATED",
"sell": { "amount": 100000, "currency": "USD" },
"buy": { "amount": 8308250, "currency": "INR" },
"spread": { "amount": 500, "currency": "USD" },
"livemode": false,
"created_at": "2026-09-30T10:20:50Z"
}The response carries Location: /v1/fx/orders/{id}, the older name of /v1/conversions/{id}. A new conversion is always CREATED.
Then, in the background, Superpay works out the shortfall again and pulls it from the first of your wallets that holds it, credits it to your balance in USD, reserves the whole sell and runs the conversion. The pull appears in your custody account's pulls.
Retrieve a conversion#
/v1/conversions/{id}fx:readReturns the conversion's current state. Its object is fx_order.
idstringRequiredPath parameter. An fxo_ id.
curl https://api.withsuperpay.com/v1/conversions/fxo_01M2FPY3K8D5N2Q7R9S4T6V8WX \
-H "Authorization: Bearer $SUPERPAY_TOKEN"{
"object": "fx_order",
"id": "fxo_01M2FPY3K8D5N2Q7R9S4T6V8WX",
"quote_id": "fxq_01M2FPWJ40B1MVJFJRHGFWTP27",
"status": "EXECUTED",
"sell": { "amount": 100000, "currency": "USD" },
"buy": { "amount": 8308250, "currency": "INR" },
"spread": { "amount": 500, "currency": "USD" },
"livemode": false,
"created_at": "2026-09-30T10:20:50Z",
"executed_at": "2026-09-30T10:20:58Z"
}{
"object": "fx_order",
"id": "fxo_01M2FPY3K8D5N2Q7R9S4T6V8WX",
"quote_id": "fxq_01M2FPWJ40B1MVJFJRHGFWTP27",
"status": "FAILED",
"sell": { "amount": 100000, "currency": "USD" },
"buy": { "amount": 8308250, "currency": "INR" },
"spread": { "amount": 500, "currency": "USD" },
"failure_reason": "CUSTODY_TRANSFER_FAILED: the custodian refused to move the funds",
"livemode": false,
"created_at": "2026-09-30T10:20:50Z"
}There is no endpoint to list or cancel conversions.
The conversion object#
| Field | Type | Description |
|---|---|---|
object | string | Always fx_order. |
id | string | fxo_ followed by 26 characters. |
quote_id | string | The quote this conversion executes. |
status | string | CREATED, EXECUTING, UNKNOWN, EXECUTED or FAILED. See Conversion statuses. |
sell | money | Copied from the quote. Reserved, then debited, from your USD balance. |
buy | money | Copied from the quote. Credited to your INR balance on EXECUTED. |
spread | money | Copied from the quote. Included in sell. |
failure_reason | string | Why the conversion failed. Present only when status is FAILED. See Failure reasons. |
livemode | boolean | true for live credentials, false for test. |
created_at | string | UTC timestamp, whole seconds. |
executed_at | string | When the conversion was recorded as executed. Present only when status is EXECUTED. |
The conversion does not repeat the rate. Read it from the quote.
Conversion statuses#
CREATEDEXECUTINGEXECUTED| Status | Meaning | What you do |
|---|---|---|
CREATED | Accepted. Superpay is pulling the shortfall from your custody account. Nothing is reserved yet. | Wait. It usually moves on within seconds, once Superpay's custody partner accepts the pull. |
EXECUTING | sell is reserved from your USD balance and the conversion is in progress. | Wait. |
UNKNOWN | The outcome of the conversion is not confirmed yet. Superpay is confirming it with its banking partner. sell stays reserved. | Keep waiting. Don't create a replacement conversion. If it stays UNKNOWN for more than 24 hours, contact support with the conversion id. |
EXECUTED | Done. buy is in your INR available balance. Final. | Use the funds for payouts. |
FAILED | Not converted. Final. | Read failure_reason. Request a new quote to try again. |
| From | To |
|---|---|
CREATED | EXECUTING, or FAILED with INSUFFICIENT_FUNDS or a CUSTODY_ reason |
EXECUTING | EXECUTED, FAILED or UNKNOWN |
UNKNOWN | EXECUTED or FAILED |
EXECUTED and FAILED never change. A conversion does not expire and cannot be cancelled.
Failure reasons#
failure_reason starts with a code. Match on the code, the part before any : . Any text after it is informational and can change. Events carry the code alone.
| Code | Meaning | Your balance | What you do |
|---|---|---|---|
CUSTODY_ACCOUNT_REQUIRED | You have no custody account to fund the conversion. | Nothing moved. | Submit your business verification. If you are verified with the form, wait for your people to submit it. |
CUSTODY_KYB_PENDING | Your business verification is not ACTIVE yet. | Nothing moved. | Wait for it, or supply what it asks for. |
CUSTODY_ACCOUNT_REJECTED | Your business verification was rejected. | Nothing moved. | See business verification. |
CUSTODY_BALANCE_INSUFFICIENT | No single wallet held the shortfall when the pull was made. | Nothing moved. | Deposit more, then request a new quote. |
CUSTODY_TRANSFER_FAILED | Superpay's custody partner refused or could not make the pull. | Nothing left your wallet. | Request a new quote. Contact Superpay if it repeats. |
INSUFFICIENT_FUNDS | Your USD balance did not cover sell when it was reserved. | Nothing was reserved. | Request a new quote. |
PROVIDER_REJECTED | The conversion was declined, or could not be sent. | The reserved USD returns to available. | Request a new quote. Contact support if it repeats. |
PROVIDER_FAILED | The conversion failed during execution. | The reserved USD returns to available. | Request a new quote. Contact support if it repeats. |
USD pulled for a conversion that then fails stays in your balance as available, and your next USD conversion spends it first. It is not returned to your custody account automatically: ask Superpay if you want it back. See also Failures on objects.
Effect on balances#
Read balances with GET /v1/balances. Using the example above, with no USD in your balance and 12,500.00 USD in your chosen wallet:
| Conversion status | USD available | USD reserved | Wallet balance | INR available |
|---|---|---|---|---|
| Before accepting | 0 | 0 | 1250000 | 0 |
CREATED | 0 | 0 | 1250000 until the pull | 0 |
EXECUTING or UNKNOWN | 0 | 100000 | 1150000 | 0 |
EXECUTED | 0 | 0 | 1150000 | 8308250 |
FAILED with a CUSTODY_ reason | 0 | 0 | 1250000 | 0 |
FAILED after the pull | 100000 | 0 | 1150000 | 0 |
- The whole
sell, spread included, is reserved and then debited. - The credit is exactly the quoted
buy. It does not move with the market after the quote. - A quote on its own never changes a balance.
- A currency you have never held is absent from
GET /v1/balancesrather than listed as0. INR first appears once a conversion isEXECUTED.
Track a conversion#
Superpay sends fx.executed or fx.failed when a conversion ends. Subscribe a webhook to fx.*, or poll GET /v1/conversions/{id} every few seconds, backing off if it stays CREATED, EXECUTING or UNKNOWN. No event announces EXECUTING or UNKNOWN: if neither event has arrived when you expect, retrieve the conversion.
Idempotency and retries#
Creating a quote and accepting one require an Idempotency-Key: 16 to 64 printable ASCII characters, no spaces. A UUID works. The full rules are in Idempotency.
- Lost response. Resend the same body with the same key, on the same path. You get the original response with the header
Idempotent-Replayed: true. For conversions this is the only way to recover one: a new key on the same quote returns409 QUOTE_CONSUMED, and conversions cannot be looked up by quote. - Replays are snapshots. A replayed quote can still say
ACTIVE, and a replayed conversion can still sayCREATED. Call theGETendpoint for the current state. - One key, one request. A key reused with a different body, or on a different path, returns
409 IDEMPOTENCY_KEY_REUSED. Use separate keys for the quote and the acceptance. - 4xx responses are stored. Resending with the same key returns the same error, e.g.
QUOTE_EXPIREDorCUSTODY_KYB_PENDING, even once its cause has gone. After you change the request, or the cause clears, use a new key. - 5xx responses are not stored. Retry
PROVIDER_UNAVAILABLE,CUSTODY_UNAVAILABLEandINTERNALwith the same key.
Errors#
Errors are problem documents. Branch on code; detail is human-readable and can change. Authentication, scope and idempotency errors are the same on every endpoint and are listed on Errors.
{
"type": "about:blank",
"title": "FAILED_PRECONDITION",
"status": 422,
"detail": "the quote has expired; request a new one",
"instance": "/v1/conversions",
"code": "QUOTE_EXPIRED",
"request_id": "req_01M2FPZ6A1C3E5G7J9K2M4N6P8"
}Create a quote errors#
| Code | HTTP | When | What you do |
|---|---|---|---|
REQUEST_BODY_INVALID | 400 | The body is empty or not valid JSON, has an unknown field or a field of the wrong JSON type, or has a money object with an extra key, an amount that is not a JSON integer, or a currency that is not 3 to 5 uppercase letters. | Fix the body. Resend with a new key. |
INVALID_ARGUMENT | 400 | A field failed validation. errors[] names each field: a currency code that is not 3 to 5 uppercase letters, the same currency on both sides, neither or both of sell_amount and buy_amount (reported on sell_amount), or an amount that is not positive or not in its side's currency. | Fix the fields. Resend with a new key. |
CURRENCY_UNSUPPORTED | 400 | A well-formed currency code that Superpay does not know. | Sell USD and buy INR. Resend with a new key. |
AMOUNT_TOO_SMALL | 400 | sell_amount does not cover the spread. | Increase the amount. Resend with a new key. |
QUOTE_UNAVAILABLE | 422 | Superpay's banking partner cannot price this request, e.g. sell_currency is one it does not sell, such as USDC or USDT, the pair or amount is not supported, or buy_amount was sent for a quote the dealing desk does not price. | Sell USD, or change the request. Resend with a new key. |
PROVIDER_UNAVAILABLE | 503 | Pricing is temporarily unavailable, or the price received had already expired. No quote is created. retryable is true and Retry-After is 5. | Retry with the same key. |
QUOTE_INCONSISTENT | 500 | The price could not be used, for example because the amount converts to less than one minor unit. | Retry with the same key. If it persists, change the amount or contact support. |
A USD quote can also return the first three custody errors.
Custody errors#
Returned when a quote selling USD, or its acceptance, cannot be funded from your custody account.
| Code | HTTP | Endpoint | When | What you do |
|---|---|---|---|---|
CUSTODY_ACCOUNT_REQUIRED | 422 | Quote, accept | You have no business verification in this mode: nothing was submitted, through the API or the form. | Submit it, or wait for business.verification_updated if you are verified with the form. Then deposit stablecoins. |
CUSTODY_KYB_PENDING | 422 | Quote, accept | Your business verification is not ACTIVE yet. sub_code is KYC_PENDING, or KYC_REQUIREMENTS_DUE with requirements_due listing the documents it needs. | Wait for ACTIVE, or upload the documents. Then ask again with a new key. |
CUSTODY_ACCOUNT_REJECTED | 422 | Quote, accept | Your business verification was rejected. sub_code holds its reason code. | See business verification. |
CUSTODY_BALANCE_INSUFFICIENT | 422 | Accept | No single wallet holds the shortfall. sub_code is CUSTODY_BALANCE_INSUFFICIENT. | Deposit more into one wallet, or convert a smaller amount. Use a new key. |
CUSTODY_UNAVAILABLE | 503 | Accept | Superpay's custody partner did not answer. retryable is true and Retry-After is 5. | Retry with the same key. |
Accept a quote errors#
| Code | HTTP | When | What you do |
|---|---|---|---|
REQUEST_BODY_INVALID | 400 | The body is empty or not valid JSON, has an unknown field, or quote_id is not a JSON string. | Fix the body. Resend with a new key. |
INVALID_ARGUMENT | 400 | quote_id is missing or is not a well-formed fxq_ id. | Send a real quote id. Resend with a new key. |
QUOTE_NOT_FOUND | 404 | No quote with this id for your credentials, including a quote from the other mode. | Check the id and mode. Resend with a new key. |
QUOTE_CONSUMED | 409 | The quote already has a conversion. | If you are retrying your own request, resend it with its original key to get the conversion. Otherwise request a new quote. |
QUOTE_EXPIRED | 422 | expires_at has passed. | Request a new quote and accept it before its expires_at, with a new key. |
QUOTE_PENDING_OTC | 422 | The dealing desk has not priced the quote yet. | Wait until it is ACTIVE, then accept it with a new key. |
QUOTE_REJECTED | 422 | You declined the quote. | Request a new quote. |
It can also return the custody errors. A problem with the quote itself is reported before a custody error.
Decline a quote errors#
| Code | HTTP | When | What you do |
|---|---|---|---|
QUOTE_NOT_FOUND | 404 | No quote with this id for your credentials. Also returned for a malformed id, or a quote from the other mode. | Check the id and mode. |
QUOTE_CONSUMED | 409 | A conversion already used the quote. | Nothing to decline. Track the conversion. |
Retrieve errors#
| Code | HTTP | When | What you do |
|---|---|---|---|
QUOTE_NOT_FOUND | 404 | Retrieve a quote: no quote with this id for your credentials. Also returned for a malformed id, or a quote from the other mode. | Check the id and which credentials you are using. |
FX_ORDER_NOT_FOUND | 404 | Retrieve a conversion: no conversion with this id for your credentials. Also returned for a malformed id, or a conversion from the other mode. | Check the id and which credentials you are using. |
Test and live are separate: quotes and conversions created with test credentials are not visible with live credentials. See Test mode and live mode and Testing.