> For a complete page index, fetch https://docs.transak.com/llms.txt

# How to Handle Restricted Countries and States with Crypto Currencies API

## Overview

Cryptocurrency availability can vary depending on local regulations. A cryptocurrency may be available in most countries but restricted in specific countries or certain states or provinces within a country.

The `Get Crypto Currencies API` provides regional restriction information for each cryptocurrency through the `regionsNotSupported` field. You can use this information to determine which cryptocurrencies are available to a user based on their country and state before displaying the available options or requesting a quote.

The `regionsNotSupported` array contains information about the countries and states where a cryptocurrency is restricted. Each entry identifies a country, while the `restrictedStates` array lists the states or provinces where the restriction applies. If `restrictedStates` is empty (`[]`), the cryptocurrency is restricted throughout that country.

## Field reference

Each entry in `regionsNotSupported` describes the countries and states where a cryptocurrency is unavailable.

| Field              | Type             | Description                                                                                                                                                          |
| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `country`          | string           | Two-letter ISO country code, for example `US` or `CA`.                                                                                                               |
| `availability`     | string           | `none` indicates that the cryptocurrency is restricted throughout the country, while `partial` indicates that it is restricted only in specific states or provinces. |
| `notes`            | string           | Additional information about the restriction. This field is informational and should not be used for filtering logic.                                                |
| `restrictedStates` | array of strings | Contains the state or province codes where the cryptocurrency is restricted. An empty array (`[]`) indicates a country-wide restriction.                             |

If the user's country is not listed in `regionsNotSupported`, no regional restriction is specified for that country.

## How to decide whether to show a cryptocurrency

Find the entry in `regionsNotSupported` whose `country` matches the user's country, and check the `restrictedStates` array to determine whether the cryptocurrency should be displayed.

| Entry for the user's country | `restrictedStates`                                    | What to do                                               |
| ---------------------------- | ----------------------------------------------------- | -------------------------------------------------------- |
| None                         | –                                                     | No regional restriction is specified for that country.   |
| Present                      | Empty (`[]`)                                          | Hide the cryptocurrency for all users in that country.   |
| Present                      | Lists state codes                                     | Hide it only for users in those states.                  |
| Present                      | Lists state codes, but the user's state is not listed | No restriction applies to that user based on this entry. |

Also check the cryptocurrency's `isAllowed` status. If `isAllowed` is `false`, do not display the cryptocurrency regardless of its regional restriction information.

### Example: Country-level restriction (Canada)

Binance Coin (BNB) is restricted throughout Canada. The `CA` entry has `availability: none` and an empty `restrictedStates` array:

```json
{
  "symbol": "BNB",
  "name": "Binance Coin",
  "network": { "name": "bsc" },
  "isAllowed": true,
  "regionsNotSupported": [
    {
      "country": "CA",
      "availability": "none",
      "notes": "Regulatory restrictions apply nationwide",
      "restrictedStates": []
    },
    {
      "country": "US",
      "availability": "partial",
      "notes": "Cryptocurrency availability varies by state",
      "restrictedStates": ["MN", "NY", "LA"]
    }
  ]
}
```

Hide BNB for all users in Canada. For US users, hide it only in Minnesota (MN), New York (NY), and Louisiana (LA). Users in other US states can see BNB, subject to other applicable eligibility checks.

Although `isAllowed` is `true`, BNB must still be hidden for Canadian users because the regional restriction applies.

### Example: State-level restriction (United States)

Ethereum (ETH) is restricted in Minnesota, New York, and Louisiana. The `US` entry has `availability: partial` and lists the affected state codes:

```json
{
  "symbol": "ETH",
  "name": "Ethereum",
  "network": { "name": "ethereum" },
  "isAllowed": true,
  "regionsNotSupported": [
    {
      "country": "US",
      "availability": "partial",
      "notes": "Cryptocurrency availability varies by state",
      "restrictedStates": ["MN", "NY", "LA"]
    }
  ]
}
```

Hide ETH for users in MN, NY, and LA. Display it for users in other US states, subject to other applicable eligibility checks.

### Which country and state to use

Transak checks the address associated with the user's KYC information when the order is placed. Therefore, use the verified KYC address for regional restriction checks whenever it is available.

**Before KYC verification:** Use the country selected by the user or identified through their IP address as an initial reference. This allows you to filter the cryptocurrency list before the user completes KYC.

**After KYC verification:** Use the country and state from the user's verified KYC address for subsequent availability checks. If the verified address differs from the location initially used, re-evaluate cryptocurrency availability using the verified address.

Restrictions can change over time. Always retrieve the latest information from the API instead of maintaining a hardcoded list of restricted cryptocurrencies, countries, or states.

## What happens if you don't check

Transak enforces regional restrictions on its side, regardless of whether your integration performs an availability check. If the user's KYC country or state is restricted for the selected cryptocurrency, Transak rejects the request and the user cannot proceed with the purchase.

### Get Quote API

The [Get Quote API](/api/whitelabel/lookup/get-quote) returns an HTTP `400` response with error code `5011` when the selected cryptocurrency is restricted in the user's region.

**Example error response:**

```json
{
  "error": {
    "statusCode": 400,
    "message": "You are not allowed to buy USDT on ethereum. Please change the cryptocurrency to proceed",
    "errorCode": 5011
  }
}
```

The error message identifies the restricted cryptocurrency and network.

### Create Order API

The Create Order API also rejects the order if the user's verified KYC country or state is restricted for the selected cryptocurrency.

If you receive a regional restriction error from either API, ask the user to select another available cryptocurrency. Retrying the same request with the same cryptocurrency and user location will fail again.