Catalog API (2.0.0)
- Version: 2.0.0
- Servers:
https://store.xsolla.com/api - Contact Us by Email
- 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.
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 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.
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.
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.
The token is passed in the Authorization header in the following format: Authorization: Bearer <user_JWT>, where <user_JWT> 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.GCrW42OguZbLZTaoixCZgAeNLGH2xCeJHxl8u8Xn2aIAlternatively, you can use a token for opening the payment UI.
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 is typically used.
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 <your_authorization_basic_key>, whereyour_authorization_basic_keyis theproject_id:api_keypair encoded in Base64 - for
basicMerchantAuth—Authorization: Basic <your_authorization_basic_key>, whereyour_authorization_basic_keyis themerchant_id:api_keypair encoded in Base64
You can find the parameter values in Publisher Account:
merchant_idis 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/<merchant_id>.
project_idis 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/<merchant_id>/projects/<project_id>.
api_keyis 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:
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.
The AuthForCart authentication scheme is used for cart purchases and supports two modes:
- Authentication with a user's JWT. The token is passed in the
Authorizationheader in the following format:Authorization: Bearer <user_JWT>, where<user_JWT>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.GCrW42OguZbLZTaoixCZgAeNLGH2xCeJHxl8u8Xn2aIAlternatively, you can use a token for opening the payment UI.
- Simplified mode without Authorization header. This mode is used only for unauthorized users and can be applied only for game key sales. Instead of a token, the request must include the following headers:
x-unauthorized-idwith a request IDx-userwith the user's email address encoded in Base64
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.
Some calls may include additional fields but they don't change the basic structure.
Identification
merchant_id— company ID in Publisher Accountproject_id— project ID in Publisher Accountsku— item SKU, unique within the project
Store display
name— item namedescription— item descriptionimage_url— image URLis_enabled— item availabilityis_show_in_store— whether the item is displayed in the catalog
For more information about managing item availability in the catalog, see the documentation.
Organization
type— item type, for example, a virtual item (virtual_item) or bundle (bundle)groups— groups the item belongs toorder— display order in the catalog
Sale conditions
prices— prices in real or virtual currencylimits— purchase limitsperiods— availability periodsregions— regional restrictions
Example of core entity structure:
{
"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": []
}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.
The following example shows a basic flow for setting up and operating a store, from item creation to purchase.
Create an item catalog for your store, such as virtual items, bundles, or virtual currency.
Example API calls:
Configure user acquisition and monetization tools, such as discounts, bonuses, daily rewards, or offer chains.
Example API calls:
Configure item display in your application.
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:
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.
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 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 API call or the Create order with free cart API call. The payment UI is not required — the order is immediately set to the done status.
Use the client-side API call to create an order with a specified item. The call returns a token used to open the payment UI.
Discount information is available to the user only in the payment UI. Promo codes are not supported.
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:
- After the player has filled a cart, use the Fill cart with items API call. The call returns the current information about the selected items (prices before and after discounts, bonus items).
- Update the cart contents based on user actions:
- To add an item or change item quantity, use the Update cart item by cart ID API call.
- To remove an item, use the Delete cart item by cart ID API call.
To get the current status of the cart, use the Get current user's cart API call.
- Use the Create order with all items from current cart API call. The call returns the order ID and payment token. The newly created order is set to
newstatus 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:
- After the player has filled a cart, use the Fill cart with items API call. The call returns current information about the selected items (prices before and after discounts, bonus items).
- Use the Create order with all items from current cart API call. The call returns the order ID and payment token. The newly created order is set to
newstatus by default.
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.
| 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} |
Use sandbox mode during development and testing. Test purchases don't charge real accounts. You can use [test bank cards](/ja/doc/pay-station/references/test-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.
Buying virtual currency and items for real currency is possible only after signing a license agreement with Xsolla. To do this, in Publisher Account, 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 createdpaid— payment receiveddone— item deliveredcanceled— order canceledexpired— payment expired
Track order status using one of the following methods:
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 pageoffset— index of the first item on the page (numbering starts from 0)has_more— indicates whether another page is availabletotal_items_count— total number of items
Example request:
GET /items?limit=20&offset=40Response example:
{
"items": [...],
"has_more": true,
"total_items_count": 135
}It is recommended to send subsequent requests until the response returns has_more = false.
Dates and time values are passed in the ISO 8601 format.
The following are supported:
- UTC offset
nullvalue when there is no time restriction for displaying an item- Unix timestamp (in seconds) used in some fields
Format: YYYY-MM-DDTHH:MM:SS±HH:MM
Example: 2026-03-16T10:00:00+03:00
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.
Supported fields
Localization can be specified for the following parameters:
namedescriptionlong_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:
{
"name": {
"en": "Starter Pack",
"ru": "Стартовый набор"
}
}Example with a five-letter language code:
{
"description": {
"en-US": "Premium bundle",
"de-DE": "Premium-Paket"
}
}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.
Response example:
{
"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:
{
"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 request401— authentication error403— insufficient permissions404— resource not found422— validation error429— rate limit exceeded
Recommendations
- Handle the HTTP status and the response body together.
- Use
errorCodeto process errors related to application logic. - Use
transactionIdto identify requests more quickly when analyzing errors.
リクエスト
クライアントサーバーへの統合に使用されます。カートからのすべてのアイテムを含む注文を作成し、そのための決済トークンを生成します。作成された注文はnew注文ステータスを取得します。
クライアントIPは、ユーザーの国を決定するために使用され、注文に対応する通貨と利用可能な決済方法を適用するために使用されます。
決済UIを新しいウィンドウで開くには、以下のリンクをご利用ください:https://secure.xsolla.com/paystation4/?token={token}で{token}受信したトークン。
テスト目的には、以下のリンクを使用してください:https://sandbox-secure.xsolla.com/paystation4/?token={token}。
このメソッドはIPを使用してユーザーの国を決定し、注文の通貨を選択するため、このメソッドはクライアント側からのみ使用し、サーバー側からは使用しないことが重要です。サーバー側からこの方法を使用すると、通貨が正しく判定されず、ペイステーションの決済方法に影響を与える可能性があります。
Project ID. You can find this parameter in your Publisher Account next to the project name and in the browser address bar when working with a project. The URL has the following format: https://publisher.xsolla.com/<merchant_id>/projects/<project_id>.
注文価格の通貨。3文字の通貨コードISO4217 規格詳細については、ドキュメントを参照してください。エクソーラでサポートされている通貨。
ユーザーの支払いプロセスと決済UIを構成するための設定。
決済方法ID。決済方法によっては特定の通貨のみをサポートする場合があるため、決済インターフェースにおける通貨の表示を決定します。
ユーザーがリターンURLにリダイレクトする引き金となる決済状態。
ページを使用して決済後にユーザーをリダイレクトします。パラメーターuser_id、foreigninvoice、invoice_idとstatusは、自動的にリンクに追加されます。
インターフェイス設定。
codeに設定すると、決済UIに3 文字のISO 4217通貨コードが表示されます。 デフォルトでは、3文字の通貨コードの代わりに通貨記号が表示されます。
デスクトップ版のインターフェース設定。
ヘッダー設定。
デスクトップ決済UIに閉じるボタンを表示するかどうか。このボタンは決済UIを閉じて、settings.return_urlパラメータで指定したURLにリダイレクトします。デフォルトはfalseです。
ヘッダーを表示する方法。compact(プロジェクト名とユーザーIDを隠す)またはnormal(デフォルト)に指定できます。
trueの場合、ロゴはヘッダーに表示されます。画像をアップロードするには、パブリッシャーアカウントでプロジェクトを開き、ペイステーション > 設定セクションにアクセスしてください。
モバイル版の決済UIを開いた時のカート内のアイテムリストの表示。trueの場合、リストは拡張ビューで表示されます。false(デフォルト)またはパラメータが渡されない場合、リストは折りたたまれたビューで表示されます。
埋め込みランチャーのブラウザ(WebView)から、ユーザーのデフォルトのブラウザにリダイレクトして購入させるかどうか。
決済UIを開く際に、ユーザーの国で利用可能な決済方法のリストを表示するかどうか。falseの場合(デフォルト)、settings.payment_methodパラメータで渡された決済方法、またはPayRankアルゴリズムで選択された方法が表示されます。
リンクを外部リソースにリダイレクトするかどうかを無効にします。外部リンクをクリックすると、external-link-openイベントがpostMessageメカニズムを介して送信されます。urlパラメータには、リダイレクト先のリンクのアドレスが渡されます。
支払いページを閉じる前に、×アイコンの上にカーソルを置いたときに取引処理に関する警告を表示するかどうか。falseが渡された場合、またはパラメータが渡されなかった場合、警告は表示されません。
3-Dセキュア検証が新しいブラウザウィンドウで開くかどうか。セットアップでコンテンツセキュリティポリシー(CSP)が適用される場合は、trueに設定します。
決済UIの主要要素の位置。ゲーム内で決済UIを開いたり、注文や決済方法に関する情報の列を入れ替えたりすることができます。詳細については、カスタマイズに関する説明を参照してください。
決済UIのインターフェースモード。user_accountのみに指定できます:ヘッダーにはユーザーアカウントのナビゲーションメニューのみが含まれています。ユーザーは商品を選択したり、決済を行うことはできません。このモードは、デスクトップ上でのみ使用できます。
決済UIのテーマ。ライトテーマ(デフォルト)の場合は63295a9a2e47fab76f7708e1、ダークテーマの場合は63295aab2e47fab76f7708e3を指定できます。カスタムテーマを作成して、そのIDをこのパラメータに渡すこともできます。
ユーザーアカウントの詳細。
私のアカウント ページ。
お客様の決済アカウント サブメニュー。
- https://store.xsolla.com/api/v2/project/{project_id}/payment/cart
- Mock serverhttps://xsolla.redocly.app/_mock/ja/api/catalog/v2/project/{project_id}/payment/cart
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://store.xsolla.com/api/v2/project/44056/payment/cart \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"custom_parameters": {
"character_id": "ingameUsername"
},
"sandbox": true,
"settings": {
"ui": {
"desktop": {
"header": {
"close_button": false,
"is_visible": true,
"type": "normal",
"visible_logo": true,
"visible_name": true,
"visible_purchase": true
}
},
"theme": "63295a9a2e47fab76f7708e1"
}
}
}'{ "order_id": 641, "token": "f4puMEFFDZcx9nv5HoNHIkPe9qghvBQo" }
リクエスト
クライアントサーバーへの統合に使用されます。特定のカートからのすべてのアイテムを含む注文を作成し、そのための決済トークンを生成します。作成された注文はnew注文ステータスを取得します。
クライアントIPは、ユーザーの国を決定するために使用され、注文に対応する通貨と利用可能な決済方法を適用するために使用されます。
決済UIを新しいウィンドウで開くには、以下のリンクをご利用ください:https://secure.xsolla.com/paystation4/?token={token}で{token}受信したトークン。
テスト目的には、以下のリンクを使用してください:https://sandbox-secure.xsolla.com/paystation4/?token={token}。
このメソッドはIPを使用してユーザーの国を決定し、注文の通貨を選択するため、このメソッドはクライアント側からのみ使用し、サーバー側からは使用しないことが重要です。サーバー側からこの方法を使用すると、通貨が正しく判定されず、ペイステーションの決済方法に影響を与える可能性があります。
Project ID. You can find this parameter in your Publisher Account next to the project name and in the browser address bar when working with a project. The URL has the following format: https://publisher.xsolla.com/<merchant_id>/projects/<project_id>.
注文価格の通貨。3文字の通貨コードISO4217 規格詳細については、ドキュメントを参照してください。エクソーラでサポートされている通貨。
ユーザーの支払いプロセスと決済UIを構成するための設定。
決済方法ID。決済方法によっては特定の通貨のみをサポートする場合があるため、決済インターフェースにおける通貨の表示を決定します。
ユーザーがリターンURLにリダイレクトする引き金となる決済状態。
ページを使用して決済後にユーザーをリダイレクトします。パラメーターuser_id、foreigninvoice、invoice_idとstatusは、自動的にリンクに追加されます。
インターフェイス設定。
codeに設定すると、決済UIに3 文字のISO 4217通貨コードが表示されます。 デフォルトでは、3文字の通貨コードの代わりに通貨記号が表示されます。
デスクトップ版のインターフェース設定。
ヘッダー設定。
デスクトップ決済UIに閉じるボタンを表示するかどうか。このボタンは決済UIを閉じて、settings.return_urlパラメータで指定したURLにリダイレクトします。デフォルトはfalseです。
ヘッダーを表示する方法。compact(プロジェクト名とユーザーIDを隠す)またはnormal(デフォルト)に指定できます。
trueの場合、ロゴはヘッダーに表示されます。画像をアップロードするには、パブリッシャーアカウントでプロジェクトを開き、ペイステーション > 設定セクションにアクセスしてください。
モバイル版の決済UIを開いた時のカート内のアイテムリストの表示。trueの場合、リストは拡張ビューで表示されます。false(デフォルト)またはパラメータが渡されない場合、リストは折りたたまれたビューで表示されます。
埋め込みランチャーのブラウザ(WebView)から、ユーザーのデフォルトのブラウザにリダイレクトして購入させるかどうか。
決済UIを開く際に、ユーザーの国で利用可能な決済方法のリストを表示するかどうか。falseの場合(デフォルト)、settings.payment_methodパラメータで渡された決済方法、またはPayRankアルゴリズムで選択された方法が表示されます。
リンクを外部リソースにリダイレクトするかどうかを無効にします。外部リンクをクリックすると、external-link-openイベントがpostMessageメカニズムを介して送信されます。urlパラメータには、リダイレクト先のリンクのアドレスが渡されます。
支払いページを閉じる前に、×アイコンの上にカーソルを置いたときに取引処理に関する警告を表示するかどうか。falseが渡された場合、またはパラメータが渡されなかった場合、警告は表示されません。
3-Dセキュア検証が新しいブラウザウィンドウで開くかどうか。セットアップでコンテンツセキュリティポリシー(CSP)が適用される場合は、trueに設定します。
決済UIの主要要素の位置。ゲーム内で決済UIを開いたり、注文や決済方法に関する情報の列を入れ替えたりすることができます。詳細については、カスタマイズに関する説明を参照してください。
決済UIのインターフェースモード。user_accountのみに指定できます:ヘッダーにはユーザーアカウントのナビゲーションメニューのみが含まれています。ユーザーは商品を選択したり、決済を行うことはできません。このモードは、デスクトップ上でのみ使用できます。
決済UIのテーマ。ライトテーマ(デフォルト)の場合は63295a9a2e47fab76f7708e1、ダークテーマの場合は63295aab2e47fab76f7708e3を指定できます。カスタムテーマを作成して、そのIDをこのパラメータに渡すこともできます。
ユーザーアカウントの詳細。
私のアカウント ページ。
お客様の決済アカウント サブメニュー。
- https://store.xsolla.com/api/v2/project/{project_id}/payment/cart/{cart_id}
- Mock serverhttps://xsolla.redocly.app/_mock/ja/api/catalog/v2/project/{project_id}/payment/cart/{cart_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://store.xsolla.com/api/v2/project/44056/payment/cart/custom_id \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"custom_parameters": {
"character_id": "ingameUsername"
},
"sandbox": true,
"settings": {
"ui": {
"desktop": {
"header": {
"close_button": false,
"is_visible": true,
"type": "normal",
"visible_logo": true,
"visible_name": true,
"visible_purchase": true
}
},
"theme": "63295a9a2e47fab76f7708e1"
}
}
}'{ "order_id": 641, "token": "f4puMEFFDZcx9nv5HoNHIkPe9qghvBQo" }
リクエスト
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}.
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.
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.
Project ID. You can find this parameter in your Publisher Account next to the project name and in the browser address bar when working with a project. The URL has the following format: https://publisher.xsolla.com/<merchant_id>/projects/<project_id>.
注文価格の通貨。3文字の通貨コードISO4217 規格詳細については、ドキュメントを参照してください。エクソーラでサポートされている通貨。
ユーザーの支払いプロセスと決済UIを構成するための設定。
決済方法ID。決済方法によっては特定の通貨のみをサポートする場合があるため、決済インターフェースにおける通貨の表示を決定します。
ユーザーがリターンURLにリダイレクトする引き金となる決済状態。
ページを使用して決済後にユーザーをリダイレクトします。パラメーターuser_id、foreigninvoice、invoice_idとstatusは、自動的にリンクに追加されます。
インターフェイス設定。
codeに設定すると、決済UIに3 文字のISO 4217通貨コードが表示されます。 デフォルトでは、3文字の通貨コードの代わりに通貨記号が表示されます。
デスクトップ版のインターフェース設定。
ヘッダー設定。
デスクトップ決済UIに閉じるボタンを表示するかどうか。このボタンは決済UIを閉じて、settings.return_urlパラメータで指定したURLにリダイレクトします。デフォルトはfalseです。
ヘッダーを表示する方法。compact(プロジェクト名とユーザーIDを隠す)またはnormal(デフォルト)に指定できます。
trueの場合、ロゴはヘッダーに表示されます。画像をアップロードするには、パブリッシャーアカウントでプロジェクトを開き、ペイステーション > 設定セクションにアクセスしてください。
モバイル版の決済UIを開いた時のカート内のアイテムリストの表示。trueの場合、リストは拡張ビューで表示されます。false(デフォルト)またはパラメータが渡されない場合、リストは折りたたまれたビューで表示されます。
埋め込みランチャーのブラウザ(WebView)から、ユーザーのデフォルトのブラウザにリダイレクトして購入させるかどうか。
決済UIを開く際に、ユーザーの国で利用可能な決済方法のリストを表示するかどうか。falseの場合(デフォルト)、settings.payment_methodパラメータで渡された決済方法、またはPayRankアルゴリズムで選択された方法が表示されます。
リンクを外部リソースにリダイレクトするかどうかを無効にします。外部リンクをクリックすると、external-link-openイベントがpostMessageメカニズムを介して送信されます。urlパラメータには、リダイレクト先のリンクのアドレスが渡されます。
支払いページを閉じる前に、×アイコンの上にカーソルを置いたときに取引処理に関する警告を表示するかどうか。falseが渡された場合、またはパラメータが渡されなかった場合、警告は表示されません。
3-Dセキュア検証が新しいブラウザウィンドウで開くかどうか。セットアップでコンテンツセキュリティポリシー(CSP)が適用される場合は、trueに設定します。
決済UIの主要要素の位置。ゲーム内で決済UIを開いたり、注文や決済方法に関する情報の列を入れ替えたりすることができます。詳細については、カスタマイズに関する説明を参照してください。
決済UIのインターフェースモード。user_accountのみに指定できます:ヘッダーにはユーザーアカウントのナビゲーションメニューのみが含まれています。ユーザーは商品を選択したり、決済を行うことはできません。このモードは、デスクトップ上でのみ使用できます。
決済UIのテーマ。ライトテーマ(デフォルト)の場合は63295a9a2e47fab76f7708e1、ダークテーマの場合は63295aab2e47fab76f7708e3を指定できます。カスタムテーマを作成して、そのIDをこのパラメータに渡すこともできます。
ユーザーアカウントの詳細。
私のアカウント ページ。
お客様の決済アカウント サブメニュー。
- https://store.xsolla.com/api/v2/project/{project_id}/payment/item/{item_sku}
- Mock serverhttps://xsolla.redocly.app/_mock/ja/api/catalog/v2/project/{project_id}/payment/item/{item_sku}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://store.xsolla.com/api/v2/project/44056/payment/item/booster_mega_1 \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"custom_parameters": {
"character_id": "ingameUsername"
},
"promo_code": "discount_code",
"quantity": 5,
"sandbox": true,
"settings": {
"ui": {
"desktop": {
"header": {
"close_button": false,
"is_visible": true,
"type": "normal",
"visible_logo": true,
"visible_name": true,
"visible_purchase": true
}
},
"theme": "63295a9a2e47fab76f7708e1"
}
}
}'{ "order_id": 641, "token": "f4puMEFFDZcx9nv5HoNHIkPe9qghvBQo" }