To add Shopify checkout address validation, verify the shipping address against Royal Mail PAF before the order ships — on Shopify Plus with a checkout UI extension, or on other plans via an order-created webhook and cart/account validation. AutoPostcode checks each address against ~31M UK delivery points across ~1.8M postcodes, so a passing address is genuinely deliverable.
Can I validate inside Shopify's native checkout?
On Shopify Plus, yes — checkout UI extensions let you autocomplete and validate the address as the customer types. On non-Plus plans Shopify locks the checkout, so validate on the cart page, in the customer account, and after the order lands via a webhook.
- Shopify Plus: checkout UI extension for live validation
- All plans: orders/create webhook for post-order checks
- Cart and account address pages for pre-checkout capture
- Soft-warn and suggest a PAF match instead of hard-blocking
How do I validate an address with the API?
Call AutoPostcode from a server function or your webhook handler — never from the browser:
// Validate a Shopify shipping address against PAF
const res = await fetch(
"https://api.autopostcode.com/v1/validate?postcode=" +
encodeURIComponent(order.shipping_address.zip),
{ headers: { Authorization: "Bearer " + process.env.AUTOPOSTCODE_KEY } }
);
const { valid, suggestion } = await res.json();
if (!valid) {
// tag the order or notify the customer with 'suggestion'
}How do I wire the order webhook?
Subscribe to orders/create and validate the shipping address as orders arrive:
// POST /api/public/shopify-order (verify HMAC first)
export async function handler(order) {
const zip = order.shipping_address?.zip;
const r = await fetch("https://api.autopostcode.com/v1/validate?postcode=" + zip, {
headers: { Authorization: "Bearer " + process.env.AUTOPOSTCODE_KEY },
});
const { valid } = await r.json();
if (!valid) await tagOrder(order.id, "address-review");
}Plus extension vs webhook validation
| Approach | When it runs | Best for |
|---|---|---|
| Checkout UI extension | As customer types | Shopify Plus |
| orders/create webhook | After order placed | Every plan |
For search-as-you-type entry, add Shopify address autocomplete, read the broader Shopify address validation overview, and see the address autocomplete API reference.
A modern, UK-first alternative
AutoPostcode uses the same Royal Mail PAF data as Loqate, Fetchify and Ideal Postcodes, with a clean REST API and an affordable per-lookup price — start on a free trial.
Frequently asked questions
How do I validate addresses in a Shopify checkout?
Add a Shopify checkout UI extension or a post-purchase/thank-you step that calls the AutoPostcode API to verify the shipping address against Royal Mail PAF. On Plus, checkout extensions run natively; on other plans, validate on the cart or account address pages and via webhooks after order creation.
Can I validate the address inside Shopify's native checkout?
On Shopify Plus you can use checkout UI extensions to autocomplete and validate the address as the customer types. On non-Plus plans, Shopify locks the core checkout, so validate on the cart page, customer account, or via an order-created webhook.
Does Shopify have an address API I can use?
Shopify exposes address data through its Admin and Storefront APIs, but it does not verify UK deliverability. Pair Shopify's APIs with AutoPostcode's PAF-backed validation to confirm the address is real.
Is the validation data Royal Mail PAF?
Yes. AutoPostcode validates against Royal Mail PAF, covering ~31M UK delivery points across ~1.8M postcodes, so a passing address is genuinely deliverable.
How do I handle a failed validation without blocking the sale?
Warn softly: flag the address, suggest the closest PAF match, and let the customer confirm. Hard-blocking checkout hurts conversion, so use validation to correct rather than obstruct.
How much does Shopify address validation cost?
AutoPostcode is priced per lookup on an affordable UK-first plan, well below legacy providers like Loqate and Ideal Postcodes, and you can start on a free trial.
Ready to get started?
Add Royal Mail PAF-verified UK address lookup to your site in minutes — start free, no card required.
