External Assets

External assets are Assets  API  which are issued by a third-party.


POST/api/external-assets

Load an asset from a supported third-party issuer. Asset details will be obtained from the issuer.

Attributes

  • accountId

    stringrequired

    The Centrapay account which will own the asset.

  • category

    stringrequired

    The category an asset will be grouped by. Valid values: “giftcard”.

  • type

    stringrequired

    The Centrapay ledger corresponding to the asset. Valid values: “epay.nzd.main”, “epay.nzd.test”.

  • issuer

    stringrequired

    The asset issuer. Valid values: “ezipay”.

  • externalId

    stringrequired

    The issuer’s asset id such as card number.

  • pin

    string

    Additional secret required by the issuer for loading or redeeming the asset.

  • description

    string

    Description of the asset, eg: “$60 Acme Giftcard”.

Errors

  • UNKNOWN_ASSET

    403

    Asset id or PIN is incorrect.

  • DUPLICATE_ASSET

    403

    Asset already claimed by another account.

  • UNSUPPORTED_ASSET_TYPE

    403

    Unsupported asset type, origin, or issuer.

  • DENIED_BY_ASSET_PROVIDER

    403

    Asset exists, but is not enabled for use through Centrapay.

  • EXPIRED_BY_ASSET_PROVIDER

    403

    Asset exists, but it’s expired.

Request
POST/api/external-assets
curl -X POST \
 https://service.centrapay.com/api/external-assets \
 -H 'content-type: application/json' \
 -H 'x-api-key: <TOKEN>' \
 -d '
{
 "accountId": "Jaim1Cu1Q55uooxSens6yk",
 "category": "giftcard",
 "type": "epay.nzd.test",
 "issuer": "ezipay",
 "externalId": "23403321042",
 "pin": "3771"
}
'
Response
{
  "id": "L75M3L56N2PtBSt8g7uXLU",
  "category": "giftcard",
  "type": "epay.nzd.main",
  "accountId": "Jaim1Cu1Q55uooxSens6yk",
  "issuer": "ezipay",
  "externalId": "************21042",
  "description": "$60 Acme Giftcard",
  "productCode": "23403",
  "currency": "NZD",
  "initialBalance": "7000",
  "balance": "6000",
  "availableBalance": "6000",
  "balanceUpdatedAt": "2020-06-10T15:30:00.000Z",
  "expiresAt": "2020-12-31T00:00:00.000Z",
  "createdAt": "2020-05-01T12:30:00.000Z"
}