Send/Read Transfer
POST /transfers
Transfer to specific user.
API 端点 URL
https://api.mixin.one/transfers
请求体
{
"asset_id": "the asset's asset_id which you are transferring",
"opponent_id": "the user's user_id who you are transferring",
"amount": "e.g.: "0.01", supports up to 8 digits after the decimal point",
"pin": "Encrypted PIN",
"trace_id": "Used to prevent duplicate payment, optional",
"memo": "Maximally 200 characters, optional",
}
请求示例
curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/transfers --data PAYLOAD
Response
{
"data": {
"type": "transfer",
"snapshot_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"opponent_id": "a465ffdb-4441-4cb9-8b45-00cf79dfbc46",
"asset_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"amount": "-10",
"opening_balance": "20",
"closing_balance": "10",
"trace_id": "7c67e8e8-b142-488b-80a3-61d4d29c90bf",
"memo": "hello",
"created_at": "2018-05-03T10:08:34.859542588Z"
}
}
警告
- Once the transfer API is successfully called, it means that the data has been confirmed by all nodes, and the data is irreversible.
- One can't transfer money to themself.
- The encrypted PIN is one-time, and the PIN must be re-encrypted every time you transfer.
- It is strongly recommended that developers use
trace_id
to handle duplicate transfers, and always attach this parameter to transfers. - All you need is to do it over again if you encounter
500
error in a transfer. - If you need to process a large number of concurrent transactions and process hundreds or thousands of transfers per second, it is recommended to use multiple accounts to transfer and send transactions.
- When a transfer error happens, pay attention to the "extra" field in the returned error message.https://api.mixin.one/network/chains
- If you see the error
20119
password is wrong when you are transferring, do not try again. It is recommended to call the PIN Verification API to confirm.