{"uid":"cap_PwFNxY0jROi8F4Tgbaxyr","slug":"international-address-formats-postal-code-validator-2ac97b9c","name":"International Address Formats – Postal Code Validator","description":"Check a postal code against a country's pattern, and a state/province's prefix pattern where the data lists one.","url":"https://address-formats.x402tookit.com/postal-code-check?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["country","postal_code"],"properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 code, e.g. US"},"postal_code":{"type":"string","description":"The postal or ZIP code to check"},"subdivision":{"type":"string","description":"Optional state/province code or name, e.g. CA"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"source":{"type":["null","string"]},"country":{"type":["null","string"]},"pattern":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"examples":{"type":["array","null"],"items":{"type":"string"}},"dataSource":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"normalized":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"attribution":{"type":["null","string"]},"formatValid":{"type":["boolean","null"]},"snapshotDate":{"type":["null","string"]},"postalCodeInput":{"type":["null","string"]},"postalCodeLabel":{"type":["null","string"]},"subdivisionCheck":{"type":["null","object"],"properties":{"name":{"type":["null","string"]},"result":{"type":["null","string"]},"matched":{"type":["null","string"]},"requested":{"type":["null","string"]},"prefixMatches":{"type":["boolean","null"]},"prefixPattern":{"type":["null","string"]}}},"subdivisionsWhosePrefixMatches":{"type":["array","null"],"items":{"type":"object","properties":{"code":{"type":["null","string"]},"name":{"type":["null","string"]}}}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_B-cwPCyPqUthy1DtJAy6b","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates a postal code against a country's regex pattern and optionally checks it against a state/province subdivision prefix pattern.","exampleAgentPrompt":"Can you check whether '10115' is a valid postal code for Germany (DE), and see if it matches the Berlin subdivision prefix?","exampleUseCases":[{"title":"E-commerce checkout address validation","prompt":"Before we process this order, check whether postal code 'SW1A 1AA' is a valid format for the UK (GB) — I want to make sure the customer's address is correctly formatted."},{"title":"Canadian province postal prefix check","prompt":"Is 'K1A 0B1' a valid Canadian postal code, and does it match the prefix pattern for Ontario (ON)?"},{"title":"International shipping form validation","prompt":"We're shipping to Australia — can you verify that '2000' is a correctly formatted postal code for AU, and tell me which state it likely belongs to?"}],"resultDescription":"Returns a verdict (valid/invalid), a boolean formatValid flag, the regex pattern used, a normalized version of the postal code, example valid codes for the country, reasons for any failure, and if a subdivision was provided, a subdivisionCheck object showing whether the postal code prefix matches the expected subdivision prefix pattern along with any other subdivisions whose prefix matches.","failureModes":["Unsupported or unknown country code returns null pattern or degraded result","Postal code does not match country pattern — returns formatValid: false with reasons","Subdivision prefix data not available for some countries — notChecked field populated","Invalid ISO country code format causes error or empty response","Network timeout or payment failure before response is returned"],"whenToPreferThis":"Use this endpoint when you need to validate that a postal code conforms to a specific country's official format pattern, especially when you also want to cross-check against a state or province prefix. Prefer this over generic regex checks because it uses curated per-country and per-subdivision data, returns normalized forms, and provides human-readable reasons and examples. It is ideal for checkout flows, address form validation, shipping label generation, or any data pipeline that needs to ensure postal code integrity before further processing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-02T12:30:42.943Z","isFirstParty":false,"canonicalSlug":"international-address-formats-postal-code-validator-2ac97b9c"}