Send Currency Token by ID
Sends an amount of a currency token to a recipient address. The token must be in status 3 (Active). The transfer is signed by the wallet frozen onto the token at creation, on the token's network. The token's node must be the platform root node and inside your API key's node subtree.
amount is a decimal string with at most as many decimals as the token's decimals (6 for a token created through this API): "250.5" is accepted, "0.1234567" is refused, never rounded. See Amounts and Percentages.
The call is asynchronous: it records a SendCurrencyToken (type 3) transaction, publishes it and returns its ID. Poll Get Currency Token Transactions by ID until it reaches status 3 (Done) or 4 (Error).
Required permission: currency-token:send
Request
POST /v2/admin/currency-tokens/{currency_token_id}/send
Parameters
| Name | Type | In | Description |
|---|---|---|---|
currency_token_id | string | path | Required. Currency token ID (24-character hex) |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Content-Type | Required. application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Amount to send, greater than zero, with at most the token's decimals |
recipient_wallet | string | Yes | Recipient wallet address |
Example
curl --request POST \
--url '{{baseUrl}}/v2/admin/currency-tokens/6a859ae35a7db4268dfb40d2/send' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"amount": "250.5",
"recipient_wallet": "0x3b4E4dd67EE4054514bA2101e981f4C4D44eFDDc"
}'
Response
{
"transaction_id": "6a8b5e13f9129816a6cc7a13"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | The currency token transaction this call started. A 200 means the send was queued, not that it finished |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | Validation failed — see details. Includes a missing recipient_wallet, and a missing, zero, malformed or too precise amount |
| 404 | 10001 (domain 15) | Currency token not found |
| 400 | 10005 (domain 15) | The token is not Active: its deploy has not confirmed |
| 400 | 10001 (domain 2) | The token's node was not found |
| 403 | 10005 (domain 2) | The token's node is not the platform root node, or is outside your API key's node subtree |
| 500 | 10000 | Unexpected server error, including a currency_token_id that is not a 24-character hex ID |
See Errors for the error format and common codes.