> For the complete documentation index, see [llms.txt](https://docs.terminal.africa/tship/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terminal.africa/tship/address/validate-address.md).

# Validate Address

Validate details for an 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](/tship/miscallaneous/validation-countries.md)). Also see [API Pricing](/tship/miscallaneous/api-pricing.md) 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](/tship/miscallaneous/validation-countries.md). |
| 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.terminal.africa/tship/address/validate-address.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
