{"uid":"cap_DTP67NIdngNiHGZL2i8QY","slug":"postal-code-format-validation-1fe7f6c9","name":"Postal Code Format & Validation","description":"Normalise a postal code's casing and whitespace (uppercase, collapse runs of spaces) and report whether the normalised form is valid for the country.","url":"https://postal.openverbs.com/v1/format","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["country","code"],"properties":{"code":{"type":"string","description":"Postal / ZIP code to normalise."},"country":{"type":"string","minLength":2,"description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_CM_mnPoCwgsKNKV17RGq8","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Normalises a postal/ZIP code's casing and whitespace and reports whether the normalised form is valid for a given country.","exampleAgentPrompt":"Can you normalise and validate the postal code 'sw1a 2aa' for the United Kingdom (country code GB) — fix the casing and spacing and tell me if it's valid?","exampleUseCases":[{"title":"E-commerce checkout address validation","prompt":"A customer just entered the postal code 'k1a 0b1' for Canada at checkout — can you normalise it and confirm it's a valid Canadian postal code before we accept the order?"},{"title":"Bulk address data cleansing","prompt":"I've got a German address with the ZIP code '10115 ' — extra trailing space and mixed case. Can you normalise it and tell me if it's a valid German postal code?"},{"title":"User-submitted form sanitisation","prompt":"Someone filled in 'ec1a1bb' as their UK postcode on our signup form — can you reformat it with proper uppercase and spacing and let me know if it's actually valid for GB?"}],"resultDescription":"Returns the normalised postal code (uppercased, whitespace collapsed) along with a boolean or flag indicating whether the normalised form is valid for the specified country.","failureModes":["Invalid or unrecognised ISO 3166-1 alpha-2 country code returns an error","Missing required 'code' or 'country' fields returns a 400-level validation error","Country not supported in the pattern database returns an error or unsupported flag","Malformed request body (wrong content type) returns a parse error","Network timeout or service unavailability returns a 5xx error"],"whenToPreferThis":"Choose this endpoint when you need both normalisation (fixing casing/whitespace) and validity checking in a single call, rather than calling a standalone validation endpoint separately. Ideal for data cleansing pipelines, checkout forms, and address normalisation workflows where you want the cleaned output alongside the validity result. Prefer this over the sibling validation-only endpoint when you need the canonical formatted code as output.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:41:22.451Z","isFirstParty":false}