https://sandbox-api.polygon.technology/v0.13, so no real money moves.
You need curl and sandbox API credentials. The same requests work in production against https://api.polygon.technology/v0.13 with production credentials.
1
Get sandbox credentials
Request access to receive sandbox credentials.Once approved, open the OMS Dashboard and go to API Keys. Generate a secret key and copy both the key (it starts with
Request OMS access
Submit your details to get sandbox credentials.
sk_sdbx_) and its secret. The secret is shown only once.2
Exchange your key for a bearer token
You never send the API key on ordinary requests. Exchange the key and secret for a bearer token:Notice that Every other
projectMode is sandbox. The token is valid for up to 5 minutes; expiresIn on the response is the remaining lifetime in seconds. Send it on every other request in this tutorial:POST in this tutorial also needs an Idempotency-Key header. Use a new UUID for each new request, and send the same key again only to retry that exact request.If a later request returns
401, your token has expired. Run this step again and continue. If POST /auth/token returns 429, wait for the number of seconds in the Retry-After header.3
Create a customer
Every wallet, quote, and transaction belongs to a customer. Create an individual customer with the identifying details OMS needs to provision a wallet and open a virtual account:You get back the customer with Copy the
201:cst_ ID; you use it in every remaining step. The birthDate, residentialAddress, and identifyingInformation you sent are write-only, so they never appear in responses. Sandbox runs the same onboarding checks as production, so wait until the customer’s status is active before you continue (poll GET /customers/{customerId} or listen for the customer.* webhooks). See Sandbox and testing if a check rejects your data.If the response is 202 with "status": "processing" instead, onboarding is still running. Wait a few seconds, then send the identical request with the same Idempotency-Key. You get 202 again while it runs and 201 with the customer once it is done.If the request fails with 400, read the cause field in the error body for the specific reason, and quote the response’s Request-Id header if you contact support. Fields the API does not recognize are ignored rather than rejected, so check spelling carefully. For business customers and the full onboarding lifecycle, see Customer onboarding.4
Create a USDC wallet
Give the customer a custodial wallet that holds USDC on Polygon. OMS manages the keys, so there is nothing for the customer to sign.Copy the
wlt_ ID. In sandbox the address lives on Polygon Amoy, the Polygon testnet.If the response is 202 instead, the wallet is still being provisioned. Poll the URL in the Location header (GET /wallets/operations/{operationId}) until its status is complete, then take the wallet ID from walletId.5
Create a virtual account
A virtual account gives the customer a dedicated US bank account number. Each deposit to it is converted to USDC and delivered to the destination you set, with no further call from you. Point it at the wallet you just created:Copy the Once it is
va_ ID. The account starts in pending because OMS provisions the underlying bank account asynchronously. Read it every few seconds until its status is active:active, the response includes depositInstructions.bankUs[]: the account number, routing number, and the rails that reach the account. In your application, these are the details you show the customer so they can send a bank transfer.Virtual accounts need a virtual account provider configured for your project and the customer’s
usd endorsement to be active. If the request returns 422 DestinationWalletCryptoNotSupported, your project’s provider cannot deliver straight to an OMS wallet. Register the wallet’s address as an external account with POST /external-accounts, then send "type": "walletExternal" with that ext_ ID in details.id instead. See External accounts.6
Simulate a bank deposit
In sandbox, one call stands in for the customer’s bank transfer. Send a $10.00 ACH deposit to the virtual account:The
amount must be above 0.00 and at most 10.00. OMS now treats the deposit as received and creates a transaction that converts it to USDC and delivers it to the wallet.7
Watch the transaction complete
You did not create the transaction, so find it by listing the transactions that came from the virtual account:The response lists the transactions in The transaction’s
data. Copy the txn_ ID of the first entry and read that transaction:precursor is { "type": "virtualAccount", "id": "va_01H9Xv..." }. Its status moves from processing to completed, and subStatus shows the step it is on, such as processing.awaitingCryptoOut or completed.settled. Repeat the read every few seconds until it reaches completed.Finally, read the wallet with GET /wallets/wlt_01H9Xb.... The balances entry for usdc now shows the deposit.You have authenticated, onboarded a customer, provisioned a wallet, and completed a bank-deposit-to-USDC transaction.8
Receive webhooks instead of polling
Polling works for a first run. In your application, let OMS tell you when things change. Register a public HTTPS endpoint:The response contains
webhook and a signingKey. Store the signingKey now. Later reads do not return it. ["*"] subscribes to every event. Simulate another deposit and your endpoint receives events such as these:Each event’s
data.resource is the full resource as a GET returns it, so you rarely need to read it again. Before acting on an event, verify its Webhook-Signature header (t=<timestamp>,v1=<signature>): compute HMAC-SHA256 with your signingKey over <t>.<raw body>, compare in constant time, and reject events whose timestamp is more than five minutes old. See Receiving webhooks for a full handler and Webhook events for the catalog.What’s next
Send from a wallet
Quote and pay out from the wallet to a crypto address or the customer’s bank.
Virtual accounts
Deposit instructions, bank destinations, statuses, and the rest of the virtual account lifecycle.
Receiving webhooks
Build a handler that verifies deliveries and applies them safely.
API reference
Core concepts and the full endpoint reference.