コンテンツへスキップ

Shop Builder API (2.0.0)

Overview

  • Version: 2.0.0
  • Servers: https://store.xsolla.com/api
  • Contact Us by Email
  • Contact URL: https://xsolla.com/
  • Required TLS version: 1.2

Shop Builder API provides a third-party solution for implementing the server side for your store interface. Use the endpoints to manage in-game items, in-game currencies, cart, player inventory, promotions, game library, etc.

OpenAPI記述をダウンロード
言語
サーバー
Mock server
https://xsolla.redocly.app/_mock/ja/api/shop-builder/
https://store.xsolla.com/api/
操作

個人用カタログ

ユーザー属性に応じたルールを指定することができるAPIです。 ユーザーが具体的なルールの条件をすべて満たした場合、パーソナライズされたアイテムが表示されます。

パーソナライズされたプロモーションについては、プロモーションセクションを参照してください。

購入前に属性を渡すには、Xsolla Login APIを使うか、Pay Station APIを使ってトークンを生成する際にそれをuser.attributesプロパティに渡します。

操作
操作
操作

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

操作

カート(サーバー側)

操作

決済(クライアント側)

操作

決済(サーバー側)

操作
操作

無料アイテム

操作

ウェブフック

操作
操作

マーチャント

操作

カタログ

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

操作
操作
操作
操作
操作
操作

クーポン

このAPIを使用すると、クーポンを管理できます。

操作

クーポン特典を入手Client-side

リクエスト

このコードによりクーポン特典を入手します。 ユーザーが多くのアイテムの中から1つをボーナスとして選択できるようにするために使用することができます。 通常のケースでは、クーポンにボーナスとしてゲームが含まれている場合、DRMを選択します(type=unit)。

セキュリティ
XsollaLoginUserJWT
パス
project_idinteger必須

プロジェクトID。このパラメータは、パブリッシャーアカウントのプロジェクト名の横にあります。

例: 44056
coupon_codestring[ 1 .. 128 ] characters必須

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

例: WINTER2021
curl -i -X GET \
  https://xsolla.redocly.app/_mock/ja/api/shop-builder/v2/project/44056/coupon/code/WINTER2021/rewards \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

レスポンス

クーポンリワードのリストは正常に受信されました。

ボディapplication/json
bonusArray of objects(Promotions_200-coupon-bonus-reward)
discountobject or null(Promotions_200-coupon-discount-reward)

割引率。 カートの価格は、この割引率で計算された値で減少し、小数点以下2桁に四捨五入されます。

is_selectableboolean

trueの場合、ユーザーはクーポンを引き換える前にボーナスを選択する必要があります。

レスポンス
application/json
{ "bonus": [ {}, {} ], "discount": { "percent": "10.00" }, "is_selectable": true }

クポーンコードを引き換えるClient-side

リクエスト

クーポンコードを引き換えます。クーポンが引き換えられた後、ユーザーはボーナスを得ることができます。

セキュリティ
XsollaLoginUserJWT
パス
project_idinteger必須

プロジェクトID。このパラメータは、パブリッシャーアカウントのプロジェクト名の横にあります。

例: 44056
ボディapplication/json
coupon_codestring[ 1 .. 128 ] characters

一意のコードです。文字と数字が含まれます。

デフォルト "WINTER2021"
例: "WINTER2021"
selected_unit_itemsobject(Promotions_selected_unit_items)

ユーザーが選択したリワード。 オブジェクトのキーはユニットのSKUで、値はユニット内の1つのアイテムのSKUです。

例: {"game_1":"game_1_steam","game_2":"game_2_playstation"}
curl -i -X POST \
  https://xsolla.redocly.app/_mock/ja/api/shop-builder/v2/project/44056/coupon/redeem \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "coupon_code": "WINTER2021",
    "selected_unit_items": {
      "game_1": "game_1_steam",
      "game_2": "game_2_playstation"
    }
  }'

レスポンス

クーポンは正常に引き換えされました。

ボディapplication/json
itemsArray of objects
例: [{"attributes":[],"description":"Take it, take it all! All of Xsolla's riches in one Mega Booster.","groups":[{"external_id":"powerups","name":"Power Ups"}],"image_url":"https://cdn.xsolla.net/img/misc/images/e9f2f4a634bc96ea03b5d5ceadd7c55f.png","is_free":false,"name":"Xsolla Booster Mega","price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"quantity":1,"sku":"com.xsolla.booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[]}]
レスポンス
application/json
{ "items": [ {} ] }

クーポンプロモーションのリストを取得Server-sideAdmin

リクエスト

プロジェクトのクーポンプロモーションのリストを取得します。

セキュリティ
basicAuth
パス
project_idinteger必須

プロジェクトID。このパラメータは、パブリッシャーアカウントのプロジェクト名の横にあります。

例: 44056
クエリ
limitinteger>= 1

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

例: limit=50
offsetinteger>= 0

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

例: offset=0
curl -i -X GET \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ja/api/shop-builder/v3/project/44056/admin/coupon?limit=50&offset=0'

レスポンス

クーポンのリストは正常に受信されました。

ボディapplication/json
active_promotions_countinteger(active_promotions_count)

アクティブなプロモーションの数。

inactive_promotions_countinteger(inactive_promotions_count)

非アクティブ化されたプロモーションの数。

itemsArray of objects(admin-promotions_200-get-coupon-promotion-model)
total_promotions_countinteger(total_promotions_count)

プロモーションの合計数。

レスポンス
application/json
{ "active_promotions_count": 2, "inactive_promotions_count": 0, "items": [ {}, {} ], "total_promotions_count": 2 }

プロモーションコード

このAPI を使用すると、プロモーションコードを管理できます。

操作

ユニークなカタログオファー

このAPIを使用すると、ユニークなカタログオファーを管理することができます。

操作

ディスカウント

このAPIを使用すると、割引キャンペーンを管理することができます。

操作

ボーナス

このAPIを使用すると、ボーナスプロモーションを管理できます。

操作
操作
操作
操作
操作
操作

クライアント

操作

クランクライアント

操作
操作

クライアント

操作
操作

クライアント

操作
操作

クライアント

操作
操作