Shop Builder 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
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プロパティに渡します。
操作
- Mock serverhttps://xsolla.redocly.app/_mock/ja/api/shop-builder/v2/project/{project_id}/coupon/redeem
- https://store.xsolla.com/api/v2/project/{project_id}/coupon/redeem
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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"
}
}'クーポンは正常に引き換えされました。
例: [{"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": [ { … } ] }
- Mock serverhttps://xsolla.redocly.app/_mock/ja/api/shop-builder/v3/project/{project_id}/admin/coupon
- https://store.xsolla.com/api/v3/project/{project_id}/admin/coupon
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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_count": 2, "inactive_promotions_count": 0, "items": [ { … }, { … } ], "total_promotions_count": 2 }
ボディapplication/json
attribute_conditionsArray of type = string (object) or type = number (object) or type = date (object)(promotion_user-attribute_conditions_model-post)[ 1 .. 100 ] items
ユーザー属性を検証するための条件。 ユーザー属性が指定されたすべての条件に一致するかどうかに基づいて、プロモーションの可用性を決定します。
一意のプロモーションID。external_idには、小文字と大文字のラテン英数字、ピリオド、ダッシュ、およびアンダースコアのみが含まれます。
デフォルト "coupon_external_id"
例: "coupon_external_id"
プロモーションの名前。キーと値のペアを含む必要があります。 キーは"^[a-z]{2}-[A-Z]{2}$"形式のロケール、値は文字列です。
デフォルト {"de-DE":"Gutscheintitel","en-US":"Coupon title"}
例: {"de-DE":"Gutscheintitel","en-US":"Coupon title"}
プロモーションの有効期間。複数の期間を指定する場合は、date_fromとdate_untilの両方が必須となります。
クーポンの総数を制限します。
デフォルト 10
例: 10
- Mock serverhttps://xsolla.redocly.app/_mock/ja/api/shop-builder/v3/project/{project_id}/admin/coupon
- https://store.xsolla.com/api/v3/project/{project_id}/admin/coupon
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://xsolla.redocly.app/_mock/ja/api/shop-builder/v3/project/44056/admin/coupon \
-H 'Content-Type: application/json' \
-d '{
"attribute_conditions": [
{
"attribute": "account_status",
"can_be_missing": false,
"operator": "eq",
"type": "string",
"value": "golden"
}
],
"bonus": [
{
"quantity": 1,
"sku": "com.xsolla.elven_sword_2"
}
],
"external_id": "coupon_external_id",
"name": {
"de-DE": "Neujahrsbonus",
"en-US": "New Year Bonus"
},
"promotion_periods": [
{
"date_from": "2020-04-15T18:16:00+05:00",
"date_until": "2020-04-25T18:16:00+05:00"
}
],
"redeem_code_limit": 1,
"redeem_total_limit": 100,
"redeem_user_limit": 1
}'レスポンス
application/json
{ "external_id": "coupon_external_id" }