Added
2026-07 Strict Postal Code Validation (40 Countries)
about 11 hours ago by ReadMe GitHub Action
The 2026-07 customer address endpoints now validate the postcode field against country-specific patterns for 40 countries.
What's New
Affected Endpoints
| Method | Path | Behaviour |
|---|---|---|
POST | /api/2026-07/customers/{customer_id}/addresses | postcode validated against the country pattern |
PUT | /api/2026-07/customers/{customer_id}/addresses/{address_id} | postcode validated against the country pattern |
🔒 Requires: customers:write scope
Validation Rules
- 40 country codes have strict patterns: AT, AU, BE, BR, CA, CH, CN, CO, DE, DK, ES, FI, FR, GB, GR, IE, IL, IN, IT, JP, LT, MX, MY, NG, NL, NO, NZ, PH, PK, PL, PT, RO, RU, SE, SG, TH, TR, UA, US, ZA.
- Spacing is flexible where the country's format permits it.
- Any other
country_code(for exampleHK,JM) falls back to the generic pattern^[A-Za-z0-9\- ]+$.
Error Response
When the supplied postcode does not match the country-specific pattern, the request fails with 400 Bad Request and the body:
{ "error": "Postal code format is incorrect. Example: <format>" }The Example: value is country-specific (for instance SW1A 1AA for GB, K1A 0B1 for CA, 100-0001 for JP).
