Custody account

Custody account

Where your stablecoins wait until you convert, with deposit addresses, live balances and the pulls that fund your conversions.

Your custody account holds your USDC and USDT, in your business's name, with Superpay's custody partner. It is opened when your business is verified: after its verification is submitted, through the API or the form. The coins stay yours and stay off Superpay's books: they are never part of your Superpay balance. Superpay moves coins out of the account only when you accept a conversion, and only as many as that conversion needs.

EndpointScopeDoes
GET /v1/custodytreasury:readRetrieve your custody account: its deposit wallets, their live balances, and recent pulls
POST /v1/custody/accounttreasury:manageDeprecated. Opens the account. Use POST /v1/business-verification
Business verification ACTIVEDeposit USDC or USDTAccept a conversionSuperpay pulls what it needsINR in your balance

Retrieve your custody account#

GET/v1/custodytreasury:read

Returns the account with its deposit wallets, each balance read live from the custody partner, and the last 20 pulls.

Shell
curl https://api.withsuperpay.com/v1/custody \
  -H "Authorization: Bearer $SUPERPAY_TOKEN"

This account held 12,500.00 USD of USDC on polygon before a conversion pulled 1,000.00 USD from it.

Until you have a business verification, this returns 404 CUSTODY_ACCOUNT_NOT_FOUND: before you submit it, or, if you are verified with the form, before your people have submitted it.

The response can take a few seconds, because each balance is read from the custody partner. A balance of null means that read failed: retry. GET /v1/business-verification is the faster call when you only need the verification status.

Deposit stablecoins#

Once your business verification is ACTIVE, wallets lists where you can deposit: one entry per asset and network, typically USDC on polygon and ethereum, and USDT on tron and ethereum. Before that, wallets is empty.

  1. Pick a wallet and send its asset on its network to its address.
  2. Retrieve the account. The wallet's balance rises once the custody partner has credited the deposit.
  • balance is the wallet's value in US dollars, in cents, rounded down: 12,500.00 USDC shows as {"amount": 1250000, "currency": "USD"}.
  • Balances are read live on every request. No event announces a deposit: retrieve the account to see it.
  • How long a deposit takes to show depends on the network. No time is guaranteed.
  • Nothing you deposit appears in GET /v1/balances. It stays in custody until a conversion needs it.

In test mode#

Test-mode wallets are on test networks, although network keeps the same names: ethereum is Sepolia, polygon is Amoy, and tron is a Tron test network. Never send real coins to a test-mode address. Ask Superpay how to get test stablecoins.

How conversions use your custody account#

A conversion that sells USD is funded from your custody account.

StepWhat happens
QuoteSuperpay checks that your business verification is ACTIVE
AcceptSuperpay works out the shortfall: the conversion's sell less any USD already available in your balance. One wallet on its own must hold at least that much, read live
After acceptSuperpay works out the shortfall again and pulls it from the first wallet that holds it, in Superpay's order of preference, keeping the same asset and network end to end. It credits the shortfall to your balance as USD, and the conversion reserves and spends it
ExecutionINR is credited to your balance
  • A pull draws on one wallet only. If no single wallet holds the shortfall, accepting the conversion fails with 422 CUSTODY_BALANCE_INSUFFICIENT, even if your wallets hold enough together.
  • If a conversion fails after its pull, the USD stays in your balance, available, and your next USD conversion spends it first. It is not returned to custody automatically: ask Superpay if you want it back.
  • If the pull itself is refused, the conversion fails with failure_reason CUSTODY_TRANSFER_FAILED and nothing leaves your wallet.

The errors a conversion can meet are listed under Conversions.

Pull statuses#

Each pull is listed in pulls, newest first.

statusMeaning
PENDINGRecorded. Not yet accepted by the custody partner
SUBMITTEDAccepted. The USD was credited to your balance for the conversion
COMPLETEDThe coins have moved on chain
SETTLEDThe coins have arrived with Superpay. Final
FAILEDThe coins never left your custody account. Final

The custody account object#

FieldTypeDescription
objectstringcustody_account
idstringcus_…, the same id as your business verification
statusstringSUBMITTING or PENDING (verification PENDING), DOCUMENTS_REQUIRED (REQUIREMENTS_DUE), ACTIVE, or REJECTED. Build on the business verification instead
status_reason_codestringA reason code. Left out when SUBMITTING or ACTIVE
status_reason_messagestringWhat the code means. Present with status_reason_code
requirements_duearrayDocuments still required, as document.<type>
walletsarrayDeposit wallets. [] until the account is ACTIVE
wallets[].assetstringUSDC or USDT
wallets[].networkstringethereum, polygon or tron
wallets[].addressstringThe deposit address
wallets[].balancemoney or nullThe wallet's value in USD cents, rounded down, read live. null if it could not be read
wallets[].observed_atstringWhen balance was read. Left out when balance is null
pullsarrayThe last 20 pulls, newest first
pulls[].idstringctr_…
pulls[].conversion_idstringThe conversion it funded, fxo_…
pulls[].amountmoneyThe USD amount pulled
pulls[].asset, pulls[].networkstringThe wallet it came from
pulls[].statusstringSee Pull statuses
pulls[].created_atstringRFC 3339, UTC
livemodebooleantrue for live, false for test
created_at, updated_atstringRFC 3339, UTC

Open an account (deprecated)#

POST/v1/custody/accounttreasury:manage

The earlier form of POST /v1/business-verification, kept for existing integrations. It takes the same body and answers with the custody account instead of the verification.

  • It takes no Idempotency-Key. Repeating it is safe: the first call opens the account (201), later calls return it unchanged (200).
  • It never resubmits a rejected business. A rejected account returns 422 CUSTODY_ACCOUNT_REJECTED.
  • A business verified with the form has no use for it. Once its people have submitted, a call returns the account unchanged (200) and nothing sent is kept.

Errors#

CodeHTTPEndpointWhenWhat you do
CUSTODY_ACCOUNT_NOT_FOUND404RetrieveYou have no business verification in this mode: nothing was submitted, through the API or the formSubmit it. If you are verified with the form, wait for business.verification_updated
CUSTODY_ACCOUNT_REJECTED422Open (deprecated)The business was rejected. sub_code holds the reason codeSee business verification
INTERNAL500RetrieveYour wallets could not be listedRetry. Contact Superpay if it persists
CUSTODY_UNAVAILABLE503RetrieveYour custody account changed while it was being read. retryable is trueRetry after Retry-After

The request-body errors of POST /v1/custody/account are those of business verification.