> For the complete documentation index, see [llms.txt](https://api-docs.toconline.pt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.toconline.pt/apis/apis-auxiliares/paises.md).

# Países

### Obter Todos os Países

{% openapi src="/files/LrXEg3IjIacAycCz7IWE" path="/api/countries" method="get" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2Fgit-blob-1f7bd9dd692716d3f3f93d9c9a4f7226d78277e3%2FTOConline%20Open%20API.yaml?alt=media)
{% endopenapi %}

{% code title="GET" %}

```
https://api/v1.toconline.com/api/coutries
```

{% endcode %}

<details>

<summary>Exemplo de Response</summary>

```json
{
    "data": [
        {
            "type": "countries",
            "id": "1",
            "attributes": {
                "default_name": "Portugal - Continente",
                "iso_alpha_2": "PT",
                "iso_alpha_3": "PRT",
                "tax_country_region": "PT"
            }
        },
        {
            "type": "countries",
            "id": "2",
            "attributes": {
                "default_name": "Portugal - Madeira",
                "iso_alpha_2": "PT-MA",
                "iso_alpha_3": "PRT",
                "tax_country_region": "PT-MA"
            }
        },
        (...)
        ]
    }
}
```

</details>

### Obter País por Código de País

{% code title="Endpoint" %}

```
https://api/v1.toconline.com/api/coutries?filter[iso_alpha_2]=<Código de País>
```

{% endcode %}

{% tabs %}
{% tab title="Endpoint" %}
{% code title="Endpooint " overflow="wrap" %}

```
https://api/v1.toconline.com/api/coutries?filter[iso_alpha_2]=PT
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

```json
{
    "data": [
        {
            "type": "countries",
            "id": "1",
            "attributes": {
                "default_name": "Portugal - Continente",
                "iso_alpha_2": "PT",
                "iso_alpha_3": "PRT",
                "tax_country_region": "PT"
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}

```
<Código de País>  => "iso_alpha_2"
```

{% endhint %}

### Obter Todos os Países OSS

{% openapi src="/files/LrXEg3IjIacAycCz7IWE" path="/api/oss\_countries" method="get" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2Fgit-blob-1f7bd9dd692716d3f3f93d9c9a4f7226d78277e3%2FTOConline%20Open%20API.yaml?alt=media)
{% endopenapi %}

{% code title="GET" %}

```
https://api/v1.toconline.com/api/coutries
```

{% endcode %}

<details>

<summary>Exemplo de Response</summary>

```json
{
    "data": [
        {
            "type": "countries",
            "id": "1",
            "attributes": {
                "default_name": "Portugal - Continente",
                "iso_alpha_2": "PT",
                "iso_alpha_3": "PRT",
                "tax_country_region": "PT"
            }
        },
        {
            "type": "countries",
            "id": "2",
            "attributes": {
                "default_name": "Portugal - Madeira",
                "iso_alpha_2": "PT-MA",
                "iso_alpha_3": "PRT",
                "tax_country_region": "PT-MA"
            }
        },
        (...)
        ]
    }
}
```

</details>
