🏬 Webshop · All integrations

Address autocomplete in Magento 2 / Adobe Commerce

Typo-tolerant Danish address search in the Magento checkout with two script lines — plus optional server-side cleansing when orders are placed.

Magento's checkout is Knockout-based, but the address fields are plain <input> elements — so our JS widget attaches directly, no Composer module required. Prefer server-side validation? Call the REST API from an observer on sales_order_place_before.

How to set it up

  1. Get an API key
    Create a free account on the dashboard and copy your dawa_live_… key.
  2. Load the widget script
    Add the script in your theme's default_head_blocks.xml — or via Stores → Configuration → Design → HTML Head.
  3. Bind the street field
    Call DanadresseAutocomplete.attach() on the street[0] field. The widget fills street, number, postcode and city.
  4. Optional: server-side datavask
    Call /datavask/adresser from an observer so dirty addresses are corrected before they reach your ERP or shipping labels.
# Widget in the Magento checkout
<!-- 1) Indlæs widget'en i dit theme, fx via
     Magento_Theme/layout/default_head_blocks.xml -->
<script src="https://danadresse.dk/static/js/danadresse-widget.js"></script>

<!-- 2) Aktivér autocomplete på checkout-gadefeltet -->
<script>
  DanadresseAutocomplete.attach('input[name="street[0]"]', {
    apiKey: 'dawa_live_…'
  });
</script>

Good to know

No build pipeline

The widget is dependency-free vanilla JS — it doesn't interfere with Knockout or requirejs.

Works in Luma + Hyvä

Anything that renders an input can use it — including headless PWA Studio via the REST API directly.

DAWA-compatible response

Already using DAWA in your shop? Same JSON shape — just swap the base URL.

A packaged Composer module (danadresse/magento2) is on the roadmap — write to partners@lynbro.dk for early access.

Ready to try it with Magento 2 / Adobe Commerce?

Free Hobby key, no credit card — the API answers in under 100 ms.

Get an API key →

API docs · Code examples · JS widget