CoinSend
Last updated
Last updated
To initiate a transfer via API.
Server sub-account is required to setup API integration. You may refer to guide below on how to create a server sub-account.
Submitter – Responsible for creating dispatch records.
Reviewer – Reviews and approves dispatch records submitted by the Submitter.
Executor – Determines which CoinSend client and address the the funds will be sent from.
Below is the graphical illustration of how transfer works in CoinsDo.
End user submits a withdrawal request on the corporate platform.
Corporate platform initiates a transfer request via the API.
CoinsDo server forwards the request to the Reviewer.
The Reviewer approves (signs) and forwards Signature A to the Executor.
The Executor approves, selects the CoinSend client and wallet address to use, and forwards both Signatures A and B back to the CoinsDo server.
The data and both signatures are forwarded to the selected CoinSend client.
The CoinSend client verifies the data and signatures, then executes the transaction.
CoinSend client sync transaction status with CoinsDo server.
CoinsDo server notify platform via API callback.
Corporate can skip 1 of all of the approval process by including either reviewSign (skip 1st-level approval) , or both reviewSign and approveSign (skip both level approval) in the API request parameter to achieve semi or fully automated transfer, as such.
Semi-automated
Fully automated
POST
/v1/withdraw
data
Yes
string
Content(JSON, refer below)
Data content
apiKey
Yes
string
API KEY
submitAccount
Yes
string
Submit account(Client side approval account)
address
Yes
string
Receive address
amount
Yes
string
Receive 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
UUID of the executor's device. This is mandatory if you want to automate 1st-level approval.
reviewSign
No
string
Reviewer signature, generate using RSA-SHA256 algorithm with the following data. This is mandatory if you want to automate 1st-level approval. businessId=<Business ID>&address=<Receive address>&amount=<Receive amount>&coinsDoId=<CoinsDo ID>, ❗ Important: Remove trailing zeros from the decimal places of the receive amount. For eg: 1.010 to 1.01, 1.000 to 1.
reviewRemark
No
string
Reviewer approval remarks
targetDeviceUuid
No
string
approveUuid
No
string
approveSign
No
string
Executor signature, generate using RSA-SHA256 algorithm with the following data. This is mandatory if you want to automate 2nd-level approval.
businessId=<Business ID> & deviceUuid=<CoinSend UUID>
approveRemark
No
string
Executor approval remarks
targetAddrIndex
No
string
Request 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
data
string
Content(JSON string,refer below)
Data content
businessId
string
Business ID
withdrawStatus
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
string
Transaction hash
blockNumber
string
Block height
txTime
string
Transaction confirmation timestamp(seconds)
txFee
string
Gas fees
feeSymbol
string
Gas fees unit/symbol
businessScene
string
Business scenario(The data returned from submitting through API)
txMemo
string
On-chain remarks
mainnet
string
mainnet
coinName
string
currency
Callback example
Callback response example
Platform has to return code: 200 otherwise the callback will be considered failed and retry for 5 times. A failed callback can be re-initiated manually from CoinsDo web backend.
To retrieve CoinSend client device information.
POST
/v1/deviceDetail
data
string
Content(JSON string,refer below)
Data content
apiKey
Yes
string
API KEY
deviceUuid
Yes
string
CoinSend client UUID
Request example
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, refer to content below.
addressList content
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 Example
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
To add new approval device
POST
/v1/reviewAdd
data
Yes
string
Content(JSON string,refer below)
Data content
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
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
To view details of withdrawal records
POST
/v1/listWithdrawRecordDetail
data
Yes
string
Content (JSON string, refer below)
Data content
apiKey
Yes
string
API Key
businessIdList
Yes
string
Business ID (separate multiple entries with commas)
timestamp
Yes
string
Timestamp (seconds or milliseconds)
Request example
To view details of withdrawal statistic.
POST
/v1/withdrawStatistic
data
Yes
string
Content (JSON string, refer below)
Data content
apiKey
Yes
string
API Key
withdrawDeviceUuid
Yes
string
CoinSend client UUID
startTime
Yes
string
Start Time (UTC+0 timezone). Query limit: 1 day, must not span multiple days
endTime
Yes
string
End Time (UTC+0 timezone). Query limit: 1 day, must not span multiple days
timestamp
Yes
string
Timestamp (seconds or milliseconds)
Request example
Data content
deviceName
Yes
string
CoinSend client name
deviceRemark
Yes
string
CoinSend client remark
withdrawDeviceUuid
Yes
string
CoinSend client UUID
details
Yes
array
Array of content (refer to Details content)
Details content
chain
Yes
string
Name of Mainnet
currency
Yes
string
Currency/Protocol
currencyName
Yes
string
Name of the currency
flag
Yes
string
Contract address/Currency
customName
Yes
string
Custom name of the currency
withdrawTotalAmount
Yes
Decimal
Total transfer amount
balance
Yes
Decimal
Balance
lastUpdateTime
No
string
Last update time
currencyType
Yes
Integer
Currency type (0-Native coin, 1-Token)
Response status
4002
Invalid parameter format
4003
JSON data parsing error
4004
APIKEY does not exist
4005
IP restricted. Current IP:
4007
Signature verification failed
4010
Request expired
4032
Failed to verify wallet
4068
APIKEY validation failed
4099
Too many requests
4116
Selected time exceeds the allowed range
4117
Error querying distribution statistics
4118
Failed to retrieve coin configuration
4119
Failed to retrieve supported coin list
4123
Start time is later than end time
4124
Query time must be within the same day
UUID of the target CoinSend client from which the funds will be sent. This is mandatory if you want to automate 2nd-level approval.
UUID of the executor's device. This is mandatory if you want to automate 2nd-level approval.
Designated send address index, default to 0 if not present. If this parameter is present, approveSign will have to include this parameter to produce signature as such businessId=<Business ID>&deviceUuid=<CoinSend UUID>&targetAddrIndex=<Send address index>