コンテンツへスキップ

Subscriptions API (2.0)

概要

  • Version: 2.0
  • Servers: https://api.xsolla.com/merchant/v2/

このAPIリファレンスでは、サブスクリプション、クーポン、およびプロモーションを管理するためのエンドポイントについて説明します。 サブスクリプションの詳細については、製品ガイドおよび用語集を参照してください。

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

Subscription management

操作
操作

プロモーション

操作
操作

クーポンの取得

リクエスト

クーポンの詳細をコードで入手してください。

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

プロジェクトID。

codestring必須

クーポンコード。

curl -i -X GET \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ja/api/subscriptions/projects/{project_id}/coupons/{code}/details'

レスポンス

OK。

ボディapplication/json
keystring

ユーザー属性のキー。

list_of_valuesArray of objects

type=enumの可能な値(配列)。

nameobject

ローカライズされた属性名。

skip_condition_on_nonexistent_keyboolean

キーが存在しない場合は条件をスキップするかどうかを示します。

typestring

キータイプ。

列挙型"int""string""enum""date"
visibleboolean
レスポンス
application/json
{ "key": "12", "list_of_values": [], "name": { "en": "Level", "ru": "Уровень" }, "skip_condition_on_nonexistent_key": true, "type": "int", "visible": false }

クーポンの償還

リクエスト

クーポンをコードで償還してください。

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

プロジェクトID。

codestring必須

クーポンコード。

ボディapplication/json必須
user_idstring必須

ユーザーID。

例: "1234"
curl -i -X POST \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ja/api/subscriptions/projects/{project_id}/coupons/{code}/redeem' \
  -H 'Content-Type: application/json' \
  -d '{
    "user_id": "1234"
  }'

レスポンス

OK。

ボディapplication/json
campaign_codestring
coupon_codestring
coupon_idinteger
expiration_datestring
is_activeboolean
project_idinteger
redeems_count_for_userinteger
redeems_count_remaininteger
subscription_couponstring or null
virtual_currency_amountinteger
virtual_itemsArray of strings
レスポンス
application/json
{ "campaign_code": "new_campaign", "coupon_code": "ddgf5bn4", "coupon_id": 89613996, "expiration_date": "2019-12-31T00:00:00+00:00", "is_active": true, "project_id": 12345, "redeems_count_for_user": 10, "redeems_count_remain": 20, "subscription_coupon": null, "virtual_currency_amount": 200, "virtual_items": [] }

Subscription management

操作