To add a custom address autocomplete provider to Shopify checkout, use Shopify’s address autocomplete extension targets and connect them to a secure backend. Shopify documents these checkout UI extensions for Plus merchants; confirm your store’s eligibility and current requirements before implementation.
What do you need before you start?
Create an AutoPostcode account and a website API key, then check the pricing and API quickstart. Keep your key on a server you control and do not commit it to source control.
1. Check eligibility and create an extension
Follow Shopify’s current custom autocomplete tutorial to create the app and extension. The suggest target is non-visual and supplies suggestions to Shopify’s native address form.
# shopify.extension.toml — add to your generated checkout extension
[[extensions.targeting]]
target = "purchase.address-autocomplete.suggest"
module = "./src/suggest.js"
2. Connect a secure backend
Your backend should hold the AutoPostcode key and request /api/public/autocomplete with q and a search session ID. Authenticate and rate-limit the backend; do not embed the key in an extension. This shell command tests the upstream API, not the Shopify integration.
curl --get "https://autopostcode.com/api/public/autocomplete" --data-urlencode "q=10 downing" --data-urlencode "session=example-session" -H "x-api-key: $AUTOPOSTCODE_API_KEY"3. Map and format suggestions
Map AutoPostcode suggestions to the version-specific Shopify target contract. Handle group tokens and selection; use Shopify’s format-suggestion target when the selected result needs further formatting.
4. Test in a development store
Verify eligible checkout configuration, network access, empty results, address selection, timeouts and manual entry before deploying your app.
What should you check before switching over?
Use the API documentation and REST API reference for response fields and errors. Explore the postcode lookup API and address autocomplete API for the right search experience.
Platform reference: Shopify: build customized address autocomplete.
Frequently asked questions
Does this require an AutoPostcode API key?
Yes. Create a website key in the AutoPostcode dashboard and keep it on your server.
Does this work on every Shopify plan?
Shopify documents its custom checkout autocomplete UI extension targets for Shopify Plus merchants. Check current eligibility before building.
What happens when no address is found?
The postcode lookup endpoint returns 404 when it finds no addresses. Show a clear message and allow manual entry.
Should the key be included in browser JavaScript?
No. Keep the key on your server and protect any endpoint that makes requests on the visitor’s behalf.
Can I paste a script into native Shopify checkout?
Use Shopify’s supported checkout extension targets rather than assuming a storefront script can modify native checkout.
How should errors be handled?
Handle invalid input, authentication failures, insufficient credit, no matches and timeouts; provide a manual-entry fallback.
We'll beat any like-for-like UK address lookup price
Send us your current quote or invoice and we'll come back the same working day with a better price — plus free migration and integration support.
- Beat any like-for-like UK quote, monthly or annual
- Free migration + hands-on integration support
- No setup fees, no lock-in, cancel any time
Ready to get started?
Add Royal Mail PAF-verified UK address lookup to your site in minutes — start free, no card required.
