Skip to main content
The guides call one small HTTP client, shown here in Python, Node and Go. Copy it into your project, then log in with POST /dapi/v1/auth/challenge and POST /dapi/v1/auth/token.
A fuller Node version is at hevn-inc/dapi-sdk. It also checks that the payload you sign matches the payment you requested. The package is unsupported, so use it as a model for your client.

Surface

The client reads HEVN_API, HEVN_KEY_PEM and HEVN_EMAIL, listed in Sandbox. HEVN_API must end in /dapi/v1, for example https://sandbox-api.hevn.finance/dapi/v1. The old /v1 base returns 404 with no redirect, so check the suffix at start-up.
In the Go tabs api is the client variable and hevn is the package. A variable named hevn shadows the package and the file does not compile.

Bind an account

acting_as returns a bound copy of the HTTP client that sends X-Hevn-Account on each call. Acting as a client lists where the header is optional, required and refused. The /client* routes require the header. To read your account, bind your cl_… id, the userId returned by login.

Install

Load the developer key

Sign bytes

Signatures are ECDSA P-256 over SHA-256, DER-encoded, then base64. See Signature format.

Wrap the key

Key binds the two signing functions and the public key to one loaded key.

Log in

Token lifetimes are in Sessions.

Hold the session

Session stores the tokens and refreshes the access token 60 seconds before it expires, or on demand.

Send a request

call raises the error envelope as a typed error, waits Retry-After on a 429, refreshes the token once on a 401, and adds X-Hevn-Account when the client is bound.

Download an export

GET /dapi/v1/transactions/export streams a file. download sends the same headers, raises the same typed error and writes the bytes to disk.

Confirm until it settles

confirm_until_settled follows Retrying a confirm. On funding_attempt_expired it raises ReopenRequired (Go returns ErrReopenRequired). Re-open with the same Idempotency-Key.

Poll a read

Use poll_until for client provisioning, KYB review, virtual account activation and payin settlement. The delay backs off from 1 to 8 seconds with jitter.

Go helpers

Go

Assemble the client