Skip to content

United Kingdom (GB)

UK addresses use an alphanumeric postal code with a significant space, place the house number before the street name, and often include building names. The hierarchical address system makes autocomplete particularly valuable — a single street can contain dozens of individual premises.

Example

{
  "countryCode": "GB",
  "postalCode": "SW1A 2AA",
  "addressLines": ["10 Downing Street"],
  "locality": "London"
}

Field requirements

FieldRequiredDescription
countryCodeYesAlways "GB"
postalCodeYesAlphanumeric with space
addressLinesYes (for shipment)Index 0: number and street name
localityYes (for shipment)Post town
administrativeAreaNoCounty — not required for delivery
subLocalityNoLondon district or neighborhood, e.g., "Westminster"

Postal code

  • Format: Alphanumeric, with a space separating the outward and inward parts
  • Pattern: Various formats (A9 9AA, A99 9AA, A9A 9AA, AA9 9AA, AA99 9AA, AA9A 9AA)
  • Examples: "SW1A 2AA", "EC2R 8AH", "M1 1AE"
  • Sanitization: The API preserves spaces. Letters are uppercased.

The space in UK postal codes is significant. "SW1A 2AA" and "SW1A2AA" may be handled differently by carriers. Always include the space.

Address lines

The house number comes before the street name. Building names, when present, go on a preceding line.

ScenarioaddressLines value
Standard["10 Downing Street"]
With building name["Buckingham Palace", "The Mall"]
With flat number["Flat 3", "10 Buckingham Street"]
  • Building names are common in the UK and may replace a house number entirely
  • The autocomplete endpoint returns building names in the correct position

Locality

The locality field is the post town, which may differ from the colloquial city name.

  • Example: "London", "Manchester", "Edinburgh"
  • For London addresses, subLocality can capture the specific district

Autocomplete considerations

UK addresses benefit significantly from autocomplete due to:

  • Multi-premise buildings: A single building may contain many flats, each a separate address. The expand/resolve pattern handles this naturally.
  • Building names: Many UK addresses use building names instead of or in addition to house numbers, making free-text entry error-prone.
  • PAF data: The UK has a comprehensive Postcode Address File. The autocomplete endpoint with focus=postalCode enables postcode-first lookups common in UK checkouts.

Common mistakes

MistakeProblemFix
"postalCode": "sw1a 2aa"Lowercase postal codeAccepted — the API uppercases automatically
"postalCode": "SW1A2AA"Missing spaceInclude the space: "SW1A 2AA"
"addressLines": ["Downing Street 10"]Street before numberUK uses number-first: ["10 Downing Street"]
Missing building nameBuilding-only addresses fail deliveryUse autocomplete to capture building names