# Catalog API # Overview - **Version:** 2.0.0 - **Servers:** `https://store.xsolla.com/api` - [Contact Us by Email](mailto:integration@xsolla.com) - **Contact URL:** https://xsolla.com/ - **Required TLS version:** 1.2 The Catalog API allows you to configure a catalog of in-game items on the Xsolla side and display the catalog to users in your store. The API allows you to manage the following catalog entities: * **Virtual items** — in-game items such as weapons, skins, boosters. * **Virtual currency** — virtual money used to purchase virtual goods. * **Virtual currency packages** — predefined bundles of virtual currency. * **Bundles** — combined packages of virtual items, currency, or game keys sold as a single SKU. * **Game keys** — keys for games and DLCs distributed via platforms like Steam or other DRM providers. * **Groups** — logical groupings for organizing and sorting items within the catalog. ## API calls The API is divided into the following groups: * **Admin** — calls for creating, updating, deleting, and configuring catalog items and groups. Authenticated via [basic access authentication](https://developers.xsolla.com/zh/payment-ui-and-flow/payment-ui/how-to-get-payment-token/#payments_solution_get_user_auth_token_basic_auth) with your merchant or project credentials. Not intended for storefront use. * **Catalog** — calls for retrieving items and building custom storefronts for end users. Designed to handle high-load scenarios. Support optional user JWT authorization to return personalized data such as user-specific limits and active promotions. # Authentication API calls require authentication either on behalf of a user or on behalf of a project. The authentication scheme used is specified in the **Security** section in the description of each call. ## Authentication using user's JWT User's JWT authentication is used when a request is sent from a browser, mobile application, or game. By default, the `XsollaLoginUserJWT` scheme is applied. For details on how to create a token, see the [Xsolla Login API documentation](/zh/api/login/authentication-schemes#getting-user-token). The token is passed in the `Authorization` header in the following format: `Authorization: Bearer `, where `` is the user token. The token identifies the user and provides access to personalized data. You can try this call using the following test token: ``` eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE5NjIyMzQwNDgsImlzcyI6Imh0dHBzOi8vbG9naW4ueHNvbGxhLmNvbSIsImlhdCI6MTU2MjE0NzY0OCwidXNlcm5hbWUiOiJ4c29sbGEiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6IjA2SWF2ZHpDeEVHbm5aMTlpLUc5TmMxVWFfTWFZOXhTR3ZEVEY4OFE3RnMiLCJzdWIiOiJkMzQyZGFkMi05ZDU5LTExZTktYTM4NC00MjAxMGFhODAwM2YiLCJlbWFpbCI6InN1cHBvcnRAeHNvbGxhLmNvbSIsInR5cGUiOiJ4c29sbGFfbG9naW4iLCJ4c29sbGFfbG9naW5fcHJvamVjdF9pZCI6ImU2ZGZhYWM2LTc4YTgtMTFlOS05MjQ0LTQyMDEwYWE4MDAwNCIsInB1Ymxpc2hlcl9pZCI6MTU5MjR9.GCrW42OguZbLZTaoixCZgAeNLGH2xCeJHxl8u8Xn2aI ``` Alternatively, you can use a [token for opening the payment UI](/zh/api/pay-station/token/create-token). ## Basic HTTP authentication Basic HTTP authentication is used for server-to-server interactions, when an API call is sent directly from your server rather than from a user's browser or mobile application. HTTP Basic authentication with an [API key](/zh/api/getting-started/#api_keys_overview) is typically used.
Note

The API key is confidential and must not be stored or used in client applications.
With basic server-side authentication, all API requests must include the following header: - for `basicAuth` — `Authorization: Basic `, where `your_authorization_basic_key` is the `project_id:api_key` pair encoded in Base64 - for `basicMerchantAuth` — `Authorization: Basic `, where `your_authorization_basic_key` is the `merchant_id:api_key` pair encoded in Base64 You can find the parameter values in [Publisher Account](https://publisher.xsolla.com/): - `merchant_id` is displayed: - In **Company settings > Company**. - In the URL in the browser address bar on any Publisher Account page. The URL has the following format: `https://publisher.xsolla.com/`. - `project_id` is displayed: - Next to the project name in Publisher Account. - In the URL in the browser address bar when working on a project in Publisher Account. The URL has the following format: `https://publisher.xsolla.com//projects/`. - `api_key` is shown in Publisher Account only at the time of creation and must be stored securely on your side. You can create an API key in the following sections: - [Company settings > API keys](https://publisher.xsolla.com/0/settings/api_key) - [Project settings > API key](https://publisher.xsolla.com/0/projects/0/edit/api_key)
Notice

If a required API call doesn't include the project_id path parameter, use an API key that is valid across all company projects for authorization.
For more information about working with API keys, see the [API references](/zh/api/getting-started/#api_keys_overview). ## Authentication with guest access support The `AuthForCart` authentication scheme is used for cart purchases and supports two modes: 1. **Authentication with a user's JWT.** The token is passed in the `Authorization` header in the following format: `Authorization: Bearer `, where `` is the user token. The token identifies the user and provides access to personalized data. You can try this call using the following test token: ``` eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE5NjIyMzQwNDgsImlzcyI6Imh0dHBzOi8vbG9naW4ueHNvbGxhLmNvbSIsImlhdCI6MTU2MjE0NzY0OCwidXNlcm5hbWUiOiJ4c29sbGEiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6IjA2SWF2ZHpDeEVHbm5aMTlpLUc5TmMxVWFfTWFZOXhTR3ZEVEY4OFE3RnMiLCJzdWIiOiJkMzQyZGFkMi05ZDU5LTExZTktYTM4NC00MjAxMGFhODAwM2YiLCJlbWFpbCI6InN1cHBvcnRAeHNvbGxhLmNvbSIsInR5cGUiOiJ4c29sbGFfbG9naW4iLCJ4c29sbGFfbG9naW5fcHJvamVjdF9pZCI6ImU2ZGZhYWM2LTc4YTgtMTFlOS05MjQ0LTQyMDEwYWE4MDAwNCIsInB1Ymxpc2hlcl9pZCI6MTU5MjR9.GCrW42OguZbLZTaoixCZgAeNLGH2xCeJHxl8u8Xn2aI ``` Alternatively, you can use a [token for opening the payment UI](/zh/api/pay-station/token/create-token). 2. **Simplified mode without Authorization header.** This mode is used only for unauthorized users and can be applied only for [game key sales](/zh/doc/buy-button/how-to/set-up-authentication/#guides_buy_button_selling_items_not_authenticated_users). Instead of a token, the request must include the following headers: - `x-unauthorized-id` with a request ID - `x-user` with the user's email address encoded in Base64 ## Useful links - [API calls by interaction model](https://developers.xsolla.com/zh/api/catalog/) - [Endpoint types](https://developers.xsolla.com/zh/api/catalog/) - [Errors handling](https://developers.xsolla.com/zh/api/catalog/) - [API keys](https://developers.xsolla.com/zh/api/catalog/) # Core entity structure Items of all types (virtual items, bundles, virtual currency, and keys) use a similar data structure. Understanding the basic structure simplifies working with the API and helps you navigate the documentation more easily.
Note

Some calls may include additional fields but they don't change the basic structure.
**Identification** - `merchant_id` — company ID in [Publisher Account](https://publisher.xsolla.com/) - `project_id` — project ID in Publisher Account - `sku` — item SKU, unique within the project **Store display** - `name` — item name - `description` — item description - `image_url` — image URL - `is_enabled` — item availability - `is_show_in_store` — whether the item is displayed in the catalog For more information about managing item availability in the catalog, see the [documentation](/zh/items-catalog/catalog-features/items-availability/). **Organization** - `type` — item type, for example, a virtual item (`virtual_item`) or bundle (`bundle`) - `groups` — groups the item belongs to - `order` — display order in the catalog **Sale conditions** - `prices` — prices in real or virtual currency - `limits` — purchase limits - `periods` — availability periods - `regions` — regional restrictions **Example of core entity structure:** ```json { "attributes": [], "bundle_type": "virtual_currency_package", "content": [ { "description": { "en": "Main in-game currency" }, "image_url": "https://.../image.png", "name": { "en": "Crystals", "de": "Kristalle" }, "quantity": 500, "sku": "com.xsolla.crystal_2", "type": "virtual_currency" } ], "description": { "en": "Crystals x500" }, "groups": [], "image_url": "https://.../image.png", "is_enabled": true, "is_free": false, "is_show_in_store": true, "limits": { "per_item": null, "per_user": null, "recurrent_schedule": null }, "long_description": null, "media_list": [], "name": { "en": "Medium crystal pack" }, "order": 1, "periods": [ { "date_from": null, "date_until": "2020-08-11T20:00:00+03:00" } ], "prices": [ { "amount": 20, "country_iso": "US", "currency": "USD", "is_default": true, "is_enabled": true } ], "regions": [], "sku": "com.xsolla.crystal_pack_2", "type": "bundle", "vc_prices": [] } ``` # Basic purchase flow The Xsolla API allows you to implement in-game store logic, including retrieving the item catalog, managing the cart, creating orders, and tracking their status. Depending on the integration scenario, API calls are divided into **Admin** and **Catalog** subsections, which use different [authentication schemes](/zh/api/catalog/section/authentication). The following example shows a basic flow for setting up and operating a store, from item creation to purchase. ## Create items and groups (Admin) Create an item catalog for your store, such as virtual items, bundles, or virtual currency. Example API calls: - [Create virtual item](/zh/api/catalog/virtual-items-currency-admin/admin-create-virtual-item) - [Create bundle](/zh/api/catalog/bundles-admin/admin-create-bundle) - [Create virtual currency](/zh/api/catalog/virtual-items-currency-admin/admin-create-virtual-currency) ## Set up promotions, chains, and limits (Admin) Configure user acquisition and monetization tools, such as discounts, bonuses, daily rewards, or offer chains. Example API calls: - [Create bonus promotion](/zh/api/liveops/promotions-bonuses/create-bonus-promotion) - [Create daily reward](/zh/api/liveops/daily-chain-admin/admin-create-daily-chain) - [Create unique catalog offer promotion](/zh/api/liveops/promotions-unique-catalog-offers/admin-create-unique-catalog-offer) ## Get item information (Client) Configure item display in your application.
Notice

Do not use API calls from the Admin subsection to build a user catalog. These API calls have rate limits and aren't intended for user traffic.

Example API calls: - [Get virtual items list](/zh/api/catalog/virtual-items-currency-catalog/get-virtual-items) - [Get item group list](/zh/api/catalog/virtual-items-currency-catalog/get-item-groups) - [Get list of bundles](/zh/api/catalog/bundles-catalog/get-bundle-list) - [Get sellable items list](/zh/api/catalog/common-catalog/get-sellable-items)
Note

By default, catalog API calls return items that are currently available in the store at the time of the request. To retrieve items that are not yet available or are no longer available, include the parameter "show_inactive_time_limited_items": 1 in the catalog request.
## Sell items You can sell items using the following methods: - Fast purchase — sell one SKU multiple times. - Cart purchase — the user adds items to the cart, removes items, and updates quantities within a single order. If an item is purchased using virtual currency instead of real money, use the [Create order with specified item purchased by virtual currency](/zh/api/catalog/virtual-payment/create-order-with-item-for-virtual-currency) API call. The payment UI is not required, as the charge is processed when the API call is executed. For free item purchase, use the [Create order with specified free item](/zh/api/catalog/free-item/create-free-order-with-item) API call or the [Create order with free cart](/zh/api/catalog/free-item/create-free-order) API call. The payment UI is not required — the order is immediately set to the done status. ### Fast purchase Use the client-side API call to [create an order with a specified item](/zh/api/catalog/payment-client-side/create-order-with-item). The call returns a token used to open the payment UI.
Note

Discount information is available to the user only in the payment UI. Promo codes are not supported.
### Cart purchase Cart setup and purchase can be performed on the client or on the server side. **Set up and purchase a cart on the client** Implement the logic of adding and removing items by yourself. Before calling the API for setting up a cart, you will not have information about which promotions will be applied to the purchase. This means that the total cost and details of the added bonus items will not be known. Implement the following cart logic: 1. After the player has filled a cart, use the [Fill cart with items](/zh/api/shop-builder/operation/cart-fill/) API call. The call returns the current information about the selected items (prices before and after discounts, bonus items). 2. Update the cart contents based on user actions: - To add an item or change item quantity, use the [Update cart item by cart ID](/zh/api/shop-builder/operation/put-item-by-cart-id/) API call. - To remove an item, use the [Delete cart item by cart ID](/zh/api/shop-builder/operation/delete-item-by-cart-id/) API call.
Note

To get the current status of the cart, use the Get current user's cart API call.
3. Use the [Create order with all items from current cart](/zh/api/shop-builder/operation/create-order/) API call. The call returns the order ID and payment token. The newly created order is set to new status by default. **Set up and purchase a cart on the server** This setup option may take longer for setting the cart up, since each change to the cart must be accompanied by API calls. Implement the following cart logic: 1. After the player has filled a cart, use the [Fill cart with items](/zh/api/catalog/cart-server-side) API call. The call returns current information about the selected items (prices before and after discounts, bonus items). 2. Use the [Create order with all items from current cart](/zh/api/shop-builder/operation/create-order/) API call. The call returns the order ID and payment token. The newly created order is set to new status by default. ## Open payment UI Use the returned token to open the payment UI in a new window. Other ways to open the payment UI are described in the [documentation](/zh/payment-ui-and-flow/payment-ui/how-to-open-payment-ui/#open_payment_ui). | Action | Endpoint | |:--------------------------------|:--------------------------------------------------------------------------| | Open in production environment. | https://secure.xsolla.com/paystation4/?token={token} | | Open in sandbox mode. | https://sandbox-secure.xsolla.com/paystation4/?token={token} |
Note

Use sandbox mode during development and testing. Test purchases don't charge real accounts. You can use test bank cards. After the first real payment is made, a strict sandbox payment policy takes effect. A payment in sandbox mode is available only to users specified in [Publisher Account > Company settings > Users](https://publisher.xsolla.com/0/settings/users). Buying virtual currency and items for real currency is possible only after signing a license agreement with Xsolla. To do this, in [Publisher Account](https://publisher.xsolla.com/), go to **Agreements & Taxes > Agreements**, complete the agreement form, and wait for confirmation. It may take up to 3 business days to review the agreement.
To enable or disable sandbox mode, change the value of the `sandbox` parameter in the request for fast purchase and cart purchase. Sandbox mode is off by default. Possible order statuses: - `new` — order created - `paid` — payment received - `done` — item delivered - `canceled` — order canceled - `expired` — payment expired Track order status using one of the following methods: - [webhooks configured on your server](/zh/virtual-goods/own-ui/server-side-token-generation/set-up-order-tracking/#payments_integration_order_tracking) - [short-polling](/zh/virtual-goods/own-ui/client-side-token-generation/set-up-order-tracking/#guides_shop_builder_integrate_store_get_order_status_via_short_polling) - [WebSocket API](/zh/virtual-goods/own-ui/client-side-token-generation/set-up-order-tracking/#guides_shop_builder_integrate_store_get_order_status_via_websocket_api) ## Useful links - Authentication - [API calls by interaction model](/zh/api/catalog/section/authentication) - [Payment testing](/zh/dev-resources/testing/general-info/#general_overview) - [Set up order status tracking](/zh/virtual-goods/own-ui/client-side-token-generation/set-up-order-tracking/?link=200-api#payments_integration_order_tracking) - [Webhooks](/zh/webhooks/overview) - [Rate limits](/zh/api/login/rate-limits) - [Errors handling](/zh/api/getting-started/#api_errors_handling) - [API keys](/zh/api/getting-started/#api_keys_overview) # Pagination API calls that return large sets of records (for example, when building a catalog) return data in pages. Pagination is a mechanism that limits the number of items returned in a single API response and allows you to retrieve subsequent pages sequentially. Use the following parameters to control the number of returned items: - `limit` — number of items per page - `offset` — index of the first item on the page (numbering starts from 0) - `has_more` — indicates whether another page is available - `total_items_count` — total number of items Example request: ``` GET /items?limit=20&offset=40 ``` Response example: ```json { "items": [...], "has_more": true, "total_items_count": 135 } ``` It is recommended to send subsequent requests until the response returns `has_more = false`. # Date and time format Dates and time values are passed in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The following are supported: - UTC offset - `null` value when there is no time restriction for displaying an item - [Unix timestamp](https://www.unixtimestamp.com/) (in seconds) used in some fields Format: `YYYY-MM-DDTHH:MM:SS±HH:MM` Example: `2026-03-16T10:00:00+03:00` # Localization Xsolla supports localization of user-facing fields such as item name and description. Localized values are passed as an object where the language code is used as the key. The full list of supported languages is available in the [documentation](/zh/doc/shop-builder/references/supported-languages/). **Supported fields** Localization can be specified for the following parameters: - `name` - `description` - `long_description` **Locale format** The locale key can be specified in one of the following formats: - Two-letter language code: `en`, `ru` - Five-letter language code: `en-US`, `ru-RU`, `de-DE` **Examples** Example with a two-letter language code: ```json { "name": { "en": "Starter Pack", "ru": "Стартовый набор" } } ``` Example with a five-letter language code: ```json { "description": { "en-US": "Premium bundle", "de-DE": "Premium-Paket" } } ``` # Error response format If an error occurs, the API returns an HTTP status and a JSON response body. The full list of store-related errors is available in the [documentation](/zh/dev-resources/references/errors/store-errors/). **Response example:** ```json { "errorCode": 1102, "errorMessage": "Validation error", "statusCode": 422, "transactionId": "c9e1a..." } ``` - `errorCode` — error code. - `errorMessage` — short error description. - `statusCode` — HTTP response status. - `transactionId` — request ID. Returned only in some cases. - `errorMessageExtended` — additional error details, such as request parameters. Returned only in some cases. **Extended response example:** ```json { "errorCode": 7001, "errorMessage": "Chain not found", "errorMessageExtended": { "chain_id": "test_chain_id", "project_id": "test_project_id", "step_number": 2 }, "statusCode": 404 } ``` **Common HTTP status codes** - `400` — invalid request - `401` — authentication error - `403` — insufficient permissions - `404` — resource not found - `422` — validation error - `429` — rate limit exceeded **Recommendations** - Handle the HTTP status and the response body together. - Use `errorCode` to process errors related to application logic. - Use `transactionId` to identify requests more quickly when analyzing errors. Version: 2.0.0 ## Servers ``` https://store.xsolla.com/api ``` ## Security ### AuthForCart The `AuthForCart` authentication scheme is used for cart purchases and supports two modes: 1. Authentication with a user's JWT. The token is passed in the Authorization header in the following format: `Authorization: Bearer `, where `` is the user token. The token identifies the user and provides access to personalized data. You can try this call using the following test token:`Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE5NjIyMzQwNDgsImlzcyI6Imh0dHBzOi8vbG9naW4ueHNvbGxhLmNvbSIsImlhdCI6MTU2MjE0NzY0OCwidXNlcm5hbWUiOiJ4c29sbGEiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6IjA2SWF2ZHpDeEVHbm5aMTlpLUc5TmMxVWFfTWFZOXhTR3ZEVEY4OFE3RnMiLCJzdWIiOiJkMzQyZGFkMi05ZDU5LTExZTktYTM4NC00MjAxMGFhODAwM2YiLCJlbWFpbCI6InN1cHBvcnRAeHNvbGxhLmNvbSIsInR5cGUiOiJ4c29sbGFfbG9naW4iLCJ4c29sbGFfbG9naW5fcHJvamVjdF9pZCI6ImU2ZGZhYWM2LTc4YTgtMTFlOS05MjQ0LTQyMDEwYWE4MDAwNCIsInB1Ymxpc2hlcl9pZCI6MTU5MjR9.GCrW42OguZbLZTaoixCZgAeNLGH2xCeJHxl8u8Xn2aI`. Alternatively, you can use a [token for opening the payment UI](/zh/api/pay-station/token/create-token). 2. Simplified mode without `Authorization` header. This mode is used only for unauthorized users and can be applied only for [selling game keys](/zh/doc/buy-button/how-to/set-up-authentication/#guides_buy_button_selling_items_not_authenticated_users). Instead of a token, the request must include the following headers: * `x-unauthorized-id` with a request ID * `x-user` with the user’s email address encoded in Base64. Type: http Scheme: bearer ### XsollaLoginUserJWT Client-side calls use the `XsollaLoginUserJWT` authentication scheme. The request must include the user's JWT in the `Authorization` header in the following format: Bearer ``. The token identifies the user and provides access to personalized data. For details on how to create a token, refer to the [Xsolla Login API documentation](/zh/api/login/authentication-schemes#getting-user-token). You can try this call using the following test token: `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE5NjIyMzQwNDgsImlzcyI6Imh0dHBzOi8vbG9naW4ueHNvbGxhLmNvbSIsImlhdCI6MTU2MjE0NzY0OCwidXNlcm5hbWUiOiJ4c29sbGEiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6IjA2SWF2ZHpDeEVHbm5aMTlpLUc5TmMxVWFfTWFZOXhTR3ZEVEY4OFE3RnMiLCJzdWIiOiJkMzQyZGFkMi05ZDU5LTExZTktYTM4NC00MjAxMGFhODAwM2YiLCJlbWFpbCI6InN1cHBvcnRAeHNvbGxhLmNvbSIsInR5cGUiOiJ4c29sbGFfbG9naW4iLCJ4c29sbGFfbG9naW5fcHJvamVjdF9pZCI6ImU2ZGZhYWM2LTc4YTgtMTFlOS05MjQ0LTQyMDEwYWE4MDAwNCIsInB1Ymxpc2hlcl9pZCI6MTU5MjR9.GCrW42OguZbLZTaoixCZgAeNLGH2xCeJHxl8u8Xn2aI`. Alternatively, you can use a [token for opening the payment UI](/zh/api/pay-station/token/create-token). Type: http Scheme: bearer Bearer Format: JWT ### basicAuth Server-side calls use the `basicAuth` authentication scheme. All requests to API must contain the `Authorization: Basic ` header, where `your_authorization_basic_key` is the `project_id:api_key` pair encoded according to the Base64 standard. You can use `merchant_id` instead of `project_id` if you need. It doesn't affect functionality. Go to [Publisher Account](https://publisher.xsolla.com/) to find values of the parameters: * `merchant_id` is shown: * In the **Company settings > Company** section * In the URL in the browser address bar on any Publisher Account page. The URL has the following format: `https://publisher.xsolla.com/`. * `api_key` is shown in Publisher Account only once when it is created and must be stored on your side. You can create a new key in the following section: * [Company settings > API keys](https://publisher.xsolla.com/0/settings/api_key) * [Project settings > API keys](https://publisher.xsolla.com/0/projects/0/edit/api_key) {% html name="div" attrs={"class": "notice"} %} **Notice** If a required API call doesn't include the `project_id` path parameter, use an API key that is valid across all company projects for authorization. {% /html %} * `project_id` is shown: * In Publisher Account next to the name of the project. * In the URL in the browser address bar when working on project in Publisher Account. The URL has the following format: `https://publisher.xsolla.com//projects/`. For more information about working with API keys, see the [API reference](https://developers.xsolla.com/zh/api/getting-started/#api_keys_overview). Type: http Scheme: basic ### basicMerchantAuth Server-side calls use the `basicMerchantAuth` authentication scheme. All requests to API must contain the `Authorization: Basic ` header, where `your_authorization_basic_key` is the `merchant_id:api_key` pair encoded according to the Base64 standard. Go to [Publisher Account](https://publisher.xsolla.com/) to find values of the parameters: * `merchant_id` is shown: * In the **Company settings > Company** section * In the URL in the browser address bar on any Publisher Account page. The URL has the following format: `https://publisher.xsolla.com/` * `api_key` is shown in Publisher Account only once when it is created and must be stored on your side. You can create a new key in the [Company settings > API keys](https://publisher.xsolla.com/0/settings/api_key) section. For more information about working with API keys, see the [API reference](https://developers.xsolla.com/zh/api/getting-started/#api_keys_overview). Type: http Scheme: basic ## Download OpenAPI description [Catalog API](https://developers.xsolla.com/_bundle/@l10n/zh/api/catalog/index.yaml) ## 管理 ### 获取虚拟货币列表 - [GET /v2/project/{project_id}/admin/items/virtual_currency](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-get-virtual-currencies-list.md): 获取项目中的虚拟货币列表以进行管理。 注意不要使用此端点来构建商店目录。 ### 创建虚拟货币 - [POST /v2/project/{project_id}/admin/items/virtual_currency](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-create-virtual-currency.md): 创建虚拟货币。 ### 获取虚拟货币套餐列表(管理) - [GET /v2/project/{project_id}/admin/items/virtual_currency/package](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-get-virtual-currency-packages-list.md): 获取项目中虚拟货币套餐的列表以进行管理。 注意不要使用此端点来构建商店目录。 ### 创建虚拟货币套餐 - [POST /v2/project/{project_id}/admin/items/virtual_currency/package](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-create-virtual-currency-package.md): 创建虚拟货币套餐。 ### 删除虚拟货币套餐 - [DELETE /v2/project/{project_id}/admin/items/virtual_currency/package/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-delete-virtual-currency-package.md): 删除虚拟货币套餐。 ### 获取虚拟货币套餐 - [GET /v2/project/{project_id}/admin/items/virtual_currency/package/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-get-virtual-currency-package.md): 获取项目中的虚拟货币套餐以进行管理。 注意不要使用此端点来构建商店目录。 ### 更新虚拟货币套餐 - [PUT /v2/project/{project_id}/admin/items/virtual_currency/package/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-update-virtual-currency-package.md): 更新虚拟货币套餐。 ### 删除虚拟货币 - [DELETE /v2/project/{project_id}/admin/items/virtual_currency/sku/{virtual_currency_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-delete-virtual-currency.md): 删除虚拟货币。 ### 获取虚拟货币 - [GET /v2/project/{project_id}/admin/items/virtual_currency/sku/{virtual_currency_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-get-virtual-currency.md): 获取项目中的虚拟货币以进行管理。 注意不要使用此端点来构建商店目录。 ### 更新虚拟货币 - [PUT /v2/project/{project_id}/admin/items/virtual_currency/sku/{virtual_currency_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-update-virtual-currency.md): 更新虚拟货币。 ### 获取虚拟物品列表 - [GET /v2/project/{project_id}/admin/items/virtual_items](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-get-virtual-items-list.md): 获取项目中的虚拟物品列表以进行管理。 注意不要使用此端点来构建商店目录。 ### 创建虚拟物品 - [POST /v2/project/{project_id}/admin/items/virtual_items](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-create-virtual-item.md): 创建虚拟物品。 ### 按照指定组的外部ID获取虚拟物品列表 - [GET /v2/project/{project_id}/admin/items/virtual_items/group/external_id/{external_id}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-get-virtual-items-list-by-group-external-id.md): 获取组中的虚拟物品列表以进行管理。 注意不要使用此端点来构建商店目录。 ### 按照指定组ID获取虚拟物品列表 - [GET /v2/project/{project_id}/admin/items/virtual_items/group/id/{group_id}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-get-virtual-items-list-by-group-id.md): 获取组中的虚拟物品列表以进行管理。 注意不要使用此端点来构建商店目录。 ### 删除虚拟物品 - [DELETE /v2/project/{project_id}/admin/items/virtual_items/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-delete-virtual-item.md): 删除虚拟物品。 ### 获取虚拟物品 - [GET /v2/project/{project_id}/admin/items/virtual_items/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-get-virtual-item.md): 获取项目中的虚拟物品以进行管理。 注意不要使用此端点来构建商店目录。 ### 更新虚拟物品 - [PUT /v2/project/{project_id}/admin/items/virtual_items/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-admin/admin-update-virtual-item.md): 更新虚拟物品。 ## 目录 ### 获取虚拟货币列表 - [GET /v2/project/{project_id}/items/virtual_currency](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-catalog/get-virtual-currency.md): Gets a virtual currency list for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 获取虚拟货币套餐列表 - [GET /v2/project/{project_id}/items/virtual_currency/package](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-catalog/get-virtual-currency-package.md): Gets a virtual currency packages list for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 按SKU获取虚拟币套餐 - [GET /v2/project/{project_id}/items/virtual_currency/package/sku/{virtual_currency_package_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-catalog/get-virtual-currency-package-sku.md): Gets a virtual currency packages by SKU for building a catalog. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 按SKU获取虚拟货币 - [GET /v2/project/{project_id}/items/virtual_currency/sku/{virtual_currency_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-catalog/get-virtual-currency-sku.md): Gets a virtual currency by SKU for building a catalog. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 获取虚拟物品列表 - [GET /v2/project/{project_id}/items/virtual_items](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-catalog/get-virtual-items.md): Gets a virtual items list for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 获取所有虚拟物品列表 - [GET /v2/project/{project_id}/items/virtual_items/all](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-catalog/get-all-virtual-items.md): Gets a list of all virtual items for searching on client-side. Notice Returns only item SKU, name, groups and description. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 按指定组获取商品列表 - [GET /v2/project/{project_id}/items/virtual_items/group/{external_id}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-catalog/get-virtual-items-group.md): Gets an items list from the specified group for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 按SKU获取虚拟物品 - [GET /v2/project/{project_id}/items/virtual_items/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-items-currency-catalog/get-virtual-items-sku.md): Gets a virtual item by SKU for building a catalog. Notice This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ## 虚拟支付 ### 使用以虚拟货币购买的指定商品创建订单 - [POST /v2/project/{project_id}/payment/item/{item_sku}/virtual/{virtual_currency_sku}](https://developers.xsolla.com/zh/api/catalog/virtual-payment/create-order-with-item-for-virtual-currency.md): Creates item purchase using virtual currency. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ## 目录 ### 获取游戏列表 - [GET /v2/project/{project_id}/items/game](https://developers.xsolla.com/zh/api/catalog/game-keys-catalog/get-games-list.md): Gets a games list for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 获取DRM列表 - [GET /v2/project/{project_id}/items/game/drm](https://developers.xsolla.com/zh/api/catalog/game-keys-catalog/get-drm-list.md): 获取可用DRM的列表。 ### 按指定组获取游戏列表 - [GET /v2/project/{project_id}/items/game/group/{external_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-catalog/get-games-group.md): Gets a games list from the specified group for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 按指定组获取游戏密钥列表 - [GET /v2/project/{project_id}/items/game/key/group/{external_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-catalog/get-game-keys-group.md): Gets a game key list from the specified group for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 获取用于目录的游戏密钥 - [GET /v2/project/{project_id}/items/game/key/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/game-keys-catalog/get-game-key-by-sku.md): Gets a game key for the catalog. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 将游戏加入到目录 - [GET /v2/project/{project_id}/items/game/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/game-keys-catalog/get-game-by-sku.md): Gets a game for the catalog. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ## 权利 ### 授予权利(管理员) - [POST /v2/project/{project_id}/admin/entitlement/grant](https://developers.xsolla.com/zh/api/catalog/game-keys-entitlement/grant-entitlement-admin.md): 授予用户权利。 注意:只能授予DRM free平台的游戏代码或游戏。 ### 撤销授权(管理员) - [POST /v2/project/{project_id}/admin/entitlement/revoke](https://developers.xsolla.com/zh/api/catalog/game-keys-entitlement/revoke-entitlement-admin.md): 撤销用户的权利。 注意:只能撤销DRM free平台的游戏密钥或游戏。 ### 获取用户拥有的游戏列表 - [GET /v2/project/{project_id}/entitlement](https://developers.xsolla.com/zh/api/catalog/game-keys-entitlement/get-user-games.md): Get the list of games owned by the user. The response will contain an array of games owned by a particular user. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 通过客户端兑换游戏密钥 - [POST /v2/project/{project_id}/entitlement/redeem](https://developers.xsolla.com/zh/api/catalog/game-keys-entitlement/redeem-game-pin-code.md): Grants entitlement by a provided game code. Notice You can redeem codes only for the DRM-free platform. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ## 管理 ### 获取游戏列表(管理) - [GET /v2/project/{project_id}/admin/items/game](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-get-game-list.md): 获取项目中的游戏列表以进行管理。 游戏由用户可以购买的游戏密钥组成。 注意不要使用此端点来构建商店目录。 ### 创建游戏 - [POST /v2/project/{project_id}/admin/items/game](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-create-game.md): 在项目中创建游戏。 ### 通过ID删除游戏 - [DELETE /v2/project/{project_id}/admin/items/game/id/{item_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-delete-game-by-id.md): 根据ID删除项目中的游戏。 ### 通过ID获取游戏(管理) - [GET /v2/project/{project_id}/admin/items/game/id/{item_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-get-game-by-id.md): 获取游戏以进行管理。 游戏由用户可以购买的游戏密钥组成。 注意不要使用此端点来构建商店目录。 ### 通过ID更新游戏 - [PUT /v2/project/{project_id}/admin/items/game/id/{item_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-update-game-by-id.md): 通过ID更新项目中的游戏。 ### 按ID删除密钥 - [DELETE /v2/project/{project_id}/admin/items/game/key/delete/id/{item_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-delete-codes-by-id.md): 按游戏密钥ID删除所有密钥。 ### 删除密钥 - [DELETE /v2/project/{project_id}/admin/items/game/key/delete/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-delete-codes-by-sku.md): 按游戏密钥SKU删除所有密钥。 ### 通过ID获取密钥 - [GET /v2/project/{project_id}/admin/items/game/key/request/id/{item_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-get-codes-by-id.md): 通过游戏密钥ID获取指定数量的密钥。 ### 获取密钥 - [GET /v2/project/{project_id}/admin/items/game/key/request/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-get-codes-by-sku.md): 通过游戏密钥SKU获取指定数量的密钥。 ### 通过ID上传密钥 - [POST /v2/project/{project_id}/admin/items/game/key/upload/id/{item_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-upload-codes-by-id.md): 按游戏密钥ID上传密钥。 ### 获取密钥加载会话信息 - [GET /v2/project/{project_id}/admin/items/game/key/upload/session/{session_id}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-get-codes-session.md): 获取密钥加载会话信息。 ### 上传密钥 - [POST /v2/project/{project_id}/admin/items/game/key/upload/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-upload-codes-by-sku.md): 按游戏密钥SKU上传密钥。 ### 按SKU删除游戏 - [DELETE /v2/project/{project_id}/admin/items/game/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-delete-game-by-sku.md): 根据SKU删除项目中的游戏。 ### 获取游戏(管理) - [GET /v2/project/{project_id}/admin/items/game/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-get-game-by-sku.md): 获取游戏以进行管理。 游戏由用户可以购买的游戏密钥组成。 注意不要使用此端点来构建商店目录。 ### 按SKU更新游戏 - [PUT /v2/project/{project_id}/admin/items/game/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/game-keys-admin/admin-update-game-by-sku.md): 根据SKU更新项目中的游戏。 ## 管理 ### 获取捆绑包列表 - [GET /v2/project/{project_id}/admin/items/bundle](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-get-bundle-list.md): 获取项目中的捆绑包列表以进行管理。 注意不要使用此端点来构建商店目录。 ### 创建捆绑包 - [POST /v2/project/{project_id}/admin/items/bundle](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-create-bundle.md): 创建捆绑包。 ### 按指定组的外部ID获取捆绑包列表 - [GET /v2/project/{project_id}/admin/items/bundle/group/external_id/{external_id}](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-get-bundle-list-in-group-by-external-id.md): 获取组中的捆绑包列表以进行管理。 注意不要使用此端点来构建商店目录。 ### 按指定组ID获取捆绑包列表 - [GET /v2/project/{project_id}/admin/items/bundle/group/id/{group_id}](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-get-bundle-list-in-group-by-id.md): 获取组中的捆绑包列表以进行管理。 注意不要使用此端点来构建商店目录。 ### 删除捆绑包 - [DELETE /v2/project/{project_id}/admin/items/bundle/sku/{sku}](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-delete-bundle.md): 删除捆绑包。 ### 获取捆绑包 - [GET /v2/project/{project_id}/admin/items/bundle/sku/{sku}](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-get-bundle.md): 获取项目中的捆绑包以进行管理。 注意不要使用此端点来构建商店目录。 ### 更新捆绑包 - [PUT /v2/project/{project_id}/admin/items/bundle/sku/{sku}](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-update-bundle.md): 更新捆绑包。 ### 在目录中隐藏捆绑包 - [PUT /v2/project/{project_id}/admin/items/bundle/sku/{sku}/hide](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-hide-bundle.md): 在目录中隐藏捆绑包。 ### 在目录中显示捆绑包 - [PUT /v2/project/{project_id}/admin/items/bundle/sku/{sku}/show](https://developers.xsolla.com/zh/api/catalog/bundles-admin/admin-show-bundle.md): 在目录中显示捆绑包。 ## 目录 ### 获取捆绑包列表 - [GET /v2/project/{project_id}/items/bundle](https://developers.xsolla.com/zh/api/catalog/bundles-catalog/get-bundle-list.md): Gets a list of bundles for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 获取指定组的捆绑包列表 - [GET /v2/project/{project_id}/items/bundle/group/{external_id}](https://developers.xsolla.com/zh/api/catalog/bundles-catalog/get-bundle-list-in-group.md): Gets a list of bundles within a group for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 获取指定的捆绑包 - [GET /v2/project/{project_id}/items/bundle/sku/{sku}](https://developers.xsolla.com/zh/api/catalog/bundles-catalog/get-bundle.md): Gets a specified bundle. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ## 购物车(客户端侧) ### 获取当前用户的购物车 - [GET /v2/project/{project_id}/cart](https://developers.xsolla.com/zh/api/catalog/cart-client-side/get-user-cart.md): 返回当前用户的购物车。 ### 从当前购物车中删除所有购物车商品 - [PUT /v2/project/{project_id}/cart/clear](https://developers.xsolla.com/zh/api/catalog/cart-client-side/cart-clear.md): 删除所有购物车商品。 ### 在购物车里添加商品 - [PUT /v2/project/{project_id}/cart/fill](https://developers.xsolla.com/zh/api/catalog/cart-client-side/cart-fill.md): 在购物车里添加商品。如果购物车中已有具有相同SKU的商品,则现有商品将被传入的值替换。 ### 从当前购物车中删除购物车商品 - [DELETE /v2/project/{project_id}/cart/item/{item_sku}](https://developers.xsolla.com/zh/api/catalog/cart-client-side/delete-item.md): 从购物车中删除一个商品。 ### 更新当前购物车的商品 - [PUT /v2/project/{project_id}/cart/item/{item_sku}](https://developers.xsolla.com/zh/api/catalog/cart-client-side/put-item.md): 更新现有的购物车商品或在购物车中创建商品。 ### 按购物车ID获取购物车 - [GET /v2/project/{project_id}/cart/{cart_id}](https://developers.xsolla.com/zh/api/catalog/cart-client-side/get-cart-by-id.md): 按购物车ID返回用户的购物车。 ### 按购物车ID删除所有购物车商品 - [PUT /v2/project/{project_id}/cart/{cart_id}/clear](https://developers.xsolla.com/zh/api/catalog/cart-client-side/cart-clear-by-id.md): 删除所有购物车商品。 ### 在指定购物车里添加商品 - [PUT /v2/project/{project_id}/cart/{cart_id}/fill](https://developers.xsolla.com/zh/api/catalog/cart-client-side/cart-fill-by-id.md): 在指定购物车里添加商品。如果购物车中已有具有相同SKU的商品,则现有商品位置将被传入的值替换。 ### 按购物车ID删除购物车商品 - [DELETE /v2/project/{project_id}/cart/{cart_id}/item/{item_sku}](https://developers.xsolla.com/zh/api/catalog/cart-client-side/delete-item-by-cart-id.md): 从购物车中删除一个商品。 ### 按购物车ID更新购物车商品 - [PUT /v2/project/{project_id}/cart/{cart_id}/item/{item_sku}](https://developers.xsolla.com/zh/api/catalog/cart-client-side/put-item-by-cart-id.md): 更新现有的购物车商品或在购物车中创建商品。 ## 购物车(服务器侧) ### 在购物车里添加商品 - [PUT /v2/admin/project/{project_id}/cart/fill](https://developers.xsolla.com/zh/api/catalog/cart-server-side/admin-cart-fill.md): 在当前购物车里添加商品。如果购物车中已有具有相同SKU的商品,则现有商品将被传入的值替换。 ### 按购物车ID在购物车里添加商品 - [PUT /v2/admin/project/{project_id}/cart/{cart_id}/fill](https://developers.xsolla.com/zh/api/catalog/cart-server-side/admin-fill-cart-by-id.md): 通过购物车ID在购物车里添加商品。如果购物车中已有具有相同SKU的商品,则现有商品将被传入的值替换。 ## 支付(客户端) ### 使用当前购物车中的所有商品创建订单 - [POST /v2/project/{project_id}/payment/cart](https://developers.xsolla.com/zh/api/catalog/payment-client-side/create-order.md): 用于客户端到服务器的集成。使用购物车中的所有商品创建订单并为其生成支付令牌。创建的订单得到new订单状态。 客户端IP用于确定用户所在的国家/地区,然后用于为订单应用相应的货币和可用的支付方式。 要在新窗口中打开支付UI,请使用以下链接:https://secure.xsolla.com/paystation4/?token={token} ,其中{token}是收到的令牌。 如要进行测试,请使用以下URL:https://sandbox-secure.xsolla.com/paystation4/?token={token}。 注:由于此方法使用IP来确定用户所在的国家/地区并为订单选择货币,因此必须从客户端而不是从服务器端使用此方法。从服务器端使用此方法可能会导致货币判断错误并影响支付中心中可用的支付方式。 ### 使用特定购物车中的所有商品创建订单 - [POST /v2/project/{project_id}/payment/cart/{cart_id}](https://developers.xsolla.com/zh/api/catalog/payment-client-side/create-order-by-cart-id.md): 用于客户端到服务器的集成。使用指定购物车中的所有商品创建订单并为其生成支付令牌。创建的订单得到new订单状态。 客户端IP用于确定用户所在的国家/地区,然后用于为订单应用相应的货币和可用的支付方式。 要在新窗口中打开支付UI,请使用以下链接:https://secure.xsolla.com/paystation4/?token={token} ,其中{token}是收到的令牌。 如要进行测试,请使用以下URL:https://sandbox-secure.xsolla.com/paystation4/?token={token}。 注:由于此方法使用IP来确定用户所在的国家/地区并为订单选择货币,因此必须从客户端而不是从服务器端使用此方法。从服务器端使用此方法可能会导致货币判断错误并影响支付中心中可用的支付方式。 ### 使用指定商品创建订单 - [POST /v2/project/{project_id}/payment/item/{item_sku}](https://developers.xsolla.com/zh/api/catalog/payment-client-side/create-order-with-item.md): Used for client-to-server integration. Creates an order with a specified item and generates a payment token for it. The created order gets the new order status. The client IP is used to determine the user’s country, which is then used to apply the corresponding currency and available payment methods for the order. To open the payment UI in a new window, use the following link: https://secure.xsolla.com/paystation4/?token={token}, where {token} is the received token. For testing purposes, use this URL: https://sandbox-secure.xsolla.com/paystation4/?token={token}. Notice As this method uses the IP to determine the user’s country and select a currency for the order, it is important to only use this method from the client side and not from the server side. Using this method from the server side may cause incorrect currency determination and affect payment methods in Pay Station. Notice This API call uses a user JWT for authorization. Include the token in the Authorization header in the following format: Bearer <user_JWT>. For more information about user JWT, see the Security block for this call. ## 支付(服务器端) ### 为购买创建支付令牌 - [POST /v3/project/{project_id}/admin/payment/token](https://developers.xsolla.com/zh/api/catalog/payment-server-side/admin-create-payment-token.md): 为其生成订单和支付令牌。订单根据请求正文中传递的商品生成。 要在新窗口中打开支付UI,请使用以下链接:https://secure.xsolla.com/paystation4/?token={token},其中{token}是收到的令牌。 如仅进行测试,请使用此URL:https://sandbox-secure.xsolla.com/paystation4/?token={token}。 注意 user.country.value参数用于选择订单的货币。如果用户的国家/地区未知, 请在X-User-Ip头中提供用户的IP作为替代方案。必须至少提供两者中的一个此方法才能正常工作。所选货币用于支付中心中的付款方式。 ## 订单 ### 获取订单 - [GET /v2/project/{project_id}/order/{order_id}](https://developers.xsolla.com/zh/api/catalog/order/get-order.md): 检索指定的订单。 ### 获取指定时间段的订单列表 - [POST /v3/project/{project_id}/admin/order/search](https://developers.xsolla.com/zh/api/catalog/order/admin-order-search.md): 检索订单列表,按最早到最晚创建日期排列。 ## 免费商品 ### 使用免费购物车创建订单 - [POST /v2/project/{project_id}/free/cart](https://developers.xsolla.com/zh/api/catalog/free-item/create-free-order.md): 使用免费购物车中的所有商品创建一个订单。创建的订单将具有done的订单状态。 ### 使用指定免费购物车创建订单 - [POST /v2/project/{project_id}/free/cart/{cart_id}](https://developers.xsolla.com/zh/api/catalog/free-item/create-free-order-by-cart-id.md): 使用指定免费购物车中的所有商品创建一个订单。创建的订单将具有done的订单状态。 ### 使用指定免费商品创建订单 - [POST /v2/project/{project_id}/free/item/{item_sku}](https://developers.xsolla.com/zh/api/catalog/free-item/create-free-order-with-item.md): Creates an order with a specified free item. The created order will get a done order status. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ## 管理 ### 刷新指定用户的所有购买限制 - [DELETE /v2/project/{project_id}/admin/user/limit/item/all](https://developers.xsolla.com/zh/api/catalog/user-limits-admin/reset-all-user-items-limit.md): 刷新指定用户所有商品的所有购买次数限制,以便他们可以再次购买这些商品。 用户限制API允许您限量销售商品。要配置购买限制,请前往所需商品类型模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 ### 减少指定用户可购的商品数量 - [DELETE /v2/project/{project_id}/admin/user/limit/item/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/user-limits-admin/remove-user-item-limit.md): 减少指定用户在应用的限制范围内可购的剩余商品数量。 用户限制API允许您限量销售商品。要配置购买限制,请前往所需商品类型模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 ### 获取指定用户可购的商品数量 - [GET /v2/project/{project_id}/admin/user/limit/item/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/user-limits-admin/get-user-item-limit.md): 获取指定用户在应用的限制范围内可购的剩余商品数量。 用户限制API允许您限量销售商品。要配置购买限制,请前往所需商品类型模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 ### 增加指定用户可购的商品数量 - [POST /v2/project/{project_id}/admin/user/limit/item/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/user-limits-admin/add-user-item-limit.md): 增加指定用户在应用的限制范围内可购的剩余商品数量。 用户限制API允许您限量销售商品。要配置购买限制,请前往所需商品类型模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 ### 设置指定用户可购的商品数量 - [PUT /v2/project/{project_id}/admin/user/limit/item/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/user-limits-admin/set-user-item-limit.md): 在增加或减少次数后设置指定用户在应用的限制范围内可购的商品数量 用户限制API允许您限量销售商品。要配置购买限制,请前往所需商品类型模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 ### 刷新购买限制 - [DELETE /v2/project/{project_id}/admin/user/limit/item/sku/{item_sku}/all](https://developers.xsolla.com/zh/api/catalog/user-limits-admin/reset-user-item-limit.md): 刷新商品的购买限制,以便用户可以再次购买。如果user参数为null,此调用会为所有用户刷新此限制。 用户限制API允许您限量销售商品。要配置购买限制,请前往所需商品类型模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 ## 管理 ### 获取商品导入状态 - [GET /v1/admin/projects/{project_id}/connectors/import_items/import/status](https://developers.xsolla.com/zh/api/catalog/connector-admin/get-items-import-status.md): 检索将商品导入项目的进度信息。此API调用检索通过API或发布商帐户执行的最后一次导入的数据。 ### 通过JSON文件导入商品 - [POST /v1/projects/{project_id}/import/from_external_file](https://developers.xsolla.com/zh/api/catalog/connector-admin/import-items-from-external-file.md): 通过指定的URL从JSON文件将商品导入商店。关于从JSON文件导入的更多信息,请参阅文档。 ## 预订 ### 移除商品预订数量限制 - [DELETE /v2/project/{project_id}/admin/items/pre_order/limit/item/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/common-pre-orders/remove-pre-order-limit.md): 取消商品的预订数量限制。 预订限制API允许限量销售商品。如要配置预订本身,请前往所需商品模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 此端点的别名: * /v2/project/{project_id}/admin/items/pre_order/limit/item/id/{item_id} ### 获取商品预订限制的信息 - [GET /v2/project/{project_id}/admin/items/pre_order/limit/item/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/common-pre-orders/get-pre-order-limit.md): 获取商品的预订数量限制。 预订限制API允许限量销售商品。如要配置预订本身,请前往所需商品模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 此端点的别名: * /v2/project/{project_id}/admin/items/pre_order/limit/item/id/{item_id} ### 添加商品预订数量限制 - [POST /v2/project/{project_id}/admin/items/pre_order/limit/item/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/common-pre-orders/add-pre-order-limit.md): 添加商品的预订数量限制。 预订限制API允许限量销售商品。如要配置预订本身,请前往所需商品模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 此端点的别名: * /v2/project/{project_id}/admin/items/pre_order/limit/item/id/{item_id} ### 设置商品预订数量限制 - [PUT /v2/project/{project_id}/admin/items/pre_order/limit/item/sku/{item_sku}](https://developers.xsolla.com/zh/api/catalog/common-pre-orders/set-pre-order-limit.md): 设置商品的预订数量限制。 预订限制API允许限量销售商品。如要配置预订本身,请前往所需商品模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 此端点的别名: * /v2/project/{project_id}/admin/items/pre_order/limit/item/id/{item_id} ### 移除所有商品预订数量限制 - [DELETE /v2/project/{project_id}/admin/items/pre_order/limit/item/sku/{item_sku}/all](https://developers.xsolla.com/zh/api/catalog/common-pre-orders/remove-all-pre-order-limit.md): 取消商品的所有预订数量限制。 预订限制API允许限量销售商品。如要配置预订本身,请前往所需商品模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 此端点的别名: * /v2/project/{project_id}/admin/items/pre_order/limit/item/id/{item_id}/all ### 切换商品的预订限制 - [PUT /v2/project/{project_id}/admin/items/pre_order/limit/item/sku/{item_sku}/toggle](https://developers.xsolla.com/zh/api/catalog/common-pre-orders/toggle-pre-order-limit.md): 启用/禁用商品的预订数量限制。 预订限制API允许限量销售商品。如要配置预订本身,请前往所需商品模块的管理部分: * 游戏密钥 * 虚拟物品和货币 * 捆绑包 此端点的别名: * /v2/project/{project_id}/admin/items/pre_order/limit/item/id/{item_id}/toggle ## 商户 ### 获取项目 - [GET /v2/merchant/{merchant_id}/projects](https://developers.xsolla.com/zh/api/catalog/common-merchant/get-projects.md): 获取商户项目列表。 注意此API调用不包含project_id路径参数,所以需要使用在公司所有项目中都有效的API密钥来设置授权。 ## 目录 本API允许获取任意类型的可售商品或指定商品。 ### 获取可售商品列表 - [GET /v2/project/{project_id}/items](https://developers.xsolla.com/zh/api/catalog/common-catalog/get-sellable-items.md): Gets a sellable items list for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 按指定组获取可售商品列表 - [GET /v2/project/{project_id}/items/group/{external_id}](https://developers.xsolla.com/zh/api/catalog/common-catalog/get-sellable-items-group.md): Gets a sellable items list from the specified group for building a catalog. Attention All projects have the limitation to the number of items that you can get in the response. The default and maximum value is 50 items per response. To get more data page by page, use limit and offset fields. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 按ID获取可售商品 - [GET /v2/project/{project_id}/items/id/{item_id}](https://developers.xsolla.com/zh/api/catalog/common-catalog/get-sellable-item-by-id.md): Gets a sellable item by its ID. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ### 按SKU获取可售商品 - [GET /v2/project/{project_id}/items/sku/{sku}](https://developers.xsolla.com/zh/api/catalog/common-catalog/get-sellable-item-by-sku.md): Gets a sellable item by SKU for building a catalog. Note This API call returns generic item catalog data when used without authorization. Use authorization to retrieve personalized user data, such as limits and promotions associated with the item. To do this, pass the user JWT in the Authorization header. For more information about user JWT, see the Security block for this call. ## 通用区域 ### 获取区域列表 - [GET /v2/project/{project_id}/admin/region](https://developers.xsolla.com/zh/api/catalog/common-regions/admin-get-regions.md): 获取区域列表。 可使用区域来管理区域限制。 ### 创建区域 - [POST /v2/project/{project_id}/admin/region](https://developers.xsolla.com/zh/api/catalog/common-regions/admin-create-region.md): 创建区域。 可使用区域来管理区域限制。 ### 删除区域 - [DELETE /v2/project/{project_id}/admin/region/{region_id}](https://developers.xsolla.com/zh/api/catalog/common-regions/admin-delete-region.md): 删除特定区域。 ### 获取区域 - [GET /v2/project/{project_id}/admin/region/{region_id}](https://developers.xsolla.com/zh/api/catalog/common-regions/admin-get-region.md): 获取特定区域。 可使用区域来管理区域限制。 ### 更新区域 - [PUT /v2/project/{project_id}/admin/region/{region_id}](https://developers.xsolla.com/zh/api/catalog/common-regions/admin-update-region.md): 更新特定区域。 可使用区域来管理区域限制。 ## 管理 ### 获取属性列表(管理) - [GET /v2/project/{project_id}/admin/attribute](https://developers.xsolla.com/zh/api/catalog/attribute-admin/admin-get-attribute-list.md): 从项目中获取用于管理的属性列表。 ### 创建属性 - [POST /v2/project/{project_id}/admin/attribute](https://developers.xsolla.com/zh/api/catalog/attribute-admin/admin-create-attribute.md): 创建一个属性。 ### 删除属性 - [DELETE /v2/project/{project_id}/admin/attribute/{external_id}](https://developers.xsolla.com/zh/api/catalog/attribute-admin/delete-attribute.md): 删除属性。 注意删除属性后,其所有数据及与商品的关联关系将被移除。 ### 获取指定属性 - [GET /v2/project/{project_id}/admin/attribute/{external_id}](https://developers.xsolla.com/zh/api/catalog/attribute-admin/admin-get-attribute.md): 获取指定的属性。 ### 更新属性 - [PUT /v2/project/{project_id}/admin/attribute/{external_id}](https://developers.xsolla.com/zh/api/catalog/attribute-admin/admin-update-attribute.md): 更新属性。 ### 删除属性的所有值 - [DELETE /v2/project/{project_id}/admin/attribute/{external_id}/value](https://developers.xsolla.com/zh/api/catalog/attribute-admin/admin-delete-all-attribute-value.md): 删除该属性的所有值。 注意删除属性值后,该属性与商品之间的所有关联关系将被移除。如需更改商品的属性值,请使用更新属性值API调用,而不是删除该值再创建新值。 ### 创建属性值 - [POST /v2/project/{project_id}/admin/attribute/{external_id}/value](https://developers.xsolla.com/zh/api/catalog/attribute-admin/admin-create-attribute-value.md): 创建一个属性值。 注意:所有项目对属性值的数量都有限制。默认值和最大值为 每个属性20个值。 ### 删除属性值 - [DELETE /v2/project/{project_id}/admin/attribute/{external_id}/value/{value_external_id}](https://developers.xsolla.com/zh/api/catalog/attribute-admin/admin-delete-attribute-value.md): 删除属性值。 注意删除属性值后,该属性与商品之间的所有关联关系将被移除。如需更改商品的属性值,请使用更新属性值API调用,而不是删除该值再创建新值。 ### 更新属性值 - [PUT /v2/project/{project_id}/admin/attribute/{external_id}/value/{value_external_id}](https://developers.xsolla.com/zh/api/catalog/attribute-admin/admin-update-attribute-value.md): 更新属性值。 ## 管理 ### Reorder items within a group (by ID) - [PUT /v2/project/{project_id}/admin/group/id/{id}/order/item](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-reorder-items-in-group-by-id.md): Sets the display order of items within a group identified by its internal numeric ID. Pass an array of items with their new order values. ### Reorder item groups - [PUT /v2/project/{project_id}/admin/group/order](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-reorder-item-groups.md): Sets the display order for item groups within a project. Pass an array of groups with their new order values. ### Reorder items within a group (by external ID) - [PUT /v2/project/{project_id}/admin/group/{external_id}/order/item](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-reorder-items-in-group.md): Sets the display order of items within a group identified by its external ID. Pass an array of items with their new order values. ### 获取商品组列表 - [GET /v2/project/{project_id}/admin/items/groups](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-get-item-group-list.md): Retrieves the full list of item groups within a project without pagination. For administrative purposes. NoteDo not use this endpoint for building a store catalog. Use the Get item group list client-side endpoint instead. ### Create item group - [POST /v2/project/{project_id}/admin/items/groups](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-create-item-group.md): Creates an item group within a project. To retrieve item groups for building a catalog, use the Get item group list client-side endpoint. ### Delete item group - [DELETE /v2/project/{project_id}/admin/items/groups/{external_id}](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-delete-item-group.md): Deletes an item group by its external ID. ### Get item group by external ID - [GET /v2/project/{project_id}/admin/items/groups/{external_id}](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-get-item-group.md): Retrieves an item group by its external ID for administrative purposes. NoteDo not use this endpoint for building a store catalog. Use the Get item group list client-side endpoint instead. ### Update item group - [PUT /v2/project/{project_id}/admin/items/groups/{external_id}](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-update-item-group.md): Updates an item group by its external ID. ### Get item group list filtered by item type - [GET /v2/project/{project_id}/admin/items/{item_type}/groups](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-get-item-group-list-by-item-type.md): Retrieves item group list with filtering by item type. Only items of the specified type are counted for the group. This is similar to the Get item group list endpoint, with additional filtering of items by type when counting them. ### Get item group by external ID filtered by item type - [GET /v2/project/{project_id}/admin/items/{item_type}/groups/{external_id}](https://developers.xsolla.com/zh/api/catalog/item-groups-admin/admin-get-item-group-by-item-type.md): Retrieves an item group by external ID. Only items of the specified type are counted for the group. This is similar to the Get item group by external ID endpoint, with additional filtering of items by type when counting them. ## 目录 ### 获取商品组列表 - [GET /v2/project/{project_id}/items/groups](https://developers.xsolla.com/zh/api/catalog/item-groups-catalog/get-item-groups.md): Retrieves an item group list for building a catalog without pagination. NoteThe use of the item catalog API calls is available without authorization, but to get a personalized catalog, you must pass the user JWT in the Authorization header.