Asset Transfers
An asset transfer is an asynchronous exchange of an asset or an amount to a recipient.
A recipient is an existing Centrapay user or someone who can create an account to claim the asset transfer by verifying their phone number or email.
After an asset transfer is completed the recipientAlias, lastSentTo and message fields are scrubbed to avoid storing PII.
Asset Transfer Model
Attributes
-
id
string -
status
string -
value
bignumber -
assetId
string -
assetType
string -
assetCollectionId
string experimental -
description
string -
message
string -
lastSentTo
string -
senderAlias
string -
senderName
string -
recipientAccountId
string -
senderAccountId
string -
claimedByAccountId
string -
recipientAlias
string -
createdAt
timestamp -
updatedAt
timestamp -
suppressNotification
boolean -
url
string -
claimType
string experimental -
valueConfig
object experimental -
claimConditions
array experimental -
remainingValue
string experimental -
expiresAt
timestamp -
loyaltyProgramId
string
Asset Transfer lifecycle
Asset Transfer goes through different lifecycle stages.

| State | Description |
|---|---|
| created | Asset transfer successfully created |
| sent | Asset transfer notification (sms, email) was sent to a new user |
| expired | Asset transfer expired as new user didn't create his account and claimed the asset. This is very short lived state |
| returned | Asset transfer expired and was returned to original owner |
| claimed | Asset transfer was successfully completed |
| cancelled | Asset transfer was cancelled. |
Create an Asset Transfer
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.
Attributes
Errors
-
INSUFFICIENT_WALLET_BALANCE
403 -
QUOTA_EXCEEDED
403 -
ASSET_NOT_ACTIVE
403 -
RECIPIENT_MISSING
403 -
INVALID_ASSET_TYPE
403 -
LOYALTY_PROGRAM_NOT_FOUND
403
curl -X POST \ https://service.centrapay.com/api/asset-transfers \ -H 'content-type: application/json' \ -H 'x-api-key: <TOKEN>' \ -d '{ "assetId": "YGRo6TYYSxH3js7", "value": "1000", "message": "Happy birthday", "senderName": "My Cafe", "claimType": "multi", "valueConfig": { "type": "flat", "params": { "amount": "100" } }, "claimConditions": [ { "type": "frequency", "params": { "period": "lifetime", "limit": "1" } } ], "expiresAt": "2020-05-03T01:03:37.222Z", "loyaltyProgramId": "WRhAxxWpTKb5U7pXyxQjjY"}'{ "id": "M7Kn2stAxNa6ri7h", "status": "created", "value": "1000", "assetId": "YGRo6TYYSxH3js7", "assetType": "centrapay.ledger.main", "assetCollectionId": "c_Xv990BzkgfoDS7bBls50pd", "description": "Centrapay Ledger", "message": "Happy birthday", "senderName": "My Cafe", "createdAt": "2020-05-01T12:30:00.000Z", "updatedAt": "2020-05-02T01:03:37.222Z", "suppressNotifications": false, "claimType": "multi", "expiresAt": "2020-05-03T01:03:37.222Z", "valueConfig": { "type": "flat", "params": { "amount": "100" } }, "claimConditions": [ { "type": "frequency", "params": { "period": "lifetime", "limit": "1" } } ], "remainingValue": "1000", "loyaltyProgramId": "WRhAxxWpTKb5U7pXyxQjjY"}Get an Asset Transfer
curl -X GET \ https://service.centrapay.com/api/asset-transfers/M7Kn2stAxNa6ri7h \ -H 'x-api-key: <TOKEN>'{ "id": "M7Kn2stAxNa6ri7h", "status": "claimed", "value": "6000", "assetId": "YGRo6TYYSxH3js7", "assetType": "centrapay.token.main", "description": "Centrapay Token", "message": "Happy birthday", "senderName": "My Cafe", "recipientAccountId": "9EDxUT91TMsUjoqoQeBuLQ", "claimedByAccountId": "9EDxUT91TMsUjoqoQeBuLQ", "recipientAlias": "+64******2345", "createdAt": "2020-05-01T12:30:00.000Z", "updatedAt": "2020-05-02T01:03:37.222Z", "suppressNotifications": false}Get Asset Transfer Summary
curl -X GET \ https://service.centrapay.com/api/asset-transfers/M7Kn2stAxNa6ri7h/summary{ "id": "M7Kn2stAxNa6ri7h", "status": "created", "assetId": "YGRo6TYYSxH3js7", "message": "Happy birthday", "senderName": "My Cafe", "createdAt": "2020-05-01T12:30:00.000Z", "url": "https://app.centrapay.com/transfer/M7Kn2stAxNa6ri7h", "assetCollectionId": "c_Xv990BzkgfoDS7bBls50pd"}Claim Asset Transfer experimental
Claim the asset transfer for the caller's authorised account.
Errors
-
ASSET_TRANSFER_INVALID_RECIPIENT
403 -
ASSET_TRANSFER_INVALID_STATUS
403 -
ASSET_TRANSFER_CLAIM_CONDITIONS_NOT_MET
403
curl -X POST \ https://service.centrapay.com/api/asset-transfers/M7Kn2stAxNa6ri7h/claim \ -H 'x-api-key: <TOKEN>'{ "id": "M7Kn2stAxNa6ri7h", "status": "claimed", "value": "6000", "assetId": "YGRo6TYYSxH3js7", "description": "$60 Giftcard", "message": "Happy birthday", "senderName": "My Cafe", "senderAccountId": "aBc932S9182qwCDqwer", "recipientAccountId": "9EDxUT91TMsUjoqoQeBuLQ", "claimedByAccountId": "9EDxUT91TMsUjoqoQeBuLQ", "createdAt": "2020-05-01T12:30:00.000Z", "updatedAt": "2020-05-02T01:03:37.222Z", "suppressNotifications": false}Resolve Claimable Assets experimental
When you send another centrapay user cash or assets, they're automatically assigned to them. However, if they're not signed up yet then these assets are not immediately assigned.
If unclaimed, asset transfers are returned after 2 weeks.
New accounts should call this endpoint to allocate assets that you've been sent.
curl -X POST \ https://service.centrapay.com/api/me/resolve-claimable-assets \ -H 'x-api-key: <TOKEN>'{}List Asset Transfers experimental
Returns a paginated list of Asset Transfers.
Attributes
-
recipientAccountId
string -
senderAccountId
string
curl -X GET \ 'https://service.centrapay.com/api/asset-transfers?recipientAccountId=oS3Xom2au3Ooy9aihai' \ -H 'x-api-key: <TOKEN>'{ "items": [ { "id": "M7Kn2stAxNa6ri7h", "status": "created", "value": "6000", "assetId": "YGRo6TYYSxH3js7", "description": "$60 Giftcard", "message": "Happy birthday", "senderName": "My Cafe", "senderAccountId": "aBc932S9182qwCDqwer", "recipientAccountId": "9EDxUT91TMsUjoqoQeBuLQ", "claimedByAccountId": "9EDxUT91TMsUjoqoQeBuLQ", "recipientAlias": "+64*****2345", "createdAt": "2020-05-01T12:30:00.000Z", "updatedAt": "2020-05-02T01:03:37.222Z", "suppressNotifications": false } ]}Cancel an Asset Transfer
Errors
-
INVALID_ASSET_TRANSFER_STATUS
403
curl -X POST \ https://service.centrapay.com/api/asset-transfers/M7Kn2stAxNa6ri7h/cancel \ -H 'x-api-key: <TOKEN>'{ "id": "M7Kn2stAxNa6ri7h", "status": "cancelled", "assetId": "YGRo6TYYSxH3js7", "value": "6000", "description": "$60 Giftcard", "message": "Happy birthday", "senderName": "My Cafe", "senderAccountId": "aBc932S9182qwCDqwer", "recipientAccountId": "9EDxUT91TMsUjoqoQeBuLQ", "recipientAlias": "+64*****2345", "createdAt": "2020-05-01T12:30:00.000Z", "updatedAt": "2020-05-02T01:03:37.222Z", "suppressNotifications": false}