# Validate Address

## /addresses/validate

<mark style="color:green;">`POST`</mark> `https://api.terminal.africa/v1/addresses/validate`

This endpoint allows you to validate the details of any global address. For list of accepted countries check ([Validation Countries](https://docs.terminal.africa/tship/miscallaneous/validation-countries)). Also see [API Pricing](https://docs.terminal.africa/tship/miscallaneous/api-pricing) for usage fees.

#### Headers

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Set value to `Bearer SECRET_KEY` |
| Content-Type                                    | String | Set value to `application/json`  |

#### Request Body

| Name                                      | Type   | Description                                                                                                                                           |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| city<mark style="color:red;">\*</mark>    | String | Address city.                                                                                                                                         |
| country<mark style="color:red;">\*</mark> | String | ISO 2 country code for address. Must be one of the addresses available [here](https://docs.terminal.africa/tship/miscallaneous/validation-countries). |
| line1<mark style="color:red;">\*</mark>   | String | Street address. Required for arranging pickup / delivery.                                                                                             |
| line2                                     | String | Second line of street address.                                                                                                                        |
| state<mark style="color:red;">\*</mark>   | String | State of street address.                                                                                                                              |
| zip<mark style="color:red;">\*</mark>     | String | Zip / Postal code. Required for arranging pickup / delivery.                                                                                          |

{% tabs %}
{% tab title="200: OK Address validated successfully" %}

```javascript
{
    "status": true,
    "message": "Address validated successfully",
    "data": {
        "is_valid": true,
        "original_address": {
            "city": "London",
            "state": "London",
            "country": "GB",
            "email": "claudettearnold@hotmail.co.uk",
            "first_name": "Claudette",
            "is_residential": true,
            "last_name": "Arnold",
            "line1": "43 northumberland park",
            "line2": "",
            "phone": "+44 7908908329",
            "zip": "N17 OTB",
            "user": "USER-27450202164"
        },
        "validation_results": {
            "country_valid": true,
            "city_valid": true,
            "state_valid": true,
            "address_valid": true,
            "zip_valid": true
        },
        "validation_messages": [
            {
                "code": "POSTAL_MISMATCH",
                "field": "postalCode",
                "severity": "warning",
                "message": "The postal code was corrected.",
                "meta": {
                    "inputPostal": "N17 OTB",
                    "updatedPostal": "N17 0TB"
                }
            }
        ],
        "suggestion_provided": true,
        "suggested_address": {
            "line1": "43 northumberland park",
            "city": "London",
            "zip": "N17 OTB",
            "country": "GB"
        }
    }
}
```

{% endtab %}
{% endtabs %}
