curl --request POST \
--url https://api.zenskar.com/customers/{customer_id}/addresses \
--header 'Content-Type: application/json' \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"line1": "123 Business Ave",
"line2": "Suite 100",
"city": "San Francisco",
"state": "CA",
"zipCode": "94102",
"country": "United States",
"country_code": "US",
"is_default_billing": true,
"is_default_shipping": false
}
'{
"id": "123e4567-e89b-12d3-a456-426614174000",
"customer_id": "223e4567-e89b-12d3-a456-426614174001",
"line1": "123 Business Ave",
"line2": "Suite 100",
"city": "San Francisco",
"state": "CA",
"zip_code": "94102",
"country": "United States",
"country_code": "US",
"is_default_billing": true,
"is_default_shipping": false,
"validation_status": "pending",
"created_at": "2023-01-01T00:00:00",
"updated_at": "2023-01-01T00:00:00"
}Create customer address
Create a new address for a customer.
Address Deduplication: Addresses are automatically deduplicated using a content hash. If you create an address with the same data as an existing address, the system will update the existing address’s default flags instead of creating a duplicate.
Default Address Behavior:
- Setting
is_default_billing: truewill unset the flag on any other address - Setting
is_default_shipping: truewill unset the flag on any other address - A single address can be both default billing and default shipping
Address Validation:
New addresses are created with validation_status: pending. Address validation can be triggered separately through integrated tax calculation services (e.g., Avalara).
Country Code: Use ISO 3166-1 alpha-2 country codes (e.g., US, CA, GB, DE).
curl --request POST \
--url https://api.zenskar.com/customers/{customer_id}/addresses \
--header 'Content-Type: application/json' \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"line1": "123 Business Ave",
"line2": "Suite 100",
"city": "San Francisco",
"state": "CA",
"zipCode": "94102",
"country": "United States",
"country_code": "US",
"is_default_billing": true,
"is_default_shipping": false
}
'{
"id": "123e4567-e89b-12d3-a456-426614174000",
"customer_id": "223e4567-e89b-12d3-a456-426614174001",
"line1": "123 Business Ave",
"line2": "Suite 100",
"city": "San Francisco",
"state": "CA",
"zip_code": "94102",
"country": "United States",
"country_code": "US",
"is_default_billing": true,
"is_default_shipping": false,
"validation_status": "pending",
"created_at": "2023-01-01T00:00:00",
"updated_at": "2023-01-01T00:00:00"
}Authorizations
Body
Request schema for creating/updating customer addresses. Extends the existing Address schema with default billing/shipping flags. customer_id comes from URL params, not request body.
Response
Successfully created customer address
Customer Address Response Schema