Skip to main content
The sandbox is the production API running against one emulated partner bank on Base Sepolia. Fund a client with POST /dapi/v1/sandbox/deposits, drive KYB, payins and payouts with the routes below, then go live. Developer keys, clients and tokens are per environment. The examples read these variables:
X-Hevn-Account selects the client (Acting as a client).

What HEVN must enable

HEVN grants these in both environments. No API call sets them.

Environment

Read the faucet account

GET /dapi/v1/sandbox/treasury returns the shared testnet faucet account that pays emulated credits and receives the funds of emulated payouts.
Response: 200
When the faucet account is out of tokens or gas, credits return 503 provider_unavailable with details.treasuryAddress and details.token.

Mint money

POST /dapi/v1/sandbox/deposits credits a client. With bankId it books an unquoted payin to that virtual account at the fixed rate. Without it, the faucet sends token to the client’s wallet, or to the sub account named in accountId, within the faucet limits. Fields: Emulate an incoming deposit.
Response: 200
202 means the faucet transfer is unconfirmed. Repeat the same request until status is settled. The amount is credited once. Identical requests without an Idempotency-Key replay the first credit at any interval. Send a new key to credit the same amount again.

Accounts

Sub accounts and external accounts run in the sandbox as in production, with these differences. accountId together with bankId returns 422 validation_failed: a credit with bankId lands on the account its virtual account was opened for. The same Idempotency-Key with another accountId returns 409 idempotency_key_reused. The responses of POST /dapi/v1/sandbox/deposits and POST /dapi/v1/sandbox/payouts/{payoutId}/status have accountId when the credit or the payout belongs to an acc_… account. After a payout from an external account, wait for the transfer to be matched before you move the payout. Until then POST /dapi/v1/sandbox/payouts/{payoutId}/status returns 409 payout_not_fundable for submitted, settled and refunded.

Decide a KYB application

A completed KYB submission stays pending until you call POST /dapi/v1/sandbox/kyb/status. The call sets the status of the client’s latest application.
The statuses, what each needs and the refusals are on Decide the client’s latest KYB application. After rfi, answer the RFI and complete the submission again, then decide the new application. After rejected, a new attempt needs a new submission. For an individual client, approved sets verifiedAt.

Settle a payin

POST /dapi/v1/sandbox/payins/{payinId}/complete emulates the payer’s bank transfer for a quoted payin.
Open the payin with POST /dapi/v1/payins/{payinId}/instructions first. The body and refusals are on Emulate the arrival of the funds.

Move a payout

Book and sign a payout as in production, then set its status with POST /dapi/v1/sandbox/payouts/{payoutId}/status.
The statuses, which need a funded payout and the refusals are on Move an emulated outgoing transfer. A settled payout’s row in GET /dapi/v1/transactions has status: "success". failed does not return the debited amount. A return is matched to a refunded payout by amount, within 0.20. Keep test payouts more than 0.20 apart.

Limits

Production has none of these limits. sandbox_amount_limit_exceeded returns details.operation (payout, escrow, payin or faucet) and details.maximum, plus details.amount and details.currency for a payout or escrow. sandbox_faucet_balance_too_high returns details.balance, threshold and token.

Go live

Production has the same routes, bodies and error codes as the sandbox, with partner banks in place of the emulator. Ask HEVN to enable your integrator account, then create a production developer key.

Re-create per environment

A key used against the other environment’s host fails at login with 401 invalid_credentials. The response does not name the environment, so check HEVN_API first.

Timing

In production, the steps you trigger yourself in the sandbox wait on a reviewer or the partner bank. Poll as described in Status codes.

Production refusals

Production returns these for causes the emulator does not have. With HEVN Connect, also handle the sign-in window results access_denied, already_registered, already_linked and expired. Handle the funding codes for payouts from your integrator account.

Checklist

1

Switch the host

Set HEVN_API to https://api.hevn.finance/dapi/v1 and load the production key.
2

Remove sandbox calls

/dapi/v1/sandbox/* returns 404 in production. Poll for each state in Timing.
3

Handle 429, 401 and 5xx

Handle 429, 401 and 5xx as in Errors. Log X-Request-ID and include it in support requests.
4

Rehearse key rotation

Create a second key whose allowlist covers your hosts. Log in with it and book a payout from your integrator account with its publicKey, then delete the old key (Rotate a key).
5

Run one production payment

A payout debits the paying account and an escrow refund debits your wallet, so fund both. Link or create one client, pay a small amount to an account you control and reconcile it from GET /dapi/v1/transactions.

Next: Rails and fees