Address

All users have an associated address that they may retrieve and update.

API

Address Lookup

To get a list of addresses associated with a postcode perform a POST request to the address lookup endpoint.

Request

curl -X 'POST' \
  'https://st.igate-test.co.uk/api/v1/geo/lookup/' \
  -H 'Authorization: Bearer abc123xyz...' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "postcode": "NR31RG"
}'

Response

  • Type: 200 OK

[
  {
    "postcode": "NR31RG",
    "house": "5",
    "street": "Bedding Lane",
    "city": "Norwich",
    "locality": "",
    "county": "Norfolk",
    "long_lat": "SRID=4326;POINT (1.29955 52.6335)",
    "lat": 52.6335,
    "long": 1.29955
  },
  {
    "postcode": "NR31RG",
    "house": "Mantle App Ltd",
    "street": "Bedding Lane",
    "city": "Norwich",
    "locality": "",
    "county": "Norfolk",
    "long_lat": "SRID=4326;POINT (1.29955 52.6335)",
    "lat": 52.6335,
    "long": 1.29955
  },
  {
    "postcode": "NR31RG",
    "house": "Spiregrass Square Residents Management Company Ltd",
    "street": "Bedding Lane",
    "city": "Norwich",
    "locality": "",
    "county": "Norfolk",
    "long_lat": "SRID=4326;POINT (1.29955 52.6335)",
    "lat": 52.6335,
    "long": 1.29955
  },
  {
    "postcode": "NR31RG",
    "house": "Agm Farms Ltd",
    "street": "Bedding Lane",
    "city": "Norwich",
    "locality": "",
    "county": "Norfolk",
    "long_lat": "SRID=4326;POINT (1.29955 52.6335)",
    "lat": 52.6335,
    "long": 1.29955
  },
  {
    "postcode": "NR31RG",
    "house": "Hut 42 Services Ltd",
    "street": "Bedding Lane",
    "city": "Norwich",
    "locality": "",
    "county": "Norfolk",
    "long_lat": "SRID=4326;POINT (1.29955 52.6335)",
    "lat": 52.6335,
    "long": 1.29955
  },
  {
    "postcode": "NR31RG",
    "house": "Hilltop Retreats Management Company Ltd",
    "street": "Bedding Lane",
    "city": "Norwich",
    "locality": "",
    "county": "Norfolk",
    "long_lat": "SRID=4326;POINT (1.29955 52.6335)",
    "lat": 52.6335,
    "long": 1.29955
  },
  {
    "postcode": "NR31RG",
    "house": "1",
    "street": "Bedding Lane",
    "city": "Norwich",
    "locality": "",
    "county": "Norfolk",
    "long_lat": "SRID=4326;POINT (1.29955 52.6335)",
    "lat": 52.6335,
    "long": 1.29955
  }
]

Address (Retrieve)

The url for users address is provided in the user endpoint. The address data can be retrieved by performing a GET request to this endpoint.

Request

curl -X 'GET' \
  'https://st.igate-test.co.uk/api/v1/user/address/898c6364-eaff-49bc-8ce6-7256029a81d1/' \
  -H 'Authorization: Bearer abc123xyz...' \
  -H 'accept: application/json'

Response

  • Type: 200 OK

{
  "url": "https://st.igate-test.co.uk/api/v1/user/address/898c6364-eaff-49bc-8ce6-7256029a81d1/",
  "uuid": "898c6364-eaff-49bc-8ce6-7256029a81d1",
  "created_at": "2025-01-16T14:04:18.810168Z",
  "updated_at": "2025-01-16T14:04:18.810215Z",
  "house": "5",
  "street": "Bedding Lane",
  "city": "Norwich",
  "county": "Norfolk",
  "postcode": "NR31RG"
}

Address (Update)

A user may update their address by performing a PATCH request to the address endpoint. A list of counties is provided from the metadata list.

Request

curl -X 'PATCH' \
  'https://st.igate-test.co.uk/api/v1/user/address/898c6364-eaff-49bc-8ce6-7256029a81d1/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer abc123xyz...' \
  -d '{
  "postcode": "PE301JW",
  "house": "18",
  "street": "Tuesday Market Place",
  "city": "King's Lynn",
  "county": "Norfolk"
}'

Response

  • Type: 200 OK

{
  "url": "https://st.igate-test.co.uk/api/v1/user/address/898c6364-eaff-49bc-8ce6-7256029a81d1/",
  "uuid": "898c6364-eaff-49bc-8ce6-7256029a81d1",
  "created_at": "2025-01-16T14:04:18.810168Z",
  "updated_at": "2025-01-16T14:08:58.204937Z",
  "postcode": "PE301JW",
  "house": "18",
  "street": "Tuesday Market Place",
  "city": "King's Lynn",
  "county": "Norfolk"
}