add_customer_address
Create a customer address with required address1, city, and country. For Vietnamese addresses, include province, district, and ward codes to ensure canonical formatting.
Instructions
Add a new address to a customer. Required: address1, city, country. Province handling: pass either province (text — fuzzy-matched, e.g. "Hồ Chí Minh", "HCM", "TPHCM" all resolve to canonical "TP Hồ Chí Minh") OR province_code (1–63). The tool fills the missing field from the canonical Sapo dataset. For district/ward: pass BOTH text name AND code together (use list_districts / list_wards). NOTE: Sapo write API only accepts the pre-2025 3-tier schema. Post-2025 codes (province_code 2001+, district_code "-1") are rejected pre-flight.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip | No | ||
| city | Yes | City name. Required. | |
| ward | No | ||
| phone | No | ||
| company | No | ||
| country | Yes | Country name (e.g. "Vietnam"). Required. | |
| address1 | Yes | Primary address line. Required. | |
| address2 | No | ||
| district | No | ||
| province | No | Vietnamese province name (e.g. "Hà Nội"). | |
| last_name | No | ||
| ward_code | No | ||
| first_name | No | ||
| customer_id | Yes | Customer ID to add address to. Required. | |
| country_code | No | ||
| district_code | No | ||
| province_code | No |