Skip to main content

Withdrawal

POST /withdrawals

Submit a withdrawal request.

info

You will need to create a withdrawal address first to withdrawal. Also, it costs fee to withdrawal. To get the fee, use GET /assets/{asset_id}/fee.

Endpoint URL

 https://api.mixin.one/withdrawals

Authentication and options

Authorization
Authorized
LimitationNo limitation

Payload

{
"address_id": "the address id created by [POST /withdrawals](/docs/api/withdrawal/address-add)",
"amount": "e.g. '100000'",
"trace_id": "an uuid to prevent duplicate withdrawals",
"pin_base64": "encrypted PIN",
"asset_id": "Optional, the uuid of asset",
"destination": "Optional, the public key of recipient",
"tag": "Optional, the memo of the recipient",
}

explaination of request parameters

  1. address_id if user have an address, they can use the address id create withdrawal
  2. Optional, use asset_id, destination and tag created withdrawal

How to generate TIP Pin

"TIP:WITHDRAWAL:CREATE:" + address_id + amount + fee + trace_id + memo

pin_base64 is the sha256-256 sum of above value

Example request

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/withdrawals --data '{"amount":"100","address_id":"43d61dcd-e413-450d-80b8-101d5e903357","pin":"xDcSiAsvsekYpnxEShqLgecvQ4GhP7o660nOodK9BG7k+xsszxO56Yg6DQLWtOek","trace_id":"ca90fd5b-e047-4a66-affa-2b40f026b165"}'
Response
{
"data": {
"type": "withdrawal",
"snapshot_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"transaction_hash": "axt...ze",
"asset_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"amount": "-10",
"trace_id": "7c67e8e8-b142-488b-80a3-61d4d29c90bf",
"created_at": "2018-05-03T10:08:34.859542588Z"
}
}