Address

The address model is used for the billing_address, sender_address, and recipient_address objects.

Field

Type

Description

Validation

address_type

string

The type of location. Example: business, residential.

Possible values:
commercial residential educational government medical
industrial shipping_location

city

string

City, district, suburb, town, or village.

Required,
2-40 characters

company

string

The company name, when shipping to a business address.

2-35 characters

country

string

Two letter ISO country code.

Required,
Two letter ISO country code. Learn more

email

string

The customer's email address.

Valid email address,
2-225 characters

id

number (double)

The ID of this object in Delivery Hub.

2-225 characters

phone

string

The customer's phone number.

The regular expression pattern ^[+]?[(]?[0-9]{3}[)]?[-s.]?[0-9]{3}[-s.]?[0-9]{4,9}$ is used to match and validate phone numbers with various formats. Each symbol in the expression matches a section or symbol in the phone number:

^ asserts the start of the string.
[+]? matches an optional plus sign (+) at the beginning of the number.
[(]? matches an optional opening parenthesis (().
[0-9]{3} matches exactly three digits (0-9).
[)]? matches an optional closing parenthesis ()) if an opening parenthesis was present.
[-s.]? matches an optional hyphen (-), whitespace (s), or period (.) separator.
[0-9]{3} matches exactly three digits (0-9).
[-s.]? matches an optional separator after the second group of three digits.
[0-9]{4,9} matches a group of 4 to 9 digits (0-9).
$ asserts the end of the string.
Here are some examples of phone numbers that would match this pattern:

+123-456-7890
(123) 456-7890
123.456.7890
Note that the pattern allows for flexibility in terms of the presence of optional elements like the plus sign, parentheses, and separators. The last group of digits can range from 4 to 9 digits, accommodating phone numbers with or without extension numbers.

postal_code

string

Postal or ZIP code.

Required,
2-20 characters

state

string

(Optional, based on country) State, province, or region.

2-35 characters

street1

string

The first line of the street address, including the street name or PO Box number.

Required,
1-35 characters

street2

string

(Optional) The second line of the street address, including the apartment number.

1-35 characters