コンテンツへスキップ

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を使用すると、クーポンを管理できます。

操作

プロモーションコード

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

操作

プロモーションコードを引き換えるClient-side

リクエスト

プロモーションコードを引き換えます。 プロモーションコードを引き換えた後、ユーザーは無料でアイテムを入手したり、カートや特定のアイテムの価格を下げたりすることができます。

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

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

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

プロモーションコードの一意のコード。文字と数字が含まれています。

デフォルト "SUMMER2021"
例: "SUMMER2021"
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/promocode/redeem \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "cart": {
      "id": "current"
    },
    "coupon_code": "SUMMER2021",
    "selected_unit_items": {
      "game_1": "game_1_steam",
      "game_2": "game_2_playstation"
    }
  }'

レスポンス

プロモーションコードは正常に引き換えされました。

ボディapplication/json
cart_idstring

カートID。

例: "cart_id"
is_freeboolean(value-is_free)

trueの場合で、アイテムは無料です。

デフォルト false
例: false
itemsArray of objects
例: [{"attributes":[],"can_be_bought":{"$ref":"../schemas/Can_be_bought.yaml"},"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,"limits":{"$ref":"../schemas/Catalog_item_limits.yaml"},"name":"Xsolla Booster Mega","periods":{"$ref":"../schemas/item-periods.yaml"},"price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"promotions":{"$ref":"../schemas/Catalog_item_promotions.yaml"},"quantity":123,"sku":"com.xsolla.booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[],"vp_rewards":{"$ref":"../schemas/reward-chain-client/client-item-value-point-reward.yaml"}}]
priceobject or null

カート価格。

例: {"amount":"6150.0000000000000000","amount_without_discount":"6150.0000000000000000","currency":"USD"}
rewardsobject(Promo_code_rewards)
レスポンス
application/json
{ "cart_id": "cart_id", "is_free": false, "items": [ {}, {} ], "price": { "amount": "6150.0000000000000000", "amount_without_discount": "12300.0000000000000000", "currency": "USD" }, "rewards": { "bonus": [], "discount": {}, "discounted_items": [], "is_selectable": false } }

カートからプロモーションコードを削除Client-side

リクエスト

プロモーションコードをカートから削除します。 プロモーションコードを削除した後、カート内のすべてのアイテムの合計金額は、プロモーションコードによるボーナスや割引を除いて再計算されます。

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

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

例: 44056
ボディapplication/json
cartobject or null
curl -i -X PUT \
  https://xsolla.redocly.app/_mock/ja/api/shop-builder/v2/project/44056/promocode/remove \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "cart": {
      "id": "current"
    }
  }'

レスポンス

プロモーションコードは正常にキャンセルされました。

ボディapplication/json
cart_idstring

カートID。

例: "cart_id"
is_freeboolean(value-is_free)

trueの場合で、アイテムは無料です。

デフォルト false
例: false
itemsArray of objects
例: [{"attributes":[],"can_be_bought":true,"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,"limits":{"per_user":{"available":3,"recurrent_schedule":{"interval_type":"weekly","reset_next_date":1746057600},"total":5}},"name":"Xsolla Booster Mega","periods":[{"date_from":"2020-08-11T10:00:00+03:00","date_until":"2020-08-11T20:00:00+03:00"}],"price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"promotions":[{"bonus":[{"image_url":"https://cdn.xsolla.net/img/misc/images/2fc5c491a47413a8e8000447889093c2.png","name":"Xsolla Minigun","quantity":1,"sku":"com.xsolla.minigun_1","type":"virtual_good"}],"date_end":"2026-04-15T16:16:00+03:00","date_start":"2020-04-15T16:16:00+03:00","discount":{"percent":"50.00"},"name":"Bonus promotion"}],"quantity":123,"sku":"com.xsolla.booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[],"vp_rewards":[{"amount":130,"image_url":"https://cdn3.xsolla.com/img/misc/images/54c0cf9d345817cdacfdde198db178e0.jpg","item_id":175232,"name":"Value point","sku":"com.xsolla.value_point_1"},{"amount":50,"image_url":"https://cdn3.xsolla.com/img/misc/images/54c0cf9d345817cdacfdde198db178e0.jpg","is_clan":true,"item_id":186321,"name":"Clan Reward VP 1","sku":"com.xsolla.clan_value_point_1"}]}]
priceobject or null

カート価格。

例: {"amount":"6150.0000000000000000","amount_without_discount":"6150.0000000000000000","currency":"USD"}
レスポンス
application/json
{ "cart_id": "cart_id", "is_free": false, "items": [ {} ], "price": { "amount": "6150.0000000000000000", "amount_without_discount": "6150.0000000000000000", "currency": "USD" } }

プロモーションコードのプロモーションのリストを取得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/promocode?limit=50&offset=0'

レスポンス

プロモーションコードのリストは正常に受信されました。

ボディapplication/json
active_promotions_countinteger(active_promotions_count)

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

inactive_promotions_countinteger(inactive_promotions_count)

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

itemsArray of objects(Promotions_200-get-promocode-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を使用すると、ボーナスプロモーションを管理できます。

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

クライアント

操作

クランクライアント

操作
操作

クライアント

操作
操作

クライアント

操作
操作

クライアント

操作
操作