Skip to content
Asset Transfers

Create an Asset Transfer

POST/api/asset-transfers

Transfer an asset to a recipient. Some assets can be transfered only in whole (eg tokens) while others can be transfered only in part (eg money).

Some assets can be transferred without supplying a recipient. A url field will be returned in these cases. The url will link to a page to claim the asset.

Request body

  • assetIdrequired string
    Id of a discrete asset to transfer or wallet asset to draw from.
  • claimConditionsoptional array of objectsexperimental
    Array of claim conditions that must be met to successfully claim the asset transfer.
  • claimTypeoptional stringexperimental
    'multi' if the asset transfer can be claimed by multiple users, 'single' if it can only be claimed by one user. Defaults to 'single'.
  • descriptionoptional string
    Shows up in transaction history against the transfer. 200 character limit.
  • expiresAtoptional timestamp
    The time that the asset transfer will expire.
  • loyaltyProgramIdoptional string
    The ID of the Loyalty Program to associate with this asset transfer.
  • messageoptional string
    Shows up in transaction history against the transfer. 100 character limit.
  • recipientAliasoptional string
    Phone number, email or handle of receiver.
  • senderNameoptional string
    Human readable name for the sender. 30 character limit.
  • suppressNotificationsoptional boolean
    Suppress notifications from Centrapay (SMS/Email).
  • valueoptional bignumber
    Amount to send. Required for money transfers. Units depend on the asset type.
  • valueConfigoptional objectexperimental
    The configuration of the value of the asset being transferred for each claim. Required if claimType is multi. The value must be less than or equal to the total value of the asset transfer.

Responses

Request
curl -X POST https://service.centrapay.com/api/asset-transfers \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '{
"assetId": "YGRo6TYYSxH3js7",
"claimConditions": [
{
"params": {
"limit": "1",
"period": "lifetime"
},
"type": "frequency"
}
],
"claimType": "multi",
"expiresAt": "2020-05-03T01:03:37.222Z",
"loyaltyProgramId": "WRhAxxWpTKb5U7pXyxQjjY",
"message": "Happy birthday",
"senderName": "My Cafe",
"value": "1000",
"valueConfig": {
"params": {
"amount": "100"
},
"type": "flat"
}
}'