# Merchant Country

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

A country is identified by its code, which is the only field you send when you use a country in an issuing rule.

Use these codes to define the country filters of the spending rules of your [Issuing Holder resource](https://docs.starkinfra.com/api/v2/issuing-holder.md) and [Issuing Card resource](https://docs.starkinfra.com/api/v2/issuing-card.md).

**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 field you send when you use a country in an issuing rule. Example: "BRA". |
| `name` | STRING | Country's name. 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 merchant countries available in the Stark Infra API. Their codes will be accepted as country filters in your issuing rules.

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

**Parameters**

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

**Request**

```python
import starkinfra

countries = starkinfra.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.starkinfra.com/api/v2/merchant-country-python.md)
- [Node.js](https://docs.starkinfra.com/api/v2/merchant-country-node.md)
- [PHP](https://docs.starkinfra.com/api/v2/merchant-country-php.md)
- [Java](https://docs.starkinfra.com/api/v2/merchant-country-java.md)
- [Ruby](https://docs.starkinfra.com/api/v2/merchant-country-ruby.md)
- [Elixir](https://docs.starkinfra.com/api/v2/merchant-country-elixir.md)
- [.NET](https://docs.starkinfra.com/api/v2/merchant-country-dotnet.md)
- [Go](https://docs.starkinfra.com/api/v2/merchant-country-go.md)
- [Clojure](https://docs.starkinfra.com/api/v2/merchant-country-clojure.md)
- [cURL](https://docs.starkinfra.com/api/v2/merchant-country-curl.md)
