How to Handle Restricted Countries and States with Crypto Currencies API
Learn how to use regionsNotSupported and restrictedStates to identify country- and state-level restrictions and display only the cryptocurrencies available to each user.
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.
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.
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:
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:
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 returns an HTTP 400 response with error code 5011 when the selected cryptocurrency is restricted in the user’s region.
Example error response:
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.