📘CoinSend
Last updated
Last updated
Data Submitter: This permission grants sub-accounts the ability to create a dispatch record.
Data Approver: This permission grants sub-accounts the ability to approve the data submitted by the data submitter in the dispatch record. The sub-account with data approval permission (first approver) will verify the data, including business ID, sending address, sending amount, token type, and associated flag.
Execution Approver: This permission grants sub-accounts the ability to execute the dispatch record created by the data submitter and approved by the data approver. The sub-account with execution approval permission (second approver) will verify the data's business ID and select the dispatching wallet for execution.
The corporate entity can execute an automated withdrawal through the CoinsDo API. To do this, the corporate entity can assign the required roles (data submitter, data approval, execution approval) to a server-based sub-account.
Another approach to semi-automate the dispatch process is by assigning specific roles to a server-based account while allowing other general accounts to handle different roles. For instance, the server-based account can automatically create a dispatch record, while sub-accounts with data approval and execution approval permissions will manually approve the record.
A corporate user initiates a withdrawal.
The corporate business's server uses the CoinsDo API to request a dispatch.
Corporate's appointed approver A signs the data submitted in the dispatch record.
Corporate's appointed approver B signs the data in the dispatch record and submits the final dispatch record with both approvers' signatures to CoinDo's server.
Upon receiving the signed dispatch record, CoinDo's server submits the data to the corporate dispatching wallet through the CoinsDo API.
The corporate dispatching wallet verifies both approvers' signatures before executing the dispatch request.
Enterprises can utilize the CoinsDo API for automatic issuance. To implement an automatic issuance plan, the enterprise needs to assign submission data, data approval, and execution approval permissions to a server account.
Additionally, the enterprise can assign certain automatic issuance processes to both server and regular accounts. For instance, the server account can automatically create an issuance record, while the other two regular accounts can manually approve the data and execute the approval for that specific issuance record.
A corporate user initiates a withdrawal.
The corporate business's server uses the CoinsDo API to request a dispatch and signs the data before sending it to CoinsDo's server.
Upon receiving the signed dispatch record, CoinsDo's server submits the data to the CoinSend through CoinsDo's API.
CoinSend verifies both signatures before executing the dispatch request.
Access points
Execute a dispatch request
Address request
{URL}/v1/withdraw
Request method
POST
Request parameters
Body parameters
data
Yes
string
Content(JSON, refer below)
Data parameters
apiKey
Yes
string
API KEY
submitAccount
Yes
string
Submit account(Client side approval account)
address
Yes
string
Dispatch address
amount
Yes
string
Dispatch amount
coinsDoId
Yes
string
CoinsDoID (refer to currency control)
businessId
Yes
string
Business ID (cannot be repeated)
businessScene
No
string
Business scenario
timestamp
Yes
string
Timestamp (seconds or milliseconds)
txMemo
No
string
On-chain remarks (XRP and EOS tag can insert here)
reviewUuid
No
string
Reviewer (first approver) device UUID (Data section must be filled for approved transaction)
reviewSign
No
string
Reviewer (first approver) signature (Data section must be filled for approved transaction) To undergo RSA-SHA256 signing: businessId=business ID&address=address&amount=amount&coinsDoId=coinsDoId,❗ Important:Remove the trailing zero for the amount. For example: Convert 1.010 to 1.01. Convert 1.000 to 1.
reviewRemark
No
string
Reviewer(first approver) remarks
targetDeviceUuid
No
string
Executor (second approver) decides on the targeted CoinSend client (Data section must be filled for approved transaction)
approveUuid
No
string
Executor (second approver) device UUID (Data section must be filled for approved transaction)
approveSign
No
string
Executor (second approver) signature (Data section must be filled for approved transaction. To sign using RSA-SHA256, businessId=Business ID&deviceUuid=CoinSend client UUID)&targetAddrIndex=specify sending address index number)
approveRemark
No
string
Executor (second approver) remarks
Request Example
Response example
Response status
4006
Currently do not support the tokens dispatched
4008
Business ID already exists
4009
Failed to add new dispatch record
4011
Failed to verify device for approval
4012
Data approver's (first approver) device does not exists
4013
Approval device not bound to approval account
4014
Data approver's (first approver) signature verification failed
4015
Authorization code verification failed
4016
Authorization code expired or does not exists
4017
Device verification failed
4018
Ading new approval device failed
4019
Signature verification through SHA256 with RSA failed
4020
Corporate sub-account could not be found
4021
Does not have data submission rights
4022
Does not have data approver (first approver) rights
4023
Exceeded token’s largest decimal
4024
Incomplete parameters found for execution approver (first approver)
4025
Wrong format for dispatch address
4026
Incomplete parameters found for execution approver (second approver)
4027
Device does not exists for execution approver (second approver)
4028
Failed to verify execution approver (second approver)’s signature
4029
Does not have the rights to do execution approval (second approval)
4030
Dispatch amount exceeded the limit designated for your role as the data approver (first approver)
4031
Dispatch amount exceeded the limit designated for your role as the execution approver (second approver)
4032
Failed to verify wallet
4033
Wallet does not exists
4038
Failed to verify dispatch address
4039
Withdrawal account has been deactivated
4040
Data approver (first approver)’s bound device has been deactivated
4041
Execution approver (second approver)’s bound device has been deactivated
4046
Failed to verify whitelisted dispatch address
4047
Dispatch address not found amongst the whitelist
4048
Dispatch amount is less than the minimum required amount
4049
Data submitter account does not belong to an API account
4056
The approval device associate with the data approval account does have the required permission. Contact your merchant account holder to assign permission for this account
4057
The approval device associated with the execution approval account does have the required permission. Contact your merchant account holder to assign permission for this account
4065
Failed to verify business ID
4066
Failed to verify supported tokens
4067
CoinsDoId must be a whole number
4069
Sub account does not exists
4070
Select a coin
Callback notice
data
Yes
string
Content(JSON string,refer below)
Data parameter
businessId
Yes
string
Business ID
withdrawStatus
Yes
string
Dispatch status (1. Dispatch successfully 2. Dispatch rejected 5. Dispatch cancelled) Able to extend word length, will include more state callback in the future
txHash
No
string
Transaction hash
blockNumber
No
string
Block height
txTime
No
string
Transaction confirmation timestamp(seconds)
txFee
No
string
Gas fees
feeSymbol
No
string
Gas fees unit/symbol
businessScene
No
string
Business scenario(The data returned from submitting through API)
txMemo
No
string
On-chain remarks
mainnet
Yes
string
mainnet
coinName
Yes
string
currency
Request example
Response example
Endpoint description
Retrieve information from CoinSend client.
Request URL
{URL}/v1/deviceDetail
Request method
POST
Body parameter
data
Yes
string
Content(JSON string,refer below)
data parameter
apiKey
Yes
string
API KEY
deviceUuid
Yes
string
CoinSend client UUID
Request example
Response example
data parameter
onlineStatus
Yes
string
Online status (0: offline 1: online)
useStatus
Yes
string
Use status (0: stopped 1: In Use)
devicePublicKey
Yes
string
Wallet's public key
deviceRegisterTime
Yes
string
Timestamp when you register wallet (seconds)
deviceExpiryTime
Yes
string
Timestamp of wallet’s expiry (seconds)
addressList
No
array
List of sending addresses
Address List parameter
currency
Yes
string
Token/currency
flag
Yes
string
Contract address/Token ID
address
Yes
string
Wallet's sending address
balance
No
string
Balance in address
Response status
4032
Failed to verify wallet
4033
Wallet does not exists
4034
Failed to verify address
4035
Failed to verify token
4036
Failed to verify the balance
4037
Failed to verify the wallet’s network status
Endpoint description
Adding a new approval device
Request URL
{URL}/v1/reviewAdd
Request method
POST
Body parameter
data
Yes
string
Content(JSON string,refer below)
Data parameter
apiKey
Yes
string
API Key
reviewPubkey
Yes
string
Verify device’s public key
plainText
Yes
string
String to be verified
signature
Yes
string
Signature (Signs plainText using SHA256 with RSA)
authorizationCode
Yes
string
Device’s authorization code
Request example
Response example
Data parameter
uuid
Yes
string
Authorization device’s uuid
Response status
4015
Failed to verify authorization code
4016
The authorization code does not exist or has expired
4018
Failed to add new authorization device
4019
Failed to sign through SHA256 with RSA