curl and then with @kashdao/sdk. You need a partner test key with a webhook URL, which ZeroID issues on request: see Keys.
1. Create the user’s account
When a user of Harbour Sports Picks opts in, create their account with your own id for them, their own address in your app, their country and their consent:202 with account.accountId and status: "provisioning". Keep the accountId with your user:
2. Wait for account.active
Your webhook endpoint receives account.active with the account’s Solana depositAddress. Or poll until status is active:
3. Fund it and read the balance
Ask ZeroID to fund the account with staging test USDC, and send theaccountId (or the depositAddress) and the amount. You cannot mint test USDC yourself; see Sandbox. Once ZeroID confirms, read the balance:
balance.availableAtomic is what the account can spend, in atomic USDC: "25000000" is 25 USDC.
4. Find a market and quote it
Markets and quotes act for no account, so send noKash-Account header:
5. Trade
amount is decimal USDC ("10" is 10 USDC). The answer is 201 with the trade in pending, and your endpoint receives trade.completed, trade.failed or trade.rejected when it ends.
6. Withdraw
Quote first, then withdraw.Idempotency-Key is required:
202 with the withdrawal in pending. You receive withdrawal.submitted, then withdrawal.completed when the USDC reaches the user’s destination.
The same with the SDK
This uses@kashdao/sdk 0.4.0 (see SDK). Pass the user’s accountId as account on the calls made for them; the SDK sends it as the Kash-Account header. The partnerAccounts methods name the account in the path instead.
Next
Accounts
The full account lifecycle.
Go-live checklist
Before production.