Assets
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 , withdrawn to a bank account via Funds Transfers and sent to other Centrapay users via Asset Transfers .
Assets are categorized as either Money 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.
Asset Model
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 experimental and the model may change.
Attributes
-
id
string -
accountId
string -
category
string -
type
string -
liveness
string -
description
string -
createdAt
timestamp -
status
string -
meta
object experimental -
name
string experimental
Money Model
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.
Attributes
Token Model experimental
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
Ledger Model experimental
A ledger is a single asset that maintains a balance of multiple tokens belonging to an account. All tokens in a ledger come from a specific collection. Multiple tokens can be spent or sent at once from the ledger.
Ledgers have the following attributes along with the base asset fields.
Attributes
Get Asset
curl -X GET \ https://service.centrapay.com/api/assets/L75M3L56N2PtBSt8g7uXLU \ -H 'x-api-key: <TOKEN>'
{ "id": "L75M3L56N2PtBSt8g7uXLU", "accountId": "9aFdxZNbqmFhzJFqozreqesEeaoh2f", "category": "token", "type": "centrapay.token.main", "liveness": "main", "createdAt": "2024-04-23T22:11:57.158Z", "status": "active", "activeFrom": "2024-04-23T22:11:56.924Z", "expiresAt": "2024-05-07T22:11:56.924Z", "description": "Centrapay Token", "collectionId": "1234", "collectionType": "product", "issuerImg": "https://static.centrapay.com/assets/brands/centraperk/logo.png", "img": "http://www.centrapay.com/path/to/img.png", "issuer": "Centraperk", "issuerWebsite": "www.centrapay.com", "mediaUploadId": "P9picAvVyA7c7d1GMytWG7"}
Get Asset Summary
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"}
List Assets for Account
Returns a paginated list of Assets for an account. This will not return archived assets.
Attributes
-
externalId
string
curl -X GET \ https://service.centrapay.com/api/accounts/Te2uDM7xhDLWGVJU3nzwnh/assets \ -H 'x-api-key: <TOKEN>'
{ "items": [ { "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 Asset
Archive supported asset types by asset id. Currently tokens, and quartz.nzd
assets may be archived.
Errors
-
UNSUPPORTED_ASSET_TYPE
403
curl -X POST \ https://service.centrapay.com/api/assets/V1NXc8KJC7b8QKGws13hYR/archive \ -H 'x-api-key: <TOKEN>'
{ "id": "V1NXc8KJC7b8QKGws13hYR", "accountId": "9gXmHuaFsiG6gmh6zoUDXCsJ6rtYA8", "category": "token", "type": "centrapay.token.main", "liveness": "main", "createdAt": "2024-04-23T22:07:05.738Z", "status": "archived", "activeFrom": "2024-04-23T22:07:05.602Z", "expiresAt": "2024-05-07T22:07:05.602Z", "description": "Centrapay Token", "collectionId": "1234", "collectionType": "product", "issuerImg": "https://static.centrapay.com/assets/brands/centraperk/logo.png", "issuer": "Centraperk", "issuerWebsite": "www.centrapay.com"}
Get Asset by External Id
curl -X GET \ https://service.centrapay.com/api/assets/centrapay.token.main/external-id/TiYi6haDzdkasmdfhIGz \ -H 'x-api-key: <TOKEN>'
{ "id": "3Liye29ypHRGm4pvdLWuUt", "accountId": "gyTCZPpSbGZTBAFRa5Kgqo", "category": "token", "type": "centrapay.token.main", "liveness": "main", "description": "Centrapay Token", "createdAt": "2024-04-23T22:11:57.158Z", "status": "active", "currency": "NZD", "balance": "1234", "initialBalance": "5678", "availableBalance": "4321", "settlement": true, "approvalId": "mX5BUsewoTPExN1kWNjoqn", "expiresAt": "2024-05-07T22:11:56.924Z", "activeFrom": "2024-04-23T22:11:56.924Z", "bankAccountId": "KMHxO6dF38nbbJJSCGgCWR", "name": "token", "period": "month", "periodStartedAt": "2024-05-07T22:11:56.924Z", "periodEndingAt": "2024-05-09T22:11:56.924Z"}