Centrapay digital assets are resources that represent the ability for a Centrapay account to perform transactions where value is exchanged. Assets can be spent to satisfy Payment Requests API , withdrawn to a bank account via Funds Transfers API and sent to other Centrapay users via Asset Transfers API .
Assets are categorized as either Money, Gift Cards or Tokens. Depending on its asset category, an asset will have different attributes available and different rules governing how it can be obtained, shared or spent.
All assets have the following fields along with the additional fields that are specific to its category. Assets which don’t have a category are considered and the model may change.
Attributes
id
accountId
category
type
liveness
description
createdAt
timestampstatus
meta
name
Money assets, being backed by real currency, are the most flexible asset types. Money is accepted for most payment requests, can be sent in arbitrary amounts and does not expire.
Money assets have the following attributes along with the base asset fields.
Gift cards are similar to money but have greater spending restrictions and are not always backed by real currency. Gift cards usually have an expiry date, are typically tied to a small number of merchants, and can only be sent in their entirety.
Gift cards have the following attributes along with the base asset fields.
Attributes
Tokens are assets which can only be spent in full. Every token is associated with a collection, which defines the branding and general rules for the tokens, such as active duration.
Tokens have the following attributes along with the base asset fields.
Attributes
curl -X GET \
https://service.centrapay.com/api/assets/L75M3L56N2PtBSt8g7uXLU \
-H 'x-api-key: <TOKEN>'
{
"id": "L75M3L56N2PtBSt8g7uXLU",
"accountId": "Te2uDM7xhDLWGVJU3nzwnh",
"category": "giftcard",
"type": "epay.nzd.main",
"issuer": "ezipay",
"externalId": "23403283262",
"description": "$60 Acme Giftcard",
"productCode": "23403",
"initialBalance": "6000",
"balance": "6000",
"availableBalance": "6000",
"balanceUpdatedAt": "2021-01-01T00:00:00.000Z",
"expiresAt": "2020-12-31T00:00:00.000Z",
"createdAt": "2020-05-01T12:30:00.000Z"
}
curl -X GET \
https://service.centrapay.com/api/assets/L75M3L56N2PtBSt8g7uXLU/summary
{
"id": "L75M3L56N2PtBSt8g7uXLU",
"issuer": "Centraperk Cafe",
"description": "Free Coffee",
"expiresAt": "2020-12-31T00:00:00.000Z",
"img": "https://static.centrapay.com/assets/brands/centraperk/cafe-token.png",
"liveness": "test"
}
Returns a paginated API list of Assets for an account. This will not return archived assets.
Attributes
externalId
curl -X GET \
https://service.centrapay.com/api/accounts/Te2uDM7xhDLWGVJU3nzwnh/assets \
-H 'x-api-key: <TOKEN>'
{
"items": [
{
"id": "L75M3L56N2PtBSt8g7uXLU",
"accountId": "Te2uDM7xhDLWGVJU3nzwnh",
"category": "giftcard",
"type": "epay.nzd.main",
"issuer": "ezipay",
"externalId": "23403283262",
"description": "$60 Acme Giftcard",
"productCode": "23403",
"initialBalance": "6000",
"balance": "6000",
"availableBalance": "6000",
"balanceUpdatedAt": "2021-01-01T00:00:00.000Z",
"expiresAt": "2020-12-31T00:00:00.000Z",
"createdAt": "2020-05-01T12:30:00.000Z"
},
{
"id": "WRhAxxWpTKb5U7pXyxQjjY",
"accountId": "Te2uDM7xhDLWGVJU3nzwnh",
"category": "money",
"type": "centrapay.nzd.main",
"liveness": "main",
"description": "NZD",
"createdAt": "2021-01-01T00:00:00.000Z",
"status": "active",
"currency": "NZD",
"balance": "2000"
},
{
"id": "Aj7rtHmd7rDeWoJgw9MPHe",
"accountId": "Te2uDM7xhDLWGVJU3nzwnh",
"type": "cca.coke.main",
"description": "Coke™ Token",
"category": "token",
"value": [
{
"currency": "NZD",
"amount": "400"
}
],
"expiresAt": "2020-12-31T00:00:00.000Z",
"createdAt": "2020-05-01T12:30:00.000Z"
}
]
}
Archive supported asset types by asset id. Currently gift cards, tokens, and quartz.nzd
assets may be archived.
Errors
UNSUPPORTED_ASSET_TYPE
curl -X POST \
https://service.centrapay.com/api/assets/L75M3L56N2PtBSt8g7uXLU/archive \
-H 'x-api-key: <TOKEN>'
{
"id": "L75M3L56N2PtBSt8g7uXLU",
"accountId": "Te2uDM7xhDLWGVJU3nzwnh",
"category": "giftcard",
"type": "epay.nzd.main",
"issuer": "ezipay",
"externalId": "23403283262",
"description": "$60 Acme Giftcard",
"initialBalance": "6000",
"balance": "0",
"balanceUpdatedAt": "2021-01-01T00:00:00.000Z",
"expiresAt": "2020-12-31T00:00:00.000Z",
"createdAt": "2020-05-01T12:30:00.000Z",
"status": "archived"
}