Skip to main content
Money reaches an external account as USDC on its network and leaves it by a transfer the customer’s wallet sends. Name the account by its acc_… id: accountId on POST /dapi/v1/banks, destinationAccount on POST /dapi/v1/payins, sourceAccount on POST /dapi/v1/payouts. The routes take the client’s id in X-Hevn-Account. The common flows are in Virtual accounts, Payins and Payouts.

Virtual accounts

Call POST /dapi/v1/banks with a product and the accountId. Each incoming payment is delivered as USDC to the account’s address.
Response 201, Location: /dapi/v1/banks/us?accountId=acc_9f2c…
Statuses, blockers[] and the account details are in Virtual accounts. Fields: Request a receiving account.

On-chain payins

Call POST /dapi/v1/payins with originChainId, the account as destinationAccount, and refundAddress. The payin is delivered as USDC on the account’s network.
Give the payer address, chainId, amount and memo from the instructions call, then poll GET /dapi/v1/payins/{payinId}. Statuses and payer mistakes are in Payins. Fields: Create an incoming transfer quote.
A refund goes to refundAddress on the origin chain. Use an address the payer controls on that chain.

Payouts

Save a contact, then call POST /dapi/v1/payouts with the account as sourceAccount. publicKey is not used.
Response 201, Location: /dapi/v1/payouts/po_4c8a…
approval, debit and intent are absent. Fields: Create an outgoing transfer.

Send the transfer

Have the customer’s wallet call the ERC-20 transfer(toAddress, amountAtomic) on tokenAddress, from fromAddress, on chainId. Read authorization before status. With wallet, awaitingSignature means the transfer is outstanding.
A transfer that does not match transfer leaves the wallet and does not fund the payout. Send one transfer per payout, with the amount, sender and deadline of transfer.
POST /dapi/v1/payouts/{payoutId}/confirm returns 400 invalid_request with details.reason funded_by_wallet_transfer.

Check the instruction

Check transfer on your server before your product asks the wallet to sign. toAddress is the address the payout is collected at. Your server cannot derive it, so pass it to the wallet as returned.

Track the payout

Poll GET /dapi/v1/payouts/{payoutId}. The statuses are in Track it to completion.

Refusals

Other payout codes are in Errors.

Balance and ledger

Paging, filters and exports are in Balances and transactions.

Sandbox

In the sandbox, fund the address through a virtual account or a public testnet faucet, and send the payout transfer to the faucet account. The products, limits and refusals are in Accounts.

Next: Sandbox and going live