コンテンツへスキップ

カタログAPI (2.0.0)

概要

  • バージョン: 2.0.0
  • サーバー: https://store.xsolla.com/api
  • メールでのお問い合わせ
  • お問い合わせURL: https://xsolla.com/
  • 必要なTLSバージョン: 1.2

カタログAPIを使用すると、ゲーム内アイテムのカタログをエクソーラ側で設定し、そのカタログをストア内でユーザーに表示することができます。

本APIでは、以下のカタログエンティティを管理できます:

  • 仮想アイテム — 武器、スキン、ブースターなどのゲーム内アイテム。
  • 仮想通貨 — 仮想商品の購入に使用される仮想通貨。
  • 仮想通貨パッケージ — 事前定義された仮想通貨のバンドル。
  • バンドル — 仮想アイテム、通貨、またはゲームキーを1つのSKUとしてまとめたパッケージ。
  • ゲームキー — Steamやその他のDRMプロバイダーを通じて配布される、ゲームおよびDLCのキー。
  • グループ — カタログ内のアイテムを整理または並べ替えするための論理的なグループ分け。

APIコール

本APIは、以下のグループに分かれています:

  • Admin — カタログアイテムやグループの作成、更新、削除、および設定を行うためのコール。マーチャントまたはプロジェクトの認証情報による基本アクセス認証で認証されます。ストアフロントでの使用は想定されていません。
  • Catalog — アイテムの取得や、エンドユーザー向けのカスタムストアフロントを構築するためのコール。高負荷なシナリオに対応できるよう設計されています。ユーザー個別の制限事項や実施中のプロモーションなど、パーソナライズされたデータを返すための、ユーザーJWTによる任意認証をサポートしています。

認証

APIコールには、ユーザーまたはプロジェクトのいずれかに代わって認証が必要です。使用される認証スキームは、各コールの説明のセキュリティセクションに指定されています。

ユーザーのJWTを使用した認証

ユーザーのJWTを使用した認証は、ブラウザ、モバイルアプリケーション、またはゲームからリクエストが送信される場合に使用されます。デフォルトでは、XsollaLoginUserJWTスキームが適用されます。トークンの作成方法の詳細については、エクソーラログインAPIに関するドキュメントを参照してください。

トークンはAuthorizationヘッダーに次の形式で渡されます:Authorization: Bearer <user_JWT>。ここで<user_JWT>はユーザートークンです。このトークンによってユーザーが特定され、パーソナライズされたデータへのアクセスが可能になります。

別の方法として、決済UIを開くためのトークンを使用することも可能です。

基本HTTP認証

基本HTTP認証は、ユーザーのブラウザやモバイルアプリケーションからではなく、サーバーから直接APIコールが送信される場合のサーバー間のやり取りに使用されます。通常、APIキーを使用したHTTP基本認証が使用されます。

注意

APIキーは機密性高いため、クライアントアプリケーション側での保存および使用は厳禁とします。

基本的なサーバーサイド認証では、すべてのAPIリクエストに以下のヘッダーを含める必要があります:

  • basicAuthの場合 — Authorization: Basic <your_authorization_basic_key>。ここでyour_authorization_basic_keyは、Base64でエンコードされたproject_id:api_keyペアです。
  • basicMerchantAuthの場合 — Authorization: Basic <your_authorization_basic_key>。ここでyour_authorization_basic_keyは、Base64でエンコードされたmerchant_id:api_keyペアです。

パラメータの値はパブリッシャーアカウントで確認できます:

  • merchant_idは次の場所に表示されます:
    • 会社設定 > 会社
    • パブリッシャーアカウントの任意のページのブラウザアドレスバーのURLに。URLの形式は以下の通りです: https://publisher.xsolla.com/<merchant_id>
  • project_idは次の場所に表示されます:
    • パブリッシャーアカウントのプロジェクト名の横に。
    • パブリッシャーアカウントでプロジェクトを操作しているときのブラウザアドレスバーのURLに。URLの形式は以下の通りです:https://publisher.xsolla.com/<merchant_id>/projects/<project_id>
  • api_keyは作成時にのみパブリッシャーアカウントに表示され、あなたの側で安全に保管する必要があります。APIキーは次のセクションで作成できます:
注意

必要なAPIコールにproject_idパスパラメータが含まれていない場合、認証を行うには、会社のすべてのプロジェクト共通で有効なAPIキーを使用してください。

APIキーの操作に関する詳細は、APIリファレンスを参照してください。

ゲストアクセスをサポートする認証

AuthForCart認証スキームはカートでの購入用であり、以下の2つのモードに対応しています:

  1. ユーザーのJWTを使用した認証。 トークンは、次の形式でAuthorizationヘッダーに渡されます: Authorization: Bearer <user_JWT>。ここで<user_JWT>はユーザートークンです。このトークンはユーザーを識別し、パーソナライズされたデータへのアクセスを提供します。 または、決済UIを開くためのトークンを使用することもできます。

  2. 認証ヘッダーを使用しない簡易モード。 このモードは未認証ユーザーにのみ使用され、ゲームキー販売にのみ適用できます。リクエストにはトークンの代わりに、以下のヘッダーを含める必要があります:

    • リクエストIDを含むx-unauthorized-id
    • Base64でエンコードされたユーザーのメールアドレスを含むx-user

主要なエンティティ構造

すべてのタイプ(仮想アイテム、バンドル、仮想通貨、キー)のアイテムは、同様のデータ構造を使用しています。この基本構造を理解することで、APIの利用が簡素化され、ドキュメントをよりスムーズに読み進められるようになります。

注意

一部のコールには追加のフィールドが含まれる場合がありますが、基本構造が変わることはありません。

識別

  • merchant_idパブリッシャーアカウントにおける会社ID
  • project_id — パブリッシャーアカウントにおけるプロジェクトID
  • sku — アイテムSKU、プロジェクト内で一意です

ストア表示

  • name — アイテム名
  • description — アイテム説明
  • image_url — 画像URL
  • is_enabled — アイテムの可用性
  • is_show_in_store — アイテムがカタログに表示されるかどうか

カタログ内のアイテムの可用性管理に関する詳細は、ドキュメントを参照してください。

組織

  • type — アイテムタイプ、例:仮想アイテム(virtual_item)またはバンドル(bundle
  • groups — アイテムが属するグループ
  • order — カタログ内の表示順序

販売条件

  • prices — 実際通貨または仮想通貨での価格
  • limits — 購入制限
  • periods — 可用期間
  • regions — 地域別制限

主要なエンティティ構造の例:

{
  "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": []
}

基本的な購入フロー

エクソーラAPIを使用すると、ゲーム内ストアのロジックを実装でき、アイテムカタログの取得、カートの管理、注文の作成、そのステータスの追跡が可能です。統合シナリオに応じて、APIコールは管理者カタログのサブセクションに分かれ、異なる認証スキームを使用します。

以下の例は、アイテムの作成から購入に至るまで、ストアのセットアップおよび運用の基本フローを示しています。

アイテムおよびグループの作成(管理者向け)

仮想アイテム、バンドル、仮想通貨など、ストアのアイテムカタログを作成します。

APIコールの例:

プロモーション、チェーン、および制限の設定(管理者向け)

割引、ボーナス、デイリー報酬、またはオファーチェーンなど、ユーザー獲得および収益化のためのツールを設定します。

APIコールの例:

アイテム情報の取得(クライアント向け)

アプリケーション内でのアイテム表示を設定します。

注意

ユーザーカタログを構築するために管理サブセクションのAPIコールを使用しないでください。これらのAPIコールにはレート制限があり、ユーザーのトラフィックを対象としていません。

APIコールの例:

注意

デフォルトでは、カタログAPIコールはリクエスト時にストアで現在利用可能なアイテムを返します。まだ利用可能でない、または利用できなくなったアイテムを取得するには、カタログリクエストにパラメータ"show_inactive_time_limited_items": 1を含めてください。

アイテムの販売

アイテムは以下の方法で販売できます:

  • 迅速な購入 — 1つのSKUを複数回販売します。
  • カート購入 — ユーザーがアイテムをカートに追加し、アイテムを削除し、単一の注文内で数量を更新します。

アイテムが実際のお金ではなく仮想通貨で購入された場合は、仮想通貨で購入した指定アイテムで注文を作成するAPIコールを使用してください。当該APIコールの実行時に課金処理が行われるため、決済UIを表示する必要はありません。

無料アイテムの購入には、指定した無料アイテムで注文を作成するAPIコールまたは無料カートで注文を作成するAPIコールを使用してください。決済UIを表示する必要はありません。注文は即時にdoneステータスに設定されます。

迅速な購入

クライアント側のAPIコールを使用して、指定したアイテムで注文を作成します。このコールは、決済UIを開くために使用するトークンを返します。

注意

割引情報は決済UIでのみユーザーに提供されます。プロモーションコードはサポートされていません。

カート購入

カートの設定と購入は、クライアントまたはサーバー側で実行できます。

クライアント側でのカートのセットアップと購入

アイテムの追加および削除のロジックは、独自に実装してください。カートを設定するためのAPIを呼び出す前は、購入にどのプロモーションが適用されるかに関する情報は取得できません。つまり、合計金額や、追加されるボーナスアイテムの詳細を事前に知ることはできません。

以下のカートロジックを実装します:

  1. プレイヤーがカートにアイテムを入れた後、カートにアイテムを入れるAPIコールを使用します。このコールは、選択されたアイテムに関する現在の情報(割引前後の価格、ボーナスアイテム)を返します。
  2. ユーザーのアクションに基づいてカートの内容を更新します:
注意

カートの現在のステータスを取得するには、現在のユーザーのカートを取得するAPIコールを使用してください。
  1. 現在のカートからすべてのアイテムで注文を作成するAPIコールを使用します。このコールは注文IDと決済トークンを返します。新しく作成された注文はデフォルトでnewステータスに設定されます。

サーバー側でのカートのセットアップと購入

カートへの変更ごとにAPIコールを伴う必要があるため、この設定オプションではカートの設定に時間がかかる場合があります。

以下のカートロジックを実装します:

  1. プレイヤーがカートにアイテムを入れた後、カートにアイテムを入れるAPIコールを使用します。このコールは、選択されたアイテムに関する現在の情報(割引前後の価格、ボーナスアイテム)を返します。
  2. 現在のカートのすべてのアイテムで注文を作成するAPIコールを使用します。このコールは、注文IDと支払いトークンを返します。新しく作成された注文は、デフォルトでnewステータスに設定されます。

決済UIを開く

返されたトークンを使用して、新しいウィンドウで決済UIを開きます。決済UIを開くその他の方法は、ドキュメントに記載されています。

| アクション | エンドポイント | |:--------------------------------|:--------------------------------------------------------------------------| | 本番環境で開きます。 | https://secure.xsolla.com/paystation4/?token={token} | | サンドボックスモードで開きます。 | https://sandbox-secure.xsolla.com/paystation4/?token={token} |

注意

開発およびテスト中はサンドボックスモードを使用してください。テスト購入では実際のアカウントに料金は発生しません。テスト用銀行カードを使用できます。

最初の実際の支払いが行われた後、厳格なサンドボックス決済ポリシーが適用されます。サンドボックスモードでの支払いは、パブリッシャーアカウント > 会社設定 > ユーザーで指定されたユーザーのみが利用可能です。

実際通貨で仮想通貨やアイテムを購入するには、エクソーラとのライセンス契約を締結する必要があります。これを行うには、パブリッシャーアカウント契約と税金 > 契約に移動し、契約フォームを記入して確認を待ちます。契約の審査には最大3営業日かかる場合があります。

サンドボックスモードを有効または無効にするには、迅速な購入およびカート購入のリクエストでsandboxパラメータの値を変更します。サンドボックスモードはデフォルトでオフになっています。

可能な注文状況:

  • new — 注文作成済み
  • paid — 支払い受領済み
  • done — アイテム付与完了
  • canceled — 注文キャンセル済み
  • expired — 注文期限切れ

以下のいずれかの方法を使用して、注文ステータスを追跡します:

ページネーション

大規模なレコードセットを返すAPIコール(カタログを構築する場合など)では、データがページ分割されて返されます。ページネーションは、単一のAPI応答で返されるアイテム数を制限し、下一ページのデータを順次取得できるようにするための仕組みです。

返されるアイテム数を制御するには、以下のパラメータを使用します:

  • limit — 1ページあたりのアイテム件数
  • offset — ページ上の最初のアイテムのインデックス(番号付けは0から始まります)
  • has_more — 次のページが利用可能かどうかを示します
  • total_items_count — アイテムの総数

リクエスト例:

GET /items?limit=20&offset=40

応答例:

{
  "items": [...],
  "has_more": true,
  "total_items_count": 135
}

応答がhas_more = falseを返すまで、後続のリクエストを送信することをお勧めします。

日付と時刻の形式

日付と時間の値は、ISO 8601フォーマットで渡されます。

以下がサポートされています:

  • UTCオフセット
  • アイテムの表示に時間制限がない場合はnull
  • 一部のフィールドで使用されるUnixタイムスタンプ(秒単位)

フォーマット:YYYY-MM-DDTHH:MM:SS±HH:MM

例:2026-03-16T10:00:00+03:00

ローカリゼーション

エクソーラは、アイテム名や説明などのユーザー向けフィールドのローカライズをサポートしています。ローカライズされた値は、言語コードをキーとするオブジェクトとして渡されます。サポートされている言語の完全なリストは、ドキュメントで確認できます。

サポートされているフィールド

次のパラメータに対してローカリゼーションを指定できます:

  • name
  • description
  • long_description

ロケール形式

ロケールキーは、以下のいずれかのフォーマットで指定できます:

  • 2文字の言語コード:enru
  • 5文字の言語コード: en-USru-RUde-DE

2文字の言語コードの例:

{
  "name": {
    "en": "Starter Pack",
    "ru": "Стартовый набор"
  }
}

5文字の言語コードの例:

{
  "description": {
    "en-US": "Premium bundle",
    "de-DE": "Premium-Paket"
  }
}

エラー応答フォーマット

エラーが発生した場合、APIはHTTPステータスとJSON応答本文を返します。ストア関連のエラーの全リストはドキュメントで確認できます。

応答例:

{
  "errorCode": 1102,
  "errorMessage": "Validation error",
  "statusCode": 422,
  "transactionId": "c9e1a..."
}
  • errorCode — エラーコード。
  • errorMessage — 短いエラー説明。
  • statusCode — HTTP応答ステータス。
  • transactionId — リクエストID。一部の場合にのみ返されます。
  • errorMessageExtended — リクエストパラメータなどの追加エラー詳細。一部の場合にのみ返されます。

拡張応答例:

{
  "errorCode": 7001,
  "errorMessage": "Chain not found",
  "errorMessageExtended": {
    "chain_id": "test_chain_id",
    "project_id": "test_project_id",
    "step_number": 2
  },
  "statusCode": 404
}

共通のHTTPステータスコード

  • 400 — 無効なリクエスト
  • 401 — 認証エラー
  • 403 — 権限不足
  • 404 — リソースが見つかりません
  • 422 — 検証エラー
  • 429 — レート制限超過

推奨事項

  • HTTPステータスと応答本文を一緒に処理します。
  • errorCodeを使用してアプリケーションロジックに関連するエラーを処理します。
  • transactionIdを使用して、エラーを分析する際にリクエストをより迅速に特定します。
OpenAPI記述をダウンロード
言語
サーバー
https://store.xsolla.com/api/
Mock server
https://xsolla.redocly.app/_mock/ja/api/catalog/

概要

仮想アイテムと仮想通貨を使用してインゲームストアを構築し、ユーザーへの表示方法を設定できます。以下のアイテムタイプが利用可能です:

  • 仮想アイテム — 武器、スキン、ブースターなどのゲーム内アイテム。実際のお金または仮想通貨で販売できます。
  • 仮想通貨 — 仮想アイテムの購入に使用されるゲーム内通貨。実際のお金または仮想通貨で販売できます。
  • 仮想通貨パッケージ — 仮想通貨の固定数量パック。実際のお金または仮想通貨で販売できます。

グループは、カタログ内のアイテムを整理するために使用されます。アイテムを論理的にグループ化し、表示方法を管理することができます。

管理者サブセクションのAPIコールを使用して、アイテムの作成、更新、削除を行います。

カタログサブセクションのAPIコールを使用して、アイテムのリストを取得し、ユーザーに表示します。

注意

管理者サブセクションのAPIコールを使用してストアカタログを構築しないでください。

注意

仮想アイテムリストを取得するAPIコールは、価格や属性を含む詳細なアイテムデータを返し、ページネーションをサポートします。ストアフロントでカタログページを表示するために使用してください。

すべての仮想アイテムリストを取得するAPIコールは、ページネーションなしでアイテムSKU、名前、説明、グループIDと名前を返します。クライアント側の検索やインデックス作成に使用してください。

仮想通貨で購入する場合、仮想通貨で購入された指定アイテムで注文を作成するAPIコールを使用してください。当該APIコールの実行時に課金処理が行われるため、決済UIを表示する必要はありません。

仮想通貨での購入フローの例:

仮想通貨での購入フローの例:

操作
操作

仮想通貨パッケージリストを取得Client-side

リクエスト

カタログ構築のために、仮想通貨パッケージを取得します。

注意

すべてのプロジェクトには、応答で取得できるアイテム数に制限があります。デフォルトおよび最大値は1応答あたり50アイテムです。ページごとにデータを取得するには、制限オフセットフィールドを使用してください。

注意

認証なしで使用した場合、このAPIコールは一般的なアイテムカタログデータを返します。認証を使用して、アイテムに関連する制限やプロモーションなどのパーソナライズされたユーザーデータを取得します。これを行うには、ユーザーのJWTをAuthorizationヘッダーに渡してください。ユーザーJWTの詳細については、このコールのセキュリティブロックを参照してください。
セキュリティ
XsollaLoginUserJWT
パス
project_idinteger必須

プロジェクトID。このパラメータは、パブリッシャーアカウントのプロジェクト名の横、またはプロジェクトの作業中にブラウザのアドレスバーで確認できます。URLの形式は以下の通りです:https://publisher.xsolla.com/<merchant_id>/projects/<project_id>

例: 44056
クエリ
limitinteger>= 1

ページでの要素数の制限。

例: limit=50
offsetinteger>= 0

リストが生成される要素番号(カウントは0から始まります)。

例: offset=0
localestring

応答言語。ISO 639-1に準拠した2文字の小文字の言語コード(例:en)。namedescriptionなどのローカリゼーションフィールドでは5文字のロケールコード(例:en-US)がサポートされていますが、応答内では2文字のコードに正規化されます。サポートされている言語の完全なリストは、ドキュメントで確認できます。

デフォルト "en"
additional_fields[]Array of strings

追加フィールドのリスト。これらのフィールドは、リクエストの中で送信すると、応答に含まれます。

アイテム 列挙型"media_list""order""long_description""custom_attributes""item_order_in_group"
countrystring

ISO 3166-1 alpha-2に従った2文字の大文字の国名コード。エクソーラがサポートする国国を決定するプロセスに関する詳細情報については、ドキュメントを確認してください。

例: country=US
promo_codestring[ 1 .. 128 ] characters

大文字と小文字を区別する一意のコードです。文字と数字が含まれます。

例: promo_code=WINTER2021
show_inactive_time_limited_itemsinteger

ユーザーに利用可能でない、期限付きアイテムを表示します。このようなアイテムの有効期間はまだ開始されていないか、すでに期限切れです。

デフォルト 0
例: show_inactive_time_limited_items=1
curl -i -X GET \
  'https://store.xsolla.com/api/v2/project/44056/items/virtual_currency/package?limit=50&offset=0&locale=en&additional_fields%5B%5D=media_list&country=US&promo_code=WINTER2021&show_inactive_time_limited_items=1' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

レスポンス

仮想通貨パッケージのリストは正常に受信されました。

ボディapplication/json
has_moreboolean

ページ数がもっとあることを示す指標として使用されます。

itemsArray of objects
items[].​item_idinteger
items[].​skustring

一意のアイテムID。SKUには、小文字と大文字のラテン英数字、ピリオド、ダッシュ、およびアンダースコアのみが含まれます。

例: "crystal-pack"
items[].​namestring

アイテム名。

例: "Crystal Pack"
items[].​groupsArray of objects

アイテムが所属するグループ。

items[].​groups[].​external_idstring

このグループの一意の識別子。通常、APIリクエストや外部システムでの参照に使用されます。

例: "exclusive"
items[].​groups[].​namestring

グループ名。

例: "Exclusive"
items[].​groups[].​item_order_in_groupinteger

グループ内でのアイテムの位置。表示順を決定するために使用されます。 このフィールドは、additional_fields[]クエリパラメータでリクエストされた場合にのみ、応答に含まれます。

例: 1
items[].​attributesArray of objects

アイテムに対応する属性と値のリスト。カタログのフィルタリングに使用できます。

items[].​attributes[].​external_idstring[ 1 .. 255 ] characters^[a-zA-Z0-9-_]+$

一意の属性ID。external_idには、小文字と大文字のラテン英数字、ダッシュ、およびアンダースコアのみが含まれます。

items[].​attributes[].​nameobject

属性名。

例: "Genre"
items[].​attributes[].​name.​property name*string or null追加プロパティ
items[].​attributes[].​valuesArray of objects
items[].​attributes[].​values[].​external_idstring[ 1 .. 255 ] characters^[-_.\d\w]+$

属性の一意の値ID。external_idには、半角小文字の英数字、ハイフン、アンダースコアのみを含めることができます。

items[].​attributes[].​values[].​valuestring

属性値。

例: "Strategy"
items[].​typestring

アイテムタイプ:virtual_good/virtual_currency/bundle

例: "bundle"
items[].​bundle_typestring

バンドルタイプ:standard/virtual_currency_package

例: "virtual_currency_package"
items[].​descriptionstring

アイテムの説明。

例: "Crystal Pack Description"
items[].​image_urlstring

画像URL。

例: "https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png"
items[].​is_freeboolean

アイテムが無料かどうか。

items[].​priceobject

アイテム価格。

items[].​price.​amountstring

割引後のアイテム価格。

例: "100.99"
items[].​price.​amount_without_discountstring

アイテム価格。

例: "100.99"
items[].​price.​currencystring

商品価格の通貨。3文字のコードISO4217 規格詳細については、ドキュメントを参照してください。エクソーラでサポートされている通貨

例: "USD"
items[].​virtual_pricesArray of objects

仮想価格。

items[].​virtual_prices[].​amountinteger

仮想通貨での割引アイテム価格。

例: 100
items[].​virtual_prices[].​amount_without_discountinteger

アイテム価格。

例: 200
items[].​virtual_prices[].​skustring

仮想通貨アイテムSKU。

例: "vc_test"
items[].​virtual_prices[].​is_defaultboolean

アイテムの価格をデフォルトにするかどうか。

例: true
items[].​virtual_prices[].​image_urlstring

仮想通貨のイメージ。

例: "http://image.png"
items[].​virtual_prices[].​namestring

仮想通貨名。

例: "SHOTGUN FOR TRUE RAIDERS"
items[].​virtual_prices[].​typestring

仮想通貨のタイプ。

例: "virtual_currency"
items[].​virtual_prices[].​descriptionstring

Virtual currency description.

例: "Big Rocket - description"
items[].​can_be_boughtboolean

trueの場合、ユーザーはアイテムを購入することができます。

items[].​contentArray of objects

仮想通貨パッケージの内容。

例: [{"description":"Crystal Pack - short description","image_url":"https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png","sku":"com.xsolla.crystal_pack_1","name":"Crystal Pack","type":"virtual_currency","quantity":100}]
items[].​content[].​item_idinteger
items[].​content[].​skustring

一意のアイテムID。SKUには、小文字と大文字のラテン英数字、ダッシュ、およびアンダースコアのみが含まれます。

例: "com.xsolla.big_rocket_1"
items[].​content[].​namestring

アイテム名。

例: "Big Rocket"
items[].​content[].​typestring

アイテムタイプ:virtual_good/virtual_currency/bundle

例: "virtual_currency"
items[].​content[].​descriptionstring

アイテムの説明。

例: "Big Rocket - description"
items[].​content[].​image_urlstring

画像URL。

例: "https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png"
items[].​content[].​quantityinteger

パッケージ内の仮想通貨の数量。

例: 250
items[].​content[].​limitsobject or null

アイテム制限。

items[].​content[].​limits.​per_userobject or null

ユーザーのアイテム制限。

items[].​content[].​limits.​per_user.​totalinteger

1ユーザーあたりのユーザーが購入できるアイテムの最大数。

例: 5
items[].​content[].​limits.​per_user.​availableinteger

現在のユーザーが購入できるアイテムの残り数。

例: 3
items[].​content[].​limits.​per_user.​recurrent_schedule(object or null)
One of:

ユーザーのアイテム制限の定期更新期間。

object or null
items[].​content[].​limits.​per_user.​limit_exceeded_visibilitystring

購入制限に達してから次回の制限リセットまでの間、カタログ内でのアイテムの表示・非表示を決定します。

これは、recurrent_schedule配列で定期的な制限リセットが設定されているアイテムに適用されます。

購入制限のリセットが設定されていない場合、購入制限に達した後は、limit_exceeded_visibilityの値に関わらず、そのアイテムはカタログに表示されなくなります。

指定可能な値:

  • show — 購入制限に達した後も、カタログ取得用のAPIコールに対してアイテム情報が返却されます。クライアントサイドのカタログ取得APIコールにおいては、制限に達した時点でアイテムにcan_be_bought: falseフラグが付与されて返されます。次回のリセット日時はreset_next_dateに格納されて返却されます。
  • hide — 購入制限に達した時点から、制限値がリセットされるまでの間、カタログ取得用のAPIコールにおいてアイテムは返されなくなります。
列挙型"show""hide"
items[].​content[].​limits.​per_itemobject or null

アイテムのアイテム制限。

items[].​content[].​limits.​per_item.​totalinteger

すべてのユーザーが購入できるアイテムの最大数。

例: 5
items[].​content[].​limits.​per_item.​availableinteger

すべてのユーザーが購入できるアイテムの残り数。

例: 3
items[].​promotionsArray of objects

カート内の特定アイテムに適用されるプロモーション。この配列は、以下のケースで返されます:

  • 特定のアイテムに対して、割引キャンペーンが構成されている場合。

  • 選択されたアイテムの割引設定を持つプロモーションコードが適用された場合。

アイテムレベルのプロモーションが適用されない場合は、空の配列が返されます。

items[].​promotions[].​namestring
items[].​promotions[].​date_startstring or null(date-time)
items[].​promotions[].​date_endstring or null(date-time)
items[].​promotions[].​discountobject or null
items[].​promotions[].​discount.​percentstring or null
items[].​promotions[].​discount.​valuestring or null
items[].​promotions[].​bonusArray of objects
items[].​promotions[].​bonus[].​skustring
items[].​promotions[].​bonus[].​quantityinteger
items[].​promotions[].​bonus[].​typestring

ボーナスアイテムタイプ。

列挙型"virtual_good""virtual_currency""bundle""physical_good""game_key""nft"
items[].​promotions[].​bonus[].​namestring

ボーナスアイテムの名前です。ボーナスアイテムのタイプphysical_goodでは使用できません。

items[].​promotions[].​bonus[].​image_urlstring

ボーナスアイテムの画像URLです。ボーナスアイテムのタイプ physical_good では使用できません。ー

items[].​promotions[].​bonus[].​bundle_typestring

ボーナスバンドルアイテムタイプ。ボーナスアイテムタイプbundleのみで利用可能です。

列挙型"standard""virtual_currency_package"
items[].​promotions[].​limitsobject
items[].​promotions[].​limits.​per_userobject
items[].​promotions[].​limits.​per_user.​availableinteger
items[].​promotions[].​limits.​per_user.​totalinteger
items[].​limitsobject or null

アイテム制限。

items[].​limits.​per_userobject or null

ユーザーのアイテム制限。

items[].​limits.​per_user.​totalinteger

1ユーザーあたりのユーザーが購入できるアイテムの最大数。

例: 5
items[].​limits.​per_user.​availableinteger

現在のユーザーが購入できるアイテムの残り数。

例: 3
items[].​limits.​per_user.​recurrent_schedule(object or null)
One of:

ユーザーのアイテム制限の定期更新期間。

object or null
items[].​limits.​per_user.​limit_exceeded_visibilitystring

購入制限に達してから次回の制限リセットまでの間、カタログ内でのアイテムの表示・非表示を決定します。

これは、recurrent_schedule配列で定期的な制限リセットが設定されているアイテムに適用されます。

購入制限のリセットが設定されていない場合、購入制限に達した後は、limit_exceeded_visibilityの値に関わらず、そのアイテムはカタログに表示されなくなります。

指定可能な値:

  • show — 購入制限に達した後も、カタログ取得用のAPIコールに対してアイテム情報が返却されます。クライアントサイドのカタログ取得APIコールにおいては、制限に達した時点でアイテムにcan_be_bought: falseフラグが付与されて返されます。次回のリセット日時はreset_next_dateに格納されて返却されます。
  • hide — 購入制限に達した時点から、制限値がリセットされるまでの間、カタログ取得用のAPIコールにおいてアイテムは返されなくなります。
列挙型"show""hide"
items[].​limits.​per_itemobject or null

アイテムのアイテム制限。

items[].​limits.​per_item.​totalinteger

すべてのユーザーが購入できるアイテムの最大数。

例: 5
items[].​limits.​per_item.​availableinteger

すべてのユーザーが購入できるアイテムの残り数。

例: 3
items[].​periodsArray of objects

アイテム販売期間。

items[].​periods[].​date_fromstring or null(date-time)

指定されたアイテムの販売開始日。

例: "2020-08-11T10:00:00+03:00"
items[].​periods[].​date_untilstring or null(date-time)

指定されたアイテムが販売できなくなる日付。nullを指定することもできます。

例: "2020-08-11T20:00:00+03:00"
items[].​custom_attributesobject(json)

アイテムの属性と値を含むJSONオブジェクト。

items[].​vp_rewardsArray of arrays
レスポンス
application/json
{ "has_more": false, "items": [ {}, {} ] }

SKUによる販売可能なアイテムを取得するClient-side

リクエスト

カタログを作成するためにSKUによる仮想通貨パッケージを取得します。

注意

認証なしで使用した場合、このAPIコールは一般的なアイテムカタログデータを返します。認証を使用して、アイテムに関連する制限やプロモーションなどのパーソナライズされたユーザーデータを取得します。これを行うには、ユーザーのJWTをAuthorizationヘッダーに渡してください。ユーザーJWTの詳細については、このコールのセキュリティブロックを参照してください。
セキュリティ
XsollaLoginUserJWT
パス
project_idinteger必須

プロジェクトID。このパラメータは、パブリッシャーアカウントのプロジェクト名の横、またはプロジェクトの作業中にブラウザのアドレスバーで確認できます。URLの形式は以下の通りです:https://publisher.xsolla.com/<merchant_id>/projects/<project_id>

例: 44056
virtual_currency_package_skustring必須

仮想通貨パッケージ SKU。

例: crystal-pack
クエリ
localestring

応答言語。ISO 639-1に準拠した2文字の小文字の言語コード(例:en)。namedescriptionなどのローカリゼーションフィールドでは5文字のロケールコード(例:en-US)がサポートされていますが、応答内では2文字のコードに正規化されます。サポートされている言語の完全なリストは、ドキュメントで確認できます。

デフォルト "en"
countrystring

ISO 3166-1 alpha-2に従った2文字の大文字の国名コード。エクソーラがサポートする国国を決定するプロセスに関する詳細情報については、ドキュメントを確認してください。

例: country=US
show_inactive_time_limited_itemsinteger

ユーザーに利用可能でない、期限付きアイテムを表示します。このようなアイテムの有効期間はまだ開始されていないか、すでに期限切れです。

デフォルト 0
例: show_inactive_time_limited_items=1
additional_fields[]Array of strings

追加フィールドのリスト。これらのフィールドは、リクエストの中で送信すると、応答に含まれます。

アイテム 列挙型"media_list""order""long_description""custom_attributes""item_order_in_group"
curl -i -X GET \
  'https://store.xsolla.com/api/v2/project/44056/items/virtual_currency/package/sku/crystal-pack?locale=en&country=US&show_inactive_time_limited_items=1&additional_fields%5B%5D=media_list' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

レスポンス

仮想通貨パッケージは正常に受信されました。

ボディapplication/json
item_idinteger
skustring

一意のアイテムID。SKUには、小文字と大文字のラテン英数字、ピリオド、ダッシュ、およびアンダースコアのみが含まれます。

例: "crystal-pack"
namestring

アイテム名。

例: "Crystal Pack"
groupsArray of objects

アイテムが所属するグループ。

groups[].​external_idstring

このグループの一意の識別子。通常、APIリクエストや外部システムでの参照に使用されます。

例: "exclusive"
groups[].​namestring

グループ名。

例: "Exclusive"
groups[].​item_order_in_groupinteger

グループ内でのアイテムの位置。表示順を決定するために使用されます。 このフィールドは、additional_fields[]クエリパラメータでリクエストされた場合にのみ、応答に含まれます。

例: 1
attributesArray of objects

アイテムに対応する属性と値のリスト。カタログのフィルタリングに使用できます。

attributes[].​external_idstring[ 1 .. 255 ] characters^[a-zA-Z0-9-_]+$

一意の属性ID。external_idには、小文字と大文字のラテン英数字、ダッシュ、およびアンダースコアのみが含まれます。

attributes[].​nameobject

属性名。

例: "Genre"
attributes[].​name.​property name*string or null追加プロパティ
attributes[].​valuesArray of objects
attributes[].​values[].​external_idstring[ 1 .. 255 ] characters^[-_.\d\w]+$

属性の一意の値ID。external_idには、半角小文字の英数字、ハイフン、アンダースコアのみを含めることができます。

attributes[].​values[].​valuestring

属性値。

例: "Strategy"
typestring

アイテムタイプ:virtual_good/virtual_currency/bundle

例: "bundle"
bundle_typestring

バンドルタイプ:standard/virtual_currency_package

例: "virtual_currency_package"
descriptionstring

アイテムの説明。

例: "Crystal Pack Description"
image_urlstring

画像URL。

例: "https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png"
is_freeboolean

アイテムが無料かどうか。

priceobject

アイテム価格。

price.​amountstring

割引後のアイテム価格。

例: "100.99"
price.​amount_without_discountstring

アイテム価格。

例: "100.99"
price.​currencystring

商品価格の通貨。3文字のコードISO4217 規格詳細については、ドキュメントを参照してください。エクソーラでサポートされている通貨

例: "USD"
virtual_pricesArray of objects

仮想価格。

virtual_prices[].​amountinteger

仮想通貨での割引アイテム価格。

例: 100
virtual_prices[].​amount_without_discountinteger

アイテム価格。

例: 200
virtual_prices[].​skustring

仮想通貨アイテムSKU。

例: "vc_test"
virtual_prices[].​is_defaultboolean

アイテムの価格をデフォルトにするかどうか。

例: true
virtual_prices[].​image_urlstring

仮想通貨のイメージ。

例: "http://image.png"
virtual_prices[].​namestring

仮想通貨名。

例: "SHOTGUN FOR TRUE RAIDERS"
virtual_prices[].​typestring

仮想通貨のタイプ。

例: "virtual_currency"
virtual_prices[].​descriptionstring

Virtual currency description.

例: "Big Rocket - description"
can_be_boughtboolean

trueの場合、ユーザーはアイテムを購入することができます。

contentArray of objects

仮想通貨パッケージの内容。

例: [{"description":"Crystal Pack - short description","image_url":"https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png","sku":"com.xsolla.crystal_pack_1","name":"Crystal Pack","type":"virtual_currency","quantity":100}]
content[].​item_idinteger
content[].​skustring

一意のアイテムID。SKUには、小文字と大文字のラテン英数字、ダッシュ、およびアンダースコアのみが含まれます。

例: "com.xsolla.big_rocket_1"
content[].​namestring

アイテム名。

例: "Big Rocket"
content[].​typestring

アイテムタイプ:virtual_good/virtual_currency/bundle

例: "virtual_currency"
content[].​descriptionstring

アイテムの説明。

例: "Big Rocket - description"
content[].​image_urlstring

画像URL。

例: "https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png"
content[].​quantityinteger

パッケージ内の仮想通貨の数量。

例: 250
content[].​limitsobject or null

アイテム制限。

content[].​limits.​per_userobject or null

ユーザーのアイテム制限。

content[].​limits.​per_user.​totalinteger

1ユーザーあたりのユーザーが購入できるアイテムの最大数。

例: 5
content[].​limits.​per_user.​availableinteger

現在のユーザーが購入できるアイテムの残り数。

例: 3
content[].​limits.​per_user.​recurrent_schedule(object or null)
One of:

ユーザーのアイテム制限の定期更新期間。

object or null
content[].​limits.​per_user.​limit_exceeded_visibilitystring

購入制限に達してから次回の制限リセットまでの間、カタログ内でのアイテムの表示・非表示を決定します。

これは、recurrent_schedule配列で定期的な制限リセットが設定されているアイテムに適用されます。

購入制限のリセットが設定されていない場合、購入制限に達した後は、limit_exceeded_visibilityの値に関わらず、そのアイテムはカタログに表示されなくなります。

指定可能な値:

  • show — 購入制限に達した後も、カタログ取得用のAPIコールに対してアイテム情報が返却されます。クライアントサイドのカタログ取得APIコールにおいては、制限に達した時点でアイテムにcan_be_bought: falseフラグが付与されて返されます。次回のリセット日時はreset_next_dateに格納されて返却されます。
  • hide — 購入制限に達した時点から、制限値がリセットされるまでの間、カタログ取得用のAPIコールにおいてアイテムは返されなくなります。
列挙型"show""hide"
content[].​limits.​per_itemobject or null

アイテムのアイテム制限。

content[].​limits.​per_item.​totalinteger

すべてのユーザーが購入できるアイテムの最大数。

例: 5
content[].​limits.​per_item.​availableinteger

すべてのユーザーが購入できるアイテムの残り数。

例: 3
promotionsArray of objects

カート内の特定アイテムに適用されるプロモーション。この配列は、以下のケースで返されます:

  • 特定のアイテムに対して、割引キャンペーンが構成されている場合。

  • 選択されたアイテムの割引設定を持つプロモーションコードが適用された場合。

アイテムレベルのプロモーションが適用されない場合は、空の配列が返されます。

promotions[].​namestring
promotions[].​date_startstring or null(date-time)
promotions[].​date_endstring or null(date-time)
promotions[].​discountobject or null
promotions[].​discount.​percentstring or null
promotions[].​discount.​valuestring or null
promotions[].​bonusArray of objects
promotions[].​bonus[].​skustring
promotions[].​bonus[].​quantityinteger
promotions[].​bonus[].​typestring

ボーナスアイテムタイプ。

列挙型"virtual_good""virtual_currency""bundle""physical_good""game_key""nft"
promotions[].​bonus[].​namestring

ボーナスアイテムの名前です。ボーナスアイテムのタイプphysical_goodでは使用できません。

promotions[].​bonus[].​image_urlstring

ボーナスアイテムの画像URLです。ボーナスアイテムのタイプ physical_good では使用できません。ー

promotions[].​bonus[].​bundle_typestring

ボーナスバンドルアイテムタイプ。ボーナスアイテムタイプbundleのみで利用可能です。

列挙型"standard""virtual_currency_package"
promotions[].​limitsobject
promotions[].​limits.​per_userobject
promotions[].​limits.​per_user.​availableinteger
promotions[].​limits.​per_user.​totalinteger
limitsobject or null

アイテム制限。

limits.​per_userobject or null

ユーザーのアイテム制限。

limits.​per_user.​totalinteger

1ユーザーあたりのユーザーが購入できるアイテムの最大数。

例: 5
limits.​per_user.​availableinteger

現在のユーザーが購入できるアイテムの残り数。

例: 3
limits.​per_user.​recurrent_schedule(object or null)
One of:

ユーザーのアイテム制限の定期更新期間。

object or null
limits.​per_user.​limit_exceeded_visibilitystring

購入制限に達してから次回の制限リセットまでの間、カタログ内でのアイテムの表示・非表示を決定します。

これは、recurrent_schedule配列で定期的な制限リセットが設定されているアイテムに適用されます。

購入制限のリセットが設定されていない場合、購入制限に達した後は、limit_exceeded_visibilityの値に関わらず、そのアイテムはカタログに表示されなくなります。

指定可能な値:

  • show — 購入制限に達した後も、カタログ取得用のAPIコールに対してアイテム情報が返却されます。クライアントサイドのカタログ取得APIコールにおいては、制限に達した時点でアイテムにcan_be_bought: falseフラグが付与されて返されます。次回のリセット日時はreset_next_dateに格納されて返却されます。
  • hide — 購入制限に達した時点から、制限値がリセットされるまでの間、カタログ取得用のAPIコールにおいてアイテムは返されなくなります。
列挙型"show""hide"
limits.​per_itemobject or null

アイテムのアイテム制限。

limits.​per_item.​totalinteger

すべてのユーザーが購入できるアイテムの最大数。

例: 5
limits.​per_item.​availableinteger

すべてのユーザーが購入できるアイテムの残り数。

例: 3
periodsArray of objects

アイテム販売期間。

periods[].​date_fromstring or null(date-time)

指定されたアイテムの販売開始日。

例: "2020-08-11T10:00:00+03:00"
periods[].​date_untilstring or null(date-time)

指定されたアイテムが販売できなくなる日付。nullを指定することもできます。

例: "2020-08-11T20:00:00+03:00"
custom_attributesobject(json)

アイテムの属性と値を含むJSONオブジェクト。

vp_rewardsArray of arrays
レスポンス
application/json
{ "item_id": 488832, "sku": "com.xsolla.crystal_pack_1", "type": "bundle", "name": "Crystal Pack", "bundle_type": "virtual_currency_package", "description": "Crystal Pack Short Description", "image_url": "http://vc_package_image.png", "price": { "amount": "100", "amount_without_discount": "100", "currency": "USD" }, "virtual_prices": [], "can_be_bought": true, "promotions": [], "limits": { "per_user": {}, "per_item": null }, "periods": [ {} ], "attributes": [], "is_free": false, "groups": [], "content": [ {} ], "vp_rewards": [], "custom_attributes": { "purchased": 0, "attr": "value" } }

指定されたグループによるアイテムリストを取得するClient-side

リクエスト

カタログを作成するために、指定されたグループからアイテムリストを取得します。

注意

すべてのプロジェクトには、応答で取得できるアイテム数に制限があります。デフォルトおよび最大値は1応答あたり50アイテムです。ページごとにデータを取得するには、制限オフセットフィールドを使用してください。

注意

認証なしで使用した場合、このAPIコールは一般的なアイテムカタログデータを返します。認証を使用して、アイテムに関連する制限やプロモーションなどのパーソナライズされたユーザーデータを取得します。これを行うには、ユーザーのJWTをAuthorizationヘッダーに渡してください。ユーザーJWTの詳細については、このコールのセキュリティブロックを参照してください。
セキュリティ
XsollaLoginUserJWT
パス
project_idinteger必須

プロジェクトID。このパラメータは、パブリッシャーアカウントのプロジェクト名の横、またはプロジェクトの作業中にブラウザのアドレスバーで確認できます。URLの形式は以下の通りです:https://publisher.xsolla.com/<merchant_id>/projects/<project_id>

例: 44056
external_idstring必須

作成時に指定された外部アイテムグループID。

例: weapons
クエリ
limitinteger>= 1

ページでの要素数の制限。

例: limit=50
offsetinteger>= 0

リストが生成される要素番号(カウントは0から始まります)。

例: offset=0
localestring

応答言語。ISO 639-1に準拠した2文字の小文字の言語コード(例:en)。namedescriptionなどのローカリゼーションフィールドでは5文字のロケールコード(例:en-US)がサポートされていますが、応答内では2文字のコードに正規化されます。サポートされている言語の完全なリストは、ドキュメントで確認できます。

デフォルト "en"
additional_fields[]Array of strings

追加フィールドのリスト。これらのフィールドは、リクエストの中で送信すると、応答に含まれます。

アイテム 列挙型"media_list""order""long_description""custom_attributes""item_order_in_group"
countrystring

ISO 3166-1 alpha-2に従った2文字の大文字の国名コード。エクソーラがサポートする国国を決定するプロセスに関する詳細情報については、ドキュメントを確認してください。

例: country=US
promo_codestring[ 1 .. 128 ] characters

大文字と小文字を区別する一意のコードです。文字と数字が含まれます。

例: promo_code=WINTER2021
show_inactive_time_limited_itemsinteger

ユーザーに利用可能でない、期限付きアイテムを表示します。このようなアイテムの有効期間はまだ開始されていないか、すでに期限切れです。

デフォルト 0
例: show_inactive_time_limited_items=1
curl -i -X GET \
  'https://store.xsolla.com/api/v2/project/44056/items/virtual_items/group/weapons?limit=50&offset=0&locale=en&additional_fields%5B%5D=media_list&country=US&promo_code=WINTER2021&show_inactive_time_limited_items=1' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

レスポンス

指定されたグループのリストは正常に受信されました。

ボディapplication/json
has_moreboolean

ページ数がもっとあることを示す指標として使用されます。

itemsArray of objects
例: [{"sku":"com.xsolla.big_rocket_1","name":"Big Rocket","groups":[{"external_id":"weapons","name":"weapons"}],"attributes":[{"external_id":"stack_size","name":"Stack size","values":[{"value":"5"}]}],"type":"virtual_good","description":"Big Rocket - description","image_url":"https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png","is_free":false,"price":{"amount":"100.99","amount_without_discount":"100.99","currency":"USD"},"virtual_prices":[{"amount":100,"sku":"com.xsolla.vc_1","is_default":true,"amount_without_discount":100,"image_url":"http://image.png","name":"SHOTGUN FOR TRUE RAIDERS","type":"virtual_currency","description":"description"}],"can_be_bought":true,"virtual_item_type":"non_renewing_subscription","promotions":[{"name":"Bonus promotion","date_start":"2020-04-15T16:16:00+03:00","date_end":"2026-04-15T16:16:00+03:00","discount":{"percent":"50.00"},"bonus":[{"quantity":1,"name":"Xsolla Minigun","image_url":"https://cdn.xsolla.net/img/misc/images/2fc5c491a47413a8e8000447889093c2.png","sku":"com.xsolla.minigun_1","type":"virtual_good"}]}],"limits":{"per_user":{"total":5,"available":3,"recurrent_schedule":{"interval_type":"weekly","reset_next_date":1746057600},"limit_exceeded_visibility":"show"},"per_item":null},"periods":[{"date_from":"2020-08-11T10:00:00+03:00","date_until":"2020-08-11T20:00:00+03:00"}]},{"sku":"com.xsolla.shotgun_raider","name":"SHOTGUN FOR TRUE RAIDERS","groups":[{"external_id":"weapons","name":{"en":"weapons"}}],"attributes":[{"external_id":"stack_size","name":"Stack size","values":[{"value":"5"}]},{"external_id":"rating","name":"Rating","values":[{"value":"3.9"}]},{"external_id":"genre","name":"Genre","values":[{"value":"Strategy"},{"value":"Tactical"},"Turn-based"]}],"type":"virtual_good","description":"description","image_url":"http://image.png","is_free":false,"price":{"amount":"101.0","amount_without_discount":"101.0","currency":"USD"},"virtual_prices":[{"amount":100,"sku":"com.xsolla.vc_1","is_default":true,"amount_without_discount":100,"image_url":"http://image.png","name":"SHOTGUN FOR TRUE RAIDERS","type":"virtual_currency","description":"description"},{"amount":200,"sku":"com.xsolla.vc_2","is_default":false,"amount_without_discount":200,"image_url":"http://image.png","name":"SHOTGUN FOR TRUE RAIDERS","type":"virtual_currency","description":"description"}],"can_be_bought":true,"virtual_item_type":"non_renewing_subscription","promotions":[],"limits":null,"periods":[]}]
items[].​skustring

一意のアイテムID。SKUには、小文字と大文字のラテン英数字、ピリオド、ダッシュ、およびアンダースコアのみが含まれます。

例: "com.xsolla.big_rocket_1"
items[].​namestring

アイテム名。

例: "Big Rocket"
items[].​groupsArray of objects

アイテムが所属するグループ。

items[].​groups[].​external_idstring

このグループの一意の識別子。通常、APIリクエストや外部システムでの参照に使用されます。

例: "exclusive"
items[].​groups[].​namestring

グループ名。

例: "Exclusive"
items[].​groups[].​item_order_in_groupinteger

グループ内でのアイテムの位置。表示順を決定するために使用されます。 このフィールドは、additional_fields[]クエリパラメータでリクエストされた場合にのみ、応答に含まれます。

例: 1
items[].​attributesArray of objects

アイテムに対応する属性と値のリスト。カタログのフィルタリングに使用できます。

items[].​attributes[].​external_idstring[ 1 .. 255 ] characters^[a-zA-Z0-9-_]+$

一意の属性ID。external_idには、小文字と大文字のラテン英数字、ダッシュ、およびアンダースコアのみが含まれます。

items[].​attributes[].​nameobject

属性名。

例: "Genre"
items[].​attributes[].​name.​property name*string or null追加プロパティ
items[].​attributes[].​valuesArray of objects
items[].​attributes[].​values[].​external_idstring[ 1 .. 255 ] characters^[-_.\d\w]+$

属性の一意の値ID。external_idには、半角小文字の英数字、ハイフン、アンダースコアのみを含めることができます。

items[].​attributes[].​values[].​valuestring

属性値。

例: "Strategy"
items[].​typestring

アイテムタイプ:consumable/expiration/permanent/lootboxes/physical

例: "virtual_good"
items[].​descriptionstring

アイテムの説明。

例: "Big Rocket - description"
items[].​image_urlstring

画像URL。

例: "https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png"
items[].​is_freeboolean

アイテムが無料かどうか。

items[].​priceobject

アイテム価格。

items[].​price.​amountstring

割引後のアイテム価格。

例: "100.99"
items[].​price.​amount_without_discountstring

アイテム価格。

例: "100.99"
items[].​price.​currencystring

商品価格通貨。ISO 4217 による3文字コード。

例: "USD"
items[].​virtual_pricesArray of objects

仮想価格。

items[].​virtual_prices[].​amountinteger

仮想通貨での割引アイテム価格。

例: 100
items[].​virtual_prices[].​amount_without_discountinteger

アイテム価格。

例: 200
items[].​virtual_prices[].​skustring

仮想通貨アイテムSKU。

例: "com.xsolla.vc_1"
items[].​virtual_prices[].​is_defaultboolean

アイテムの価格をデフォルトにするかどうか。

例: true
items[].​virtual_prices[].​image_urlstring
例: "http://image.png"
items[].​virtual_prices[].​namestring

仮想通貨名。

例: "SHOTGUN FOR TRUE RAIDERS"
items[].​virtual_prices[].​typestring

仮想通貨のタイプ。

例: "virtual_currency"
items[].​virtual_prices[].​descriptionstring

Virtual currency description.

例: "Big Rocket - description"
items[].​can_be_boughtboolean

trueの場合、ユーザーはアイテムを購入することができます。

items[].​virtual_item_typestring

仮想アイテムタイプ。

指定可能な値:

  • consumable — 使用後にインベントリから消滅するアイテム(例:弾薬など)。
  • non_consumable — 期間の制限なくインベントリに残り続けるアイテム。
  • non_renewing_subscription — 制限された期間内に限り、サービスやコンテンツへのアクセス権を付与する期間限定アイテム。
列挙型"consumable""non_consumable""non_renewing_subscription"
例: "non_consumable"
items[].​promotionsArray of objects

カート内の特定アイテムに適用されるプロモーション。この配列は、以下のケースで返されます:

  • 特定のアイテムに対して、割引キャンペーンが構成されている場合。

  • 選択されたアイテムの割引設定を持つプロモーションコードが適用された場合。

アイテムレベルのプロモーションが適用されない場合は、空の配列が返されます。

items[].​promotions[].​namestring
items[].​promotions[].​date_startstring or null(date-time)
items[].​promotions[].​date_endstring or null(date-time)
items[].​promotions[].​discountobject or null
items[].​promotions[].​discount.​percentstring or null
items[].​promotions[].​discount.​valuestring or null
items[].​promotions[].​bonusArray of objects
items[].​promotions[].​bonus[].​skustring
items[].​promotions[].​bonus[].​quantityinteger
items[].​promotions[].​bonus[].​typestring

ボーナスアイテムタイプ。

列挙型"virtual_good""virtual_currency""bundle""physical_good""game_key""nft"
items[].​promotions[].​bonus[].​namestring

ボーナスアイテムの名前です。ボーナスアイテムのタイプphysical_goodでは使用できません。

items[].​promotions[].​bonus[].​image_urlstring

ボーナスアイテムの画像URLです。ボーナスアイテムのタイプ physical_good では使用できません。ー

items[].​promotions[].​bonus[].​bundle_typestring

ボーナスバンドルアイテムタイプ。ボーナスアイテムタイプbundleのみで利用可能です。

列挙型"standard""virtual_currency_package"
items[].​promotions[].​limitsobject
items[].​promotions[].​limits.​per_userobject
items[].​promotions[].​limits.​per_user.​availableinteger
items[].​promotions[].​limits.​per_user.​totalinteger
items[].​limitsobject or null

アイテム制限。

items[].​limits.​per_userobject or null

ユーザーのアイテム制限。

items[].​limits.​per_user.​totalinteger

1ユーザーあたりのユーザーが購入できるアイテムの最大数。

例: 5
items[].​limits.​per_user.​availableinteger

現在のユーザーが購入できるアイテムの残り数。

例: 3
items[].​limits.​per_user.​recurrent_schedule(object or null)
One of:

ユーザーのアイテム制限の定期更新期間。

object or null
items[].​limits.​per_user.​limit_exceeded_visibilitystring

購入制限に達してから次回の制限リセットまでの間、カタログ内でのアイテムの表示・非表示を決定します。

これは、recurrent_schedule配列で定期的な制限リセットが設定されているアイテムに適用されます。

購入制限のリセットが設定されていない場合、購入制限に達した後は、limit_exceeded_visibilityの値に関わらず、そのアイテムはカタログに表示されなくなります。

指定可能な値:

  • show — 購入制限に達した後も、カタログ取得用のAPIコールに対してアイテム情報が返却されます。クライアントサイドのカタログ取得APIコールにおいては、制限に達した時点でアイテムにcan_be_bought: falseフラグが付与されて返されます。次回のリセット日時はreset_next_dateに格納されて返却されます。
  • hide — 購入制限に達した時点から、制限値がリセットされるまでの間、カタログ取得用のAPIコールにおいてアイテムは返されなくなります。
列挙型"show""hide"
items[].​limits.​per_itemobject or null

アイテムのアイテム制限。

items[].​limits.​per_item.​totalinteger

すべてのユーザーが購入できるアイテムの最大数。

例: 5
items[].​limits.​per_item.​availableinteger

すべてのユーザーが購入できるアイテムの残り数。

例: 3
items[].​periodsArray of objects

アイテム販売期間。

items[].​periods[].​date_fromstring or null(date-time)

指定されたアイテムの販売開始日。

例: "2020-08-11T10:00:00+03:00"
items[].​periods[].​date_untilstring or null(date-time)

指定されたアイテムが販売できなくなる日付。nullを指定することもできます。

例: "2020-08-11T20:00:00+03:00"
items[].​custom_attributesobject(json)

アイテムの属性と値を含むJSONオブジェクト。

items[].​vp_rewardsArray of objects

バリューポイントアイテム報酬。

items[].​vp_rewards[].​item_idinteger

内部の一意のアイテムID。

items[].​vp_rewards[].​skustring

一意のバリューポイントID。

items[].​vp_rewards[].​amountinteger

バリューポイントの量。

items[].​vp_rewards[].​namestring

バリューポイント名。

items[].​vp_rewards[].​image_urlstring

画像URL。

items[].​vp_rewards[].​is_clanboolean

バリューポイントがクランリワードチェーンで使用されるかどうか。

レスポンス
application/json
{ "has_more": false, "items": [ {}, {} ] }
操作

概要

Game keys are single-use unique alphanumeric codes that grant users access to a game or DLC on gaming platforms. You can sell game keys via a direct link, through the store UI, or via a widget. You can also configure regional restrictions to sell game keys in specific countries. For detailed information, refer to the Game keys packages section.

User authentication is not required to sell game keys — the keys are sent to the email the user specified at checkout. You can configure authentication to enable additional scenarios: personalization, purchase limits, or an entitlement system. For detailed information, refer to the How to set up authentication when selling game keys section.

Game key sales flow:

  1. Create a game using the Create game API call.
  2. Configure regional restrictions.
  3. Upload keys to a game key package using the Upload codes API call to make them available for purchase.
  4. Display the game catalog with prices for the user's region using the Get games list API call.
  5. Create an order. For a fast purchase, you can use the Create order with all items from current cart API call, passing the game key SKU. The response returns a token for opening the payment UI.
  6. Implement the opening of the payment UI to pay for the order.

To receive timely notifications about successful payments and deliver items to the user, set up order status tracking, for example, using webhooks. The keys are sent to the email the user specified at checkout, and the order moves to the done status.

Game keys

操作
操作
操作

概要

Bundles are sets of items sold as a single unit. A bundle can include virtual items, virtual currency, virtual currency packages, game keys, and other bundles. Use bundles to create starter packs, seasonal offers, and special deals.

Use the following API call groups to work with bundles:

  • Use API calls from the Admin subsection to create, update, delete bundles, and manage their visibility.
  • Use API calls from the Catalog subsection to retrieve bundles.

Purchase limits are configured via the limits object when creating or updating a bundle. For more information, refer to the Limits overview. You can also configure regional restrictions to sell items in specific countries.

Note

For detailed information on configuring bundles, refer to the Bundles section.

Bundle management scenario:

  1. Create a bundle using the Create bundle API call. To verify the created bundle, use the Get bundle API call. To retrieve all bundles in the project, use the Get list of bundles API call.
  2. If needed, use the Update bundle API call to modify the bundle content or settings.
  3. Implement bundle display logic in your storefront using the Get list of bundles, Get specified bundle, or Get list of bundles by specified group API call.
  4. Create an order using the Cart and payment section. For example, for a fast purchase you can use the Create order with specified item API call, passing the bundle SKU. The response contains a token for opening the payment UI.
  5. Implement opening the payment UI to pay for the order.
  6. Set up order status tracking, for example using webhooks, to promptly receive data on successfully paid items and grant them to the user.

Bundle management scenario

操作
操作

概要

The cart is a purchasing mechanism that enables combining multiple items into a single order. A user can buy items of any type in any quantity for real currency, as well as use promo codes.

The cart is stored on the Xsolla side. Saving the cart across sessions depends on whether the user is authorized:

  • For authorized users, the cart is linked to a specific user and is saved across sessions as long as requests are sent on behalf of the same user.

  • For unauthorized users, saving the cart depends on passing the x-unauthorized-id header. To save the cart of an unauthorized user across sessions, pass the same x-unauthorized-id in every request. This option is available only for game key sales.

You can identify the cart in two ways: automatically by user's JWT or by cart ID (cart_id).

Cart management is available both on the client side and on the server side.

On the server side, you can fill the cart with items, e.g., when restoring a user session. The following actions are available on the client side:

  • retrieve the current user's cart or a cart by ID
  • fill the cart
  • update items in the cart
  • delete items from the cart

To purchase items from the cart, the client and server calls for order creation are used.

The cart’s time to live (TTL) is 72 hours by default. If its content changes, e.g., when a new item is added, the TTL is extended.

After successful payment, the cart isn’t cleared automatically. To clear the cart, use the following client-side API calls:

Cart usage scenario:

  1. Implement a store UI where the user will select items.

  2. When the user selects items in the store, add them to the cart, e.g., using the Fill cart with items call. In the items array, you need to pass the SKUs and the required quantity of items.

  3. Implement the cart viewing UI. When the user navigates to the cart, display its contents using the Get current user's cart call. The response will return information about the final price of the items, including discounts and applied promotions.

  4. Implement the opening of the payment UI to pay for the order. For example, you can use the Create order with all items from particular cart call. The response returns a token to open the payment UI.

  5. Configure order status tracking, e.g., using webhooks, to promptly receive data about successfully paid items and grant them to the user.

Note

To implement selling items in-game and online, refer to the integration guide.

Cart and payment flow

注文のライフサイクル

注文のライフサイクルを理解することは、注文の追跡や、アイテムの付与といった購入後ロジックの正確な実装に役立ちます。

注文は以下のステータスを遷移します:

ステータス説明備考
new注文が作成されました。システムは支払い完了の確認を待っています。トランザクションステータスの説明は、ペイステーションAPIに関するドキュメントで確認できます。
paid注文の支払いが完了し(トランザクションがdoneステータスに移行)、ユーザーにアイテムを付与できる状態です支払いが確認されるまで、注文はnewステータスのままとなります。
doneアイテムがユーザーに付与されました。
canceled支払いが返金されました。トランザクションステータスrefundedに変更されると、注文はこのステータスに移行します。
expired制限 付きアイテム、プロモーションコード、またはプロモーションに対して新しい注文を作成すると、そのアイテムを含む過去の未払いの注文はすべてexpiredステータスに移行します。支払いが可能なのは最新の注文のみです。ユーザーが有効期限切れの注文に対して支払いを試みた場合、支払いUIに 2002 エラーが表示され、決済は失敗します。

注文のライフサイクル

注意

ユーザーが支払いを完了する間に注文がexpiredステータスに移行した場合でも、決済自体が成功したときは、注文はexpiredからpaidステータスに移行します。ただし、これが適用されるのは、決済時にその注文アイテムの購入制限数を超えない場合に限られます。

カート(クライアント側)

このセクションのコールを使用して、クライアント側でカートを管理します。

操作

カート(サーバー側)

このセクションのコールを使用して、サーバー側でカートを管理します。

操作

決済(クライアント側)

このセクションのコールを使用して、クライアント側で決済トークンを作成します。

操作

決済(サーバー側)

このセクションのコールを使用して、サーバー側で決済トークンを作成します。

操作

注文

このセクションのコールを使用して、注文に関する情報を取得します。

操作

無料アイテム

ユーザーに無料アイテムを付与するには、このセクションのコールを使用してください。

操作

概要

購入制限を使用すると、単一のユーザーまたはすべてのユーザーが購入できるアイテム数量を制限できます。スケジュールされた制限リセットを設定することもできます。

制限はエクソーラ側に保存され、パブリッシャーアカウントで個々のアイテムレベルで設定されるか、以下のAPIコールのlimitsオブジェクトを介して設定されます:

制限情報は、アイテムカタログを取得するための以下のAPIコールでitems.limitsオブジェクトに返されます:

制限グループの管理サブセクションに属するAPIコールにより、制限の現在状態の取得、および指定したユーザーに対する制限値の更新が可能となります(例:クエスト完了時におけるカウンターのリセット、残存数量の手動調整など)。

注意

カタログでの制限設定の詳細については、アイテム購入制限セクションを参照してください。
操作
操作
操作

マーチャント

操作

カタログ

このAPIは販売可能なアイテムや特定のアイテムを取得することができます。

操作
操作
操作
操作
操作