Skip to main content

Reference Data API

Read the countries and regions an address can name, and the timezones a customer can be given. Every list comes from the billing engine, so it holds exactly the values the engine accepts.

List Countries​

GET /api/v1/reference/countries

Response:

{
"countries": [
{ "code": "CA", "name": "Canada" },
{ "code": "DE", "name": "Germany" },
{ "code": "US", "name": "United States of America" }
]
}
FieldDescription
countries[].codeTwo-letter ISO 3166-1 country code. Send this as an address's country.
countries[].nameName of the country.

The list is sorted by name and passed through as the billing engine holds it, so it can include entries that are not ordinary countries.

List a Country's Regions​

GET /api/v1/reference/countries/{country_code}/states

country_code is the two-letter code from List Countries, in either case.

Response:

{
"states": [
{ "code": "CA", "name": "California" },
{ "code": "GA", "name": "Georgia" },
{ "code": "NY", "name": "New York" }
]
}
FieldDescription
states[].codeCode for the region, without a country prefix. Its format varies by country.
states[].nameName of the state, province, or region.

The list is sorted by name. It is empty for a country that has no regions on file, which is not an error. The country and region lists change rarely and are cached for a day.

Store the name, not the code. Send the region's name as an address's state:

  • A company address has to name a region the billing engine holds for that country.
  • A customer address is free text, printed on the invoice exactly as you send it.

List Timezones​

GET /api/v1/profile/timezones

Response:

[
{ "value": "Africa/Abidjan", "label": "Africa/Abidjan" },
{ "value": "America/New_York", "label": "America/New_York" },
{ "value": "UTC", "label": "UTC" }
]
FieldDescription
valueIANA timezone name. Send this as a customer's timezone.
labelName to display for the timezone.

The list is sorted by name and cached for a day. A customer timezone outside it is refused with 422.

Get the Default Timezone​

GET /api/v1/profile/timezones/default

Response:

{ "timezone": "Europe/Prague" }
FieldDescription
timezoneIANA timezone name a customer is given when created without one. null when it cannot be determined.

The default belongs to the billing environment your request acts on. With a session token that is the one X-Environment names, and live when you omit the header (see Choosing the Environment with a Session Token). With an API key it is the key's own environment. If a customer's billing day depends on the default, read it before you create the customer.