Documentation

Address API - Address Validation


Overview

Address Validation API ensures that addresses entered by users are accurate and standardized. It verifies the validity of addresses against authoritative data sources, helping to reduce errors in shipping and billing. The API supports multiple address providers to ensure comprehensive and reliable address data (Google Maps, Loqate).

Ingrid Checkout Widget Address Validation

Ingrid Checkout Widget integrates the Address Validation API to validate addresses entered by users during the checkout process. As users input their address details, the widget checks the validity of the address in real-time, providing feedback to users and suggesting corrections if necessary.

Ingrid Checkout Widget - Address Validation

Validate Address

To ensure the accuracy of addresses entered by users, use the Validate Address endpoint. Here are two examples demonstrating how to validate both a valid and an invalid address. Examples differ on region_code field, one is with a valid region code ("WV") and another with an invalid region code ("AL").


curl https://api-development.ingrid.com/address/v1/validate \
  -X 'POST' \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PRIVATE_KEY_BASE64" \
  -d '{
  "address": {
    "country_code": "US",
    "region_code": "WV",
    "postal_code": "24726-8058",
    "city": "Herndon",
    "address_lines": [
      "346 Lanes Ln"
    ],
    "street": "Lanes Ln",
    "street_number": "346"
  },
  "provider": "LOQATE"
}
'
POST https://api-development.ingrid.com/address/v1/validate
Authorization: Bearer $PRIVATE_KEY_BASE64
Content-Type: application/json

{
    "address": {
        "country_code": "US",
        "region_code": "WV",
        "postal_code": "24726-8058",
        "city": "Herndon",
        "address_lines": [
            "346 Lanes Ln"
        ],
        "street": "Lanes Ln",
        "street_number": "346"
    },
    "provider": "LOQATE"
}

{
  "result": "VALID",
  "suggestion": {}
}


curl https://api-development.ingrid.com/address/v1/validate \
  -X 'POST' \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PRIVATE_KEY_BASE64" \
  -d '{
  "address": {
    "country_code": "US",
    "region_code": "AL",
    "postal_code": "24726-8058",
    "city": "Herndon",
    "address_lines": [
      "346 Lanes Ln"
    ],
    "street": "Lanes Ln",
    "street_number": "346"
  },
  "provider": "LOQATE"
}
'
POST https://api-development.ingrid.com/address/v1/validate
Authorization: Bearer $PRIVATE_KEY_BASE64
Content-Type: application/json

{
    "address": {
        "country_code": "US",
        "region_code": "AL",
        "postal_code": "24726-8058",
        "city": "Herndon",
        "address_lines": [
            "346 Lanes Ln"
        ],
        "street": "Lanes Ln",
        "street_number": "346"
    },
    "provider": "LOQATE"
}

{
  "result": "INVALID",
  "suggestion": {
    "address": {
      "country_code": "US",
      "region_code": "WV",
      "postal_code": "24726",
      "city": "Herndon",
      "address_lines": [
        "346 Lanes Ln"
      ],
      "street": "Lanes Ln",
      "street_number": "346"
    },
    "invalid_components": [
      "REGION"
    ]
  }
}

Last updated: Thu, Feb 12, 06:59 AM