validate_postal_code
Validates European postal codes against official country patterns for e-commerce, address verification, and logistics workflows. Returns valid/invalid status, formatted code, and country.
Instructions
Validates a postal code format for a given European country using the official pattern for that country. Returns { valid: boolean, postal_code: string, country: string, format: string }. Supports PT (4+3 digit), ES (5 digit), FR (5 digit), DE (5 digit), IT (5 digit), NL (4 digits + 2 letters), BE (4 digit), PL (5+2 digit), SE (5 digit), AT (4 digit), IE (Eircode 3+4), GR (5 digit), HU (4 digit), RO (6 digit), UK (complex alphanumeric). Use in e-commerce checkout validation, address verification, or logistics workflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| postal_code | Yes | Postal code to validate. Example: '1000-001' for PT, '28001' for ES, 'SW1A 1AA' for UK | |
| country_code | Yes | Two-letter ISO country code. Example: 'PT', 'DE', 'UK' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | Yes | ||
| postal_code | No | ||
| country | No | ||
| format | No | ||
| reason | No |