Assets API such as Tokens can be issued by a Centrapay Account. They can then be sent to another Centrapay account using one of the methods described below.
Sending Assets
You can send Assets such as Tokens by calling our Create Asset Transfers API endpoint.
For any asset transfer that is not claimed within 2 weeks, the sent asset will be returned to the sender.
Sending to Alias
Provide the recipient’s phone number or email in the recipientAlias
field when creating the asset transfer.
The recipient will be notified via the provided channel.
Use the recipient’s phone number for the recipientAlias
field
curl -X POST https://service.centrapay.com/api/asset-transfers \
-H "X-Api-Key: $api_key" \
-H "Content-Type: application/json" \
-d '{
"assetId": "YGRo6TYYSxH3js7",
"recipientAlias": "+642212312"
}'
Use the recipient’s email for the recipientAlias
field.
curl -X POST https://service.centrapay.com/api/asset-transfers \
-H "X-Api-Key: $api_key" \
-H "Content-Type: application/json" \
-d '{
"assetId": "YGRo6TYYSxH3js7",
"recipientAlias": "john.doe@centrapay.com"
}'
Sending via Link
If a recipientAlias
isn’t provided when creating the asset transfer, a link will be returned in the url
field, which can then be shared via whichever channel you prefer.
Clicking on the link will open a page to view and claim the asset transfer.
curl -X POST https://service.centrapay.com/api/asset-transfers \
-H "X-Api-Key: $api_key" \
-H "Content-Type: application/json" \
-d '{
"assetId": "YGRo6TYYSxH3js7"
}'
{
"id": "EL49tYKmAAkp2njVMs39mrP",
"status": "created",
"assetId": "YGRo6TYYSxH3js7",
"assetType": "centrapay.token.main",
"senderAccountId": "6ZfBR4jls3nR2mpFJQJ6Qg",
"createdAt": "2023-11-20T05:01:31.634Z",
"updatedAt": "2023-11-20T05:01:31.634Z",
"suppressNotifications": false,
"url": "https://app.centrapay.com/transfer/EL49tYKmAAkp2njVMs39mrP"
}