> For the complete documentation index, see [llms.txt](https://docs.payvalida.com/api-recaudo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payvalida.com/api-recaudo/api-recaudo-en/locations.md). Agents can also search and read this documentation through its [MCP server](https://docs.payvalida.com/api-recaudo/~gitbook/mcp).

# Locations

Here you will find the APIs needed to get the list of countries, states/provinces, and cities available that you can use through our APIs.

{% hint style="success" %}
**Production:** <https://api.payvalida.com/utilities/locations>
{% endhint %}

{% hint style="success" %}
**Sandbox:** <https://api-test.payvalida.com/utilities/locations>
{% endhint %}

`GET` `/utilities/locations`

### Request body <a href="#user-content-request-body" id="user-content-request-body"></a>

| Name    | Type   | Description                                                                                |
| ------- | ------ | ------------------------------------------------------------------------------------------ |
| country | String | With this field you get the list of states/provinces of that country.                      |
| state   | String | With this field and the `country` field, you get the list of cities of the state/province. |

### 200: OK — Successful response examples

{% tabs %}
{% tab title="List of countries" %}
{% code overflow="wrap" %}

```
Request: {} // Empty request

Response: {
    "CODE": "0000",
    "DESC": "OK",
    "DATA": {
        "countries": [
            "Colombia",
            "Argentina",
            "Ecuador",
            "Peru",
            "Guatemala",
            "..."
        ]
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="List of states/provinces" %}
{% code overflow="wrap" %}

```
Request: {
    "country": "Colombia"
}

Response: {
    "CODE": "0000",
    "DESC": "OK",
    "DATA": {
        "states": [
            "Amazonas",
            "Antioquia",
            "Arauca",
            "..."
        ]
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="List of cities" %}
{% code overflow="wrap" %}

```
Request: {
    "country": "Colombia",
    "state": "Antioquia"
}

Response: {
    "CODE": "0000",
    "DESC": "OK",
    "DATA": {
        "cities": [
            "Abejorral",
            "Abriaquí",
            "Alejandría",
            "Amagá",
            "Medellín",
            "..."
        ]
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### 200: OK — Error response examples <a href="#user-content-200-ok--error-response-examples" id="user-content-200-ok--error-response-examples"></a>

{% tabs %}
{% tab title="Invalid request" %}
{% code overflow="wrap" %}

```
Request: {
    "country": "InvalidCountry",
    "state": InvalidValue
}

Response: {
    "CODE": "0001",
    "DESC": "solicitud incorrecta"
}
```

{% endcode %}
{% endtab %}

{% tab title="Country/state not found" %}
{% code overflow="wrap" %}

```
Request: {
    "country": "InvalidCountry",
    "state": "InvalidState"
}

Response: {
    "CODE": "0002",
    "DESC": "Error de procesamiento"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
