Skip to main content
A payin is an arrival of money on a Base smart wallet, a sub account or an external account, recorded as an income row on the ledger. To fix the rate and fee before the payer pays, quote it with POST /dapi/v1/payins. Send X-Hevn-Account to act for a client (Acting as a client).

Quote a bank payin

The client needs an active virtual account in the payer’s currency.
1

Create the quote

Call POST /dapi/v1/payins.
Response: 201, Location: /dapi/v1/payins/pi_2b7…
Field rules are in Create an incoming transfer quote. Payment methods are listed in Rails.
2

Request the instructions

Call POST /dapi/v1/payins/{payinId}/instructions.
Response: 200
Do not reuse the instructions for a second payment. Fields are in Open the incoming transfer.

Statuses

Poll GET /dapi/v1/payins/{payinId} until the status is final (Status codes). An unpaid payin expires without a charge and has no ledger row. No route lists payins, so store payinId when you quote. Once money arrives, a pending income row appears on the ledger. It shows rfi while the partner bank asks about the payment and ends as success or refunded.

Payer mistakes

For a payer who types the details by hand, use unsolicited wires.

Quote an on-chain transfer

Send originChainId in place of rail.
The instructions call returns:
Response: 200
Give the payer memo when it is set. Chain values are in Chain codes.

Deliver to an account

destinationAccount also takes the acc_… id of an external account or a sub account. The payin is then an on-chain transfer, so send originChainId.
refundAddress with an account key as destinationAccount returns 422 validation_failed. See External wallets and Sub accounts.

Payer details

Some rails require the payer’s account. Send it as payer on the instructions call.
details.options[].payerRequired on a refused quote shows which pairs need a payer.

Refusals

Other codes are in Errors. Indicative rates are in Fees.

Unsolicited wires to the client’s account details

A payer can send to an active virtual account at any time. Give the payer its account details from GET /dapi/v1/banks, with paymentReference when one is set. The income row from GET /dapi/v1/transactions has paymentReference, the receiving account details and remitter.
remitter is set when the partner bank reports the sender. When it is absent on a settled row, the API cannot return the sender.

Direct crypto

Read baseSmartWallet from GET /dapi/v1/client/balance and give the address to the payer. A sub account takes a transfer of its token at its address in the same way (Sub accounts).
HEVN tracks USDC and EURC on Base. Other tokens, and these tokens on other chains, do not become a balance or a transaction.

Sandbox

A quoted payin does not settle until you call the route in Settle a payin. For the unquoted shapes, see Mint money.

Next: Payouts