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.
Attributes
Asset Transfer goes through different lifecycle stages.
State | Description |
---|---|
requested | Asset transfer successfully requested |
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. |
Request a transfer of an asset from a sender to the recipient.
Attributes
recipientAlias
senderAccountId
assetType
description
message
suppressNotification
Errors
SENDER_NOT_FOUND
INVALID_ASSET_TYPE
curl -X POST \
https://service.centrapay.com/api/asset-transfer-requests \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"recipientAlias": "12-1234-1234567-123",
"senderAccountId": "9EDxUT91TMsUjoqoQeBuLQ",
"value": "1000",
"assetType": "quartz.nzd.test"
}
'
{
"id": "M7Kn2stAxNa6ri7h",
"recipientAlias": "12-1234-1234567-123",
"status": "requested",
"assetType": "quartz.nzd.main",
"description": "request payment",
"senderAccountId": "9EDxUT91TMsUjoqoQeBuLQ",
"createdAt": "2024-03-01T23:56:21.514Z",
"createdBy": "crn:userId:1234",
"suppressNotifications": false,
"value": "1000",
"message": "Payment request"
}
Attributes
assetId
senderName
value
bignumber
Errors
ASSET_TRANSFER_REQUEST_EXPIRED
ASSET_TRANSFER_REQUEST_ACCEPTED
BANK_ACCOUNT_BALANCE_INSUFFICIENT
QUOTA_EXCEEDED
ASSET_NOT_ACTIVE
INVALID_ASSET_TYPE
VALUE_NOT_DEFINED
VALUE_ALREADY_DEFINED
curl -X POST \
https://service.centrapay.com/api/asset-transfer-requests/M7Kn2stAxNa6ri7h/accept \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"assetId": "YGRo6TYYSxH3js7",
"value": "1000",
"senderName": "Jane Doe"
}
'
{
"assetTransferId": "M7Kn2stAxNa6ri7h",
"status": "accepted",
"type": "asset-transfer:accepted",
"createdAt": "2020-05-02T01:03:37.222Z",
"createdBy": "sdasd98199dadas",
"assetId": "YGRo6TYYSxH3js7",
"senderName": "Jane Doe",
"value": "1000"
}
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
assetId
recipientAlias
description
message
value
bignumbersenderName
suppressNotification
Errors
INSUFFICIENT_WALLET_BALANCE
QUOTA_EXCEEDED
ASSET_NOT_ACTIVE
RECIPIENT_MISSING
INVALID_ASSET_TYPE
curl -X POST \
https://service.centrapay.com/api/asset-transfers \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"assetId": "YGRo6TYYSxH3js7",
"recipientAlias": "+642212312"
}
'
{
"id": "M7Kn2stAxNa6ri7h",
"status": "created",
"value": "1000",
"assetId": "YGRo6TYYSxH3js7",
"assetType": "centrapay.token.main",
"description": "Centrapay Token",
"message": "Happy birthday",
"senderName": "My Cafe",
"recipientAccountId": "9EDxUT91TMsUjoqoQeBuLQ",
"claimedByAccountId": "9EDxUT91TMsUjoqoQeBuLQ",
"recipientAlias": "+64212312345",
"createdAt": "2020-05-01T12:30:00.000Z",
"updatedAt": "2020-05-02T01:03:37.222Z",
"suppressNotifications": false
}
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
}
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"
}
Claim the asset transfer for the caller’s authorised account.
Errors
ASSET_TRANSFER_INVALID_RECIPIENT
ASSET_TRANSFER_INVALID_STATUS
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
}
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>'
{}
Returns a paginated API list of Asset Transfers.
Attributes
recipientAccountId
senderAccountId
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
}
]
}
Errors
INVALID_ASSET_TRANSFER_STATUS
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
}