Link Search Menu Expand Document

Assets

Assets are resources that can be used to satisfy payment requests. Assets are owned by an account and can be sent to other users.

Contents

Get Asset

GET https://service.centrapay.com/api/assets/${id}

Get asset by asset id. Returned response can be any supported asset type (wallet or gift card).

curl -X GET "https://service.centrapay.com/api/assets/L75M3L56N2PtBSt8g7uXLU" \
  -H "x-api-key: 1234"

Example response payload

{
  "id": "L75M3L56N2PtBSt8g7uXLU",
  "accountId": "Te2uDM7xhDLWGVJU3nzwnh",
  "category": "giftcard",
  "type": "epay.nzd.main",
  "issuer": "ezipay",
  "externalId": "23403283262",
  "description": "$60 Acme Giftcard",
  "initialBalance": "6000",
  "balance": "6000",
  "balanceUpdatedAt": "2021-01-01T00:00:00.000Z",
  "expiresAt": "2020-12-31T00:00:00.000Z",
  "createdAt": "2020-05-01T12:30:00.000Z"
}

List Assets for Account

GET https://service.centrapay.com/api/accounts/${id}/assets

List asset by account id. Returned response can be an array of any supported asset types (wallet or gift card).

curl -X GET "https://service.centrapay.com/api/accounts/Te2uDM7xhDLWGVJU3nzwnh/assets" \
  -H "x-api-key: 1234"

Example response payload

{
  "items": [
    {
      "id": "L75M3L56N2PtBSt8g7uXLU",
      "accountId": "Te2uDM7xhDLWGVJU3nzwnh",
      "category": "giftcard",
      "type": "epay.nzd.main",
      "issuer": "ezipay",
      "externalId": "23403283262",
      "description": "$60 Acme Giftcard",
      "initialBalance": "6000",
      "balance": "6000",
      "balanceUpdatedAt": "2021-01-01T00:00:00.000Z",
      "expiresAt": "2020-12-31T00:00:00.000Z",
      "createdAt": "2020-05-01T12:30:00.000Z"
    },
    {
      "id": "3aKubx3wr9cUHFecRq5nFL",
      "accountId": "Te2uDM7xhDLWGVJU3nzwnh",
      "currency": "NZD",
      "ledgerId": "centrapay.nzd.main",
      "type": "centrapay.nzd.main",
      "category": "wallet"
    }
  ]
}

Archive Asset (EXPERIMENTAL)

POST https://service.centrapay.com/api/assets/${id}/archive

Archive supported asset types by asset id, currently only gift cards may be archived.

curl -X POST "https://service.centrapay.com/api/assets/L75M3L56N2PtBSt8g7uXLU/archive" \
  -H "x-api-key: 1234"

Example response payload

{
  "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",
}

Error Responses

Status Code Description
403 UNSUPPORTED_ASSET_TYPE Asset type can not be archived

Table of contents