Regional sale restrictions
How it works
Regional sales restrictions allow you to control in which countries items can be sold and help prevent abuse — for example, when a user purchases a game key at a reduced price in one region and activates it in another region.
The user’s country is passed in the country parameter when requesting the catalog using API calls from the Catalog subsection of the Game Keys group and the Virtual Items & Currency group. If the parameter is not provided, the country is determined based on the user’s IP address. The system then generates a catalog of items available in the user’s country.
Who can use it
Partners who want to limit item availability in certain countries or regions.
Integration flow
Note
If regions are specified for an item and the user’s country is not included in any of them, the item isn’t available in that country.
- Create regions where items will be available by calling the Create region API call. The API returns the region ID, which you will need at the next step.
Copy
- json
1{
2 "name": {
3 "en-US": "North America",
4 },
5 "countries": ["US", "CA"]
6}
Note
The country code is specified in ISO 3166-1 alpha-2 format. Check the list of countries supported by Xsolla before creating a region.
- Pass the region ID to the
regionsarray when creating or updating an item using the corresponding API calls from the Admin subsection:
regions array with IDs of regions where the item can be sold:Copy
- json
1"regions": [
2 {
3 "id": 123
4 },
5 {
6 "id": 456
7 }
8]
Notice
After regions are configured and assigned to a game, keys can only be uploaded using the Upload codes API call.
Was this article helpful?
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.Found a typo or other text error? Select the text and press Ctrl+Enter.