Create Withdrawal
Pays a member's balance out to an external address. member_id, dchain_id,
amount and address are required; the asset follows from the network.
amount is what the destination receives — the fee is charged on top of it.
/api/withdrawalsAuth: RequiredAnswers 201. Quote the fee first with
Withdrawal Fees — it returns the total fee and
the total that will be debited for exactly this amount, network and destination.
client_withdrawal_id is optional, and worth sending: an id that has already been
used is refused with 1001, so a repeated request cannot create a second payout.
- Generate one id per intended payout and send it with the request.
- If the call times out, retry with the same id — either it goes through, or
1001means the first attempt was already accepted. The refusal is not a copy of the first response. - Either way,
GET /api/withdrawals?member_id=…&client_withdrawal_id=…returns the payout and its current status.
The member needs amount + fee on the balance, not amount. So whenever there is
a fee, a payout of exactly the whole balance cannot go through.
Call Withdrawal Fees first: it returns
total_fee and total_amount (= amount + total_fee) for this exact request.
For a "send everything" flow, quote first and then send balance − total_fee.
This is the one call that sends funds to an address you supply, and the token in the header authorises it on its own. Validate the destination address in your own code before calling, and keep the token server-side.
Request Body
member_idnumberRequiredThe member whose balance is paid out.
dchain_idstringRequiredThe network to pay out on, from List Assets.
The asset is derived from it — there is no asset_id field on this call.
amountstring | numberRequiredThe amount the destination receives. The fee is charged on top, so the
balance is debited amount + fee. Accepted as a string or a number; send a
string to avoid float rounding.
addressstringRequiredDestination address.
address_tagstringDestination memo, for networks that use one (XRP, XLM, TON).
client_withdrawal_idstringYour own id for this payout. Optional — but see the warning below. It is also a filter on List Withdrawals, which is how you check whether a payout landed.
Response
201, with the created payout.
The payout comes back with its id, its uuid, the fee that was applied,
operation_type, and status — which starts at aml_processing. Read it back with
Get Withdrawal to follow it to a terminal state.
Errors
Beyond the shared errors:
| Code | Meaning |
|---|---|
1001 | A field is invalid or the object is not yours — the message names it: member_id, dchain_id, or client_withdrawal_id is not unique for owner |
1003 | Amount, balance or address failed validation; the message carries the detail |
2066 | This network needs a destination tag as well as an address |
2002 | The core refused the payout; the reason is in the message |
2070 | Payouts are switched off for the moment — retry later |
3009 | The core is in maintenance — retry later |