# Common regions

Regional sales restrictions allow you to manage item availability in specific countries or groups of countries. For example, you can sell a game only in certain countries due to licensing restrictions.

Restrictions are configured using regions. Each region combines one or more countries under a single `region_id` identifier. You can link an item to one or more regions.

Item availability is determined as follows:

* If no regions are specified for an item, it is available for purchase in all countries.
* If regions are specified for an item and the user's country is included in one of them, the item is available to this user.
* If regions are specified for an item and the user's country is not included in any of them, the item is unavailable to this user.

The user's country is passed in the `country` parameter when requesting the catalog via API calls from the **Catalog** subsection. If the parameter is not passed, the country is determined based on the user's IP address.

The user's country is checked against the item's regions twice: when requesting the catalog and when creating an order. Unavailable items are not included in the catalog response, and an order with such item will not be created.

Use API calls from the **Common regions** group to create, update, and delete regions.

Regional sales restrictions setup flow:

1. Create a region using the [Create region](https://developers.xsolla.com/api/catalog/common-regions/admin-create-region/) API call, specifying the list of countries. The response returns a `region_id` that is required in the next step.
2. Link a virtual item to the region by passing its `region_id` in the `regions` array when [creating](https://developers.xsolla.com/api/catalog/virtual-items-currency-admin/admin-create-virtual-item/) or [updating](https://developers.xsolla.com/api/catalog/virtual-items-currency-admin/admin-update-virtual-item/) the item.
3. Display the catalog to the user using API calls from the **Catalog** subsection, for example, the [Get virtual items list](https://developers.xsolla.com/api/catalog/virtual-items-currency-catalog/get-virtual-items) API call. The user's country is determined by the `country` parameter or, if it is not provided, based on the user's IP address. Items unavailable in the user's country are not included in the catalog response.
4. When the user proceeds to pay for an item or cart, create an order:
    * If the item was added to the cart — using the [Create order with all items from particular cart](https://developers.xsolla.com/api/catalog/payment-client-side/create-order) or [Create order with all items from current cart](https://developers.xsolla.com/api/catalog/payment-client-side/create-order) API call.
    * For a fast purchase of a single item — using the [Create order with specified item](https://developers.xsolla.com/api/catalog/payment-client-side/create-order-with-item) API call, passing the item SKU.

  The response contains a token for opening the payment UI.

<div class="note">
  <b>Note</b><br><br>
Xsolla checks whether the user's country is included in the region specified for the item. If the country is not included in the item's region, the order cannot be created.
</div>
<br>

5. Implement opening the payment UI to pay for the order.

![Common regions](https://cdn.xsolla.net/developers/current/images/api_docs/api-regions.svg)


