# Merchant Country

The Merchant Country resource is used to query the countries available in the Stark Bank API.

Merchant Country codes are used to define country filters in Corporate Rules.

**Note:** Merchant Countries are never created by you. They are an enum served by the API, so this resource is query-only.

### The Merchant Country object

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `code` | STRING | Country's code. This is the only parameter you send when you use a country in a Corporate Rule. Example: "BRA". |
| `name` | STRING | Country's name, translated to the language of the Accept-Language header. Example: "Brazil". |
| `number` | STRING | Country's number. Example: "076". |
| `shortCode` | STRING | Country's short code. Example: "BR". |

### List Merchant Countries

`GET /v2/merchant-country`

Use this route to list the countries available in the Stark Bank API. Use the returned codes to define the country filters of your spending rules.

**NOTE:** This route returns the full enum in a single response. It is not paginated, so it accepts no limit or cursor parameters and returns no cursor.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `search` | OPTIONAL | Keyword to search for code, name, number or short code. The match is case- and accent-insensitive. Example: "brazil" |
| `fields` | OPTIONAL | List of strings to filter response JSON keys. Not available in the SDKs. |

**Request**

```python
import starkbank

countries = starkbank.merchantcountry.query(
    search="brazil"
)

for country in countries:
    print(country)
```

**Response**

```python
MerchantCountry(
    code=BRA,
    name=Brazil,
    number=076,
    short_code=BR
)
```

## Available Languages

Code samples on this page are in Python. The same content is available with samples in:

- [Python](https://docs.starkbank.com/api/v2/merchant-country-python.md)
- [Node.js](https://docs.starkbank.com/api/v2/merchant-country-node.md)
- [PHP](https://docs.starkbank.com/api/v2/merchant-country-php.md)
- [Java](https://docs.starkbank.com/api/v2/merchant-country-java.md)
- [Ruby](https://docs.starkbank.com/api/v2/merchant-country-ruby.md)
- [Elixir](https://docs.starkbank.com/api/v2/merchant-country-elixir.md)
- [.NET](https://docs.starkbank.com/api/v2/merchant-country-dotnet.md)
- [Go](https://docs.starkbank.com/api/v2/merchant-country-go.md)
- [Clojure](https://docs.starkbank.com/api/v2/merchant-country-clojure.md)
- [cURL](https://docs.starkbank.com/api/v2/merchant-country-curl.md)
