Addresses
Physical address and shipping address shapes — the address primitives used across Decal's API.
Decal uses two address shapes that build on each other:
- PhysicalAddress — the base shape: street, city, state/region, postal code, country. Used for billing addresses, merchant locations, and any context that doesn't need contact details.
- ShippingAddress — extends
PhysicalAddresswith first name, last name, and phone. Required for shipments since carriers need a recipient and a contact number.
Think of ShippingAddress as PhysicalAddress plus the contact details a shipping carrier needs.
PhysicalAddress
| Field | Type | Required | Description |
|---|---|---|---|
address1 | string | yes | Street address line 1. |
address2 | string | no | Street address line 2 (apartment, suite, etc.). |
city | string | yes | City. |
state | string | varies | State or province. Required or optional by country's standard. |
postalCode | string | yes | ZIP or postal code. |
country | string | yes | ISO 3166-1 alpha-2 country code (e.g. US). |
{
"address1": "123 Main St",
"address2": "Suite 400",
"city": "Brooklyn",
"state": "NY",
"postalCode": "11215",
"country": "US"
}ShippingAddress
ShippingAddress is PhysicalAddress plus a recipient name and contact phone.
| Field | Type | Required | Description |
|---|---|---|---|
firstName | string | yes | Recipient first name. |
lastName | string | yes | Recipient last name. |
address1 | string | yes | Street address line 1. |
address2 | string | no | Street address line 2. |
city | string | yes | City. |
state | string | varies | State or province. Required or optional by country's standard. |
postalCode | string | yes | ZIP or postal code. |
country | string | yes | ISO 3166-1 alpha-2 country code. |
phone | string | yes | Contact phone number for the shipment. |
{
"firstName": "Alice",
"lastName": "Chen",
"address1": "123 Main St",
"city": "Brooklyn",
"state": "NY",
"postalCode": "11215",
"country": "US",
"phone": "+15551234567"
}