Data Types

A point in time, usually with millisecond precision, represented as an ISO 8601 date string (eg “2021-06-11T02:51:11.000Z”). Timestamps are in the UTC timezone as denoted by the “Z” suffix.

A number, represented as a String, which can have arbitrary size or precision. Most Centrapay APIs that deal with transactable value (ie. assets, payments, etc) represent the value as BigNumbers. Depending on the context, a BigNumber may be used to represent an integer or a decimal amount.

A monetary amount in a currency, represented as an Object. The amount is usually an integer in the smallest denomination for the currency (ie cents) but may be a decimal value for some currencies (eg Bitcoin). The currency is typically represented as an ISO 4217 code.

Fields

NameTypeDescription
amountBigNumberValue in the currency’s smallest denomination (eg. cents).
currencyStringCurrency code (eg. “NZD”).

A Centrapay Resource Name (CRN) is a colon-delimited String that uniquely identifies any Centrapay resource.

The format is crn:{account}:{type}:{id} where “account” is the optional Centrapay account that owns the resource, “type” is the resource type, and “id” is the resource identifier.

CRN is often used to refer to Users and API keys. For example:

  • User: crn::user:e2837e88-d408-11eb-8eac-3e22fb52e878
  • API Key: crn:1234abc:api-key:MyAccountOwner

A location’s represented as an Object with properties to denote the location both absolute and by locality.

Required Fields

NameTypeDescription
streetStringUnit, number, and name of street address.
cityStringCity of location.
countryStringISO 3166 Country code. (eg. “NZ”).

Optional Fields

NameTypeDescription
latNumberAbsolute latitude coordinate. If you don’t provide this, we will automatically infer this from your address.
lngNumberAbsolute longitude coordinate. If you don’t provide this, we will automatically infer this from your address.
suburbStringSuburb of location.
postCodeStringPost or Zip code of location.
stateStringThe state or region of the location (eg. “Auckland”).

A phone number, represented in E.123 international notation (eg “+6421537663”). We usually use this for receiving text messages.