Skip to main content
Create one client, register a wallet address for it and receive one emulated bank payin on that address in the sandbox. Start by logging in with POST /dapi/v1/auth/challenge and POST /dapi/v1/auth/token.

Before you start

  1. Sign up at https://sandbox.gethevn.com.
  2. Open Settings → Partner program → Developer and create a developer key. Set its IP allowlist to your machine’s egress address.
  3. Save the private key to $HEVN_KEY_PEM with mode 0600.
  4. Ask HEVN to enable client creation for your sandbox account.
  5. Create a wallet on Base Sepolia whose key you hold. It stands in for your customer’s wallet. Export its address as HEVN_WALLET.
  6. Set the environment and install the dependencies.
Developer keys, clients and tokens are per environment. The examples read these variables:
The sandbox runs on Base Sepolia with testnet tokens. A payout, escrow or payin is capped at 1, and a faucet credit at 5 to an account holding less than 1 across its main wallet and sub accounts. The sandbox money routes take 60 calls per account per hour. See Sandbox limits.

Steps

1

Log in

Run the login code in Sessions. Export accessToken as HEVN_ACCESS_TOKEN. The Python, Node and Go tabs use the reference client.
2

Create the client

Call POST /dapi/v1/clients with the company’s legal name and email. Do not send X-Hevn-Account.
Response 202
Export the id as HEVN_CLIENT_ID. A retry with the same Idempotency-Key returns the same client. Fields: Create a client.
3

Register the address

Call POST /dapi/v1/client/accounts with the client id in X-Hevn-Account.
Response 201
While HEVN reviews the client request, the call returns 404 account_not_found. Repeat it with the same body. Rules and refusals are in External accounts.
4

Wait for the client

Poll GET /dapi/v1/client every two seconds until status is ready.
Response
The statuses are in Statuses.
5

Verify the client

Write the KYB document with PUT /dapi/v1/client/kyb as in Write the document. When it returns ready: true, call POST /dapi/v1/client/kyb/complete, then approve the application with POST /dapi/v1/sandbox/kyb/status.
In production HEVN reviews the application (Track the application).
6

Request a virtual account

Call POST /dapi/v1/banks with a product and the accountId, then poll GET /dapi/v1/banks/{product} with the same accountId until status is active.
Response
While status is preparing, read blockers[] (What still blocks it). A product that cannot deliver to the address returns 409 account_destination_unsupported.
7

Emulate a bank payin

Call POST /dapi/v1/sandbox/deposits with the bankId. Do not send accountId or token.
Response: 200
On 202, repeat the request with the same Idempotency-Key. The testnet USDC is sent to $HEVN_WALLET.
8

Read the ledger and balance

Call GET /dapi/v1/transactions with accountId, then GET /dapi/v1/client/accounts/{accountId}.
balance is refreshed when the stored value is older than a minute. GET /dapi/v1/client/balance has no row for the account.
To pay out from the address, fund it with testnet USDC and follow Payouts. A payout to a bank contact takes $HEVN_BANK_ID as bankId. The sandbox faucet route does not credit an external account.

Next: External accounts