Skip to content

Working with addresses

Addresses are the starting point for every delivery integration. Before Ingrid can return delivery options, it needs to know where the customer is. This guide explains the address model, the server-driven form system, and how the address endpoints fit into your checkout.

The address model

The Ingrid API uses two address models: a base Address for physical locations and a DeliveryAddress that extends it with delivery-specific fields.

Address

The base model for any physical location — warehouses, pickup points, or anywhere you need to represent a place.

countryCodestring= 2 charactersrequired

ISO 3166-1 alpha-2 country code.

postalCodestringrequired

Postal code. Formatting and validation rules are conditional and based on the country code.

administrativeAreastring

Required for countries:

North America
  • US (United States) - State
  • CA (Canada) - Province/Territory
  • MX (Mexico) - State (Estado)
South America
  • BR (Brazil) - State (Estado)
  • AR (Argentina) - Province
Asia Pacific
  • AU (Australia) - State/Territory
  • CN (China) - Province
  • JP (Japan) - Prefecture
  • MY (Malaysia) - State
  • KR (South Korea) - Province/City-Province
  • ID (Indonesia) - Province
  • TH (Thailand) - Province (Changwat)
Europe
  • IT (Italy) - Province (2-letter abbreviation like MI, RM)
  • ES (Spain) - Province
  • IE (Ireland) - County
subAdministrativeAreastring

Usually the District, Suburb, or Neighborhood. Typically not required unless explicitly specified in our documentation.

localitystring

The primary locality of the address. Usually the City, Town, Village, or Municipality.

subLocalitystring

The neighborhood, suburb, or district within the locality. Typically not required unless explicitly specified in our documentation.

Critical for:

  • Japan (chome/district names)
  • UK (London districts like "Soho" or "Brixton")
  • Latin America (colonia)
addressLinesArray of strings

An ordered array of street address lines. Index 0: Primary street info (Street name + Number, or Block number). Index 1+: Secondary info (Apartment, Suite, Floor, Building Name).

typestring(AddressType)
Enum"unknown""residential""commercial"

countryCode and postalCode are always required. Other fields are conditionally required depending on the country — see the country reference for details.

DeliveryAddress

Extends Address with fields specific to delivering a package to a person. Used for the customer's destination in delivery options and order creation.

countryCodestring= 2 charactersrequired

ISO 3166-1 alpha-2 country code.

postalCodestringrequired

Postal code. Formatting and validation rules are conditional and based on the country code.

administrativeAreastring

Required for countries:

North America
  • US (United States) - State
  • CA (Canada) - Province/Territory
  • MX (Mexico) - State (Estado)
South America
  • BR (Brazil) - State (Estado)
  • AR (Argentina) - Province
Asia Pacific
  • AU (Australia) - State/Territory
  • CN (China) - Province
  • JP (Japan) - Prefecture
  • MY (Malaysia) - State
  • KR (South Korea) - Province/City-Province
  • ID (Indonesia) - Province
  • TH (Thailand) - Province (Changwat)
Europe
  • IT (Italy) - Province (2-letter abbreviation like MI, RM)
  • ES (Spain) - Province
  • IE (Ireland) - County
subAdministrativeAreastring

Usually the District, Suburb, or Neighborhood. Typically not required unless explicitly specified in our documentation.

localitystring

The primary locality of the address. Usually the City, Town, Village, or Municipality.

subLocalitystring

The neighborhood, suburb, or district within the locality. Typically not required unless explicitly specified in our documentation.

Critical for:

  • Japan (chome/district names)
  • UK (London districts like "Soho" or "Brixton")
  • Latin America (colonia)
addressLinesArray of strings

An ordered array of street address lines. Index 0: Primary street info (Street name + Number, or Block number). Index 1+: Secondary info (Apartment, Suite, Floor, Building Name).

typestring(AddressType)
Enum"unknown""residential""commercial"
instructionsstring

Additional instructions for the delivery.

recipientNamestring

The name of the recipient formatted as expected in the country it's being delivered to.

Where each model is used

ContextModelExample
Customer destinationDeliveryAddressPOST /v1/delivery/options, POST /v1/delivery/orders
Warehouse / store originAddressfulfillmentGroups[].origins[].address
Pickup locationAddressReturned in delivery options and POST /v1/delivery/locations

Server-driven forms

Instead of hardcoding which address fields to show for each country, you can call the address form endpoint and let the API tell your client what to render.

GET /v1/delivery/address/form?countryCode=SE

The response includes:

  • Field definitions — which fields exist, their labels, validation rules, keyboard hints, and whether they are required
  • Layout — a grid describing the visual order to render fields
  • Pre-filled values — if you also pass postalCode, the API can pre-fill the city and region

This means your checkout automatically supports new countries without code changes. The API knows that Sweden needs five fields while the United States needs six (including state). Your client just renders what it's told.

See the address form guide for a step-by-step integration.

The minimum viable integration

You only need two fields to get delivery options: countryCode and postalCode. Everything else improves the experience but is not required to get started.

Request
curl -X POST https://api.ingrid.com/v1/delivery/options \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "purchaseCountry": "SE",
    "purchaseCurrency": "SEK",
    "externalRef": "cart-abc-123",
    "destination": {
      "countryCode": "SE",
      "postalCode": "11453"
    },
    "fulfillmentGroups": [
      {
        "items": [
          {
            "quantity": 1,
            "weight": { "value": 500, "unit": "g" },
            "dimensions": { "length": 30, "width": 20, "height": 10, "unit": "cm" }
          }
        ]
      }
    ]
  }'

Collect the full street address later — before order creation — and the customer still gets delivery options as soon as they enter their postal code.

The full address flow

The complete address flow has four stages. Each stage is optional except fetching delivery options. Use as many as your checkout needs.

Ingrid APICheckoutIngrid APICheckoutStage 1: Render the formStage 2: Autocomplete (optional)Stage 3: Validate (recommended)Stage 4: Fetch delivery optionsGET /address/form?countryCode=SEField definitions, layout, validation rulesGET /address/search?countryCode=SE&query=SveaPredictionsGET /address/details/{id}Full DeliveryAddressPOST /address/validatevalid / suspect / invalid + candidatePOST /delivery/optionsDelivery groups, categories, services
StageEndpointPurposeRequired?
Render formGET /v1/delivery/address/formGet localized field definitions and layoutNo — you can build your own form
AutocompleteGET /v1/delivery/address/searchType-ahead address suggestionsNo — improves UX
ValidatePOST /v1/delivery/address/validateVerify and standardize the addressNo — recommended before order creation
Delivery optionsPOST /v1/delivery/optionsGet available delivery servicesYes