コンテンツへスキップ

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/
操作
操作

プランの無効化

リクエスト

サブスクリプションプランを無効化します。

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

プロジェクトID。

plan_idinteger必須

プランID。

curl -i -X DELETE \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ja/api/subscriptions/projects/{project_id}/subscriptions/plans/{plan_id}'

レスポンス

No Content (コンテンツなし) 。

プランの有効化

リクエスト

サブスクリプションプランを有効化します。

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

プロジェクトID。

plan_idinteger必須

プランID。

curl -i -X PATCH \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ja/api/subscriptions/projects/{project_id}/subscriptions/plans/{plan_id}'

レスポンス

No Content (コンテンツなし) 。

更新のプラン

リクエスト

サブスクリプションプランパラメータを更新します。

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

プロジェクトID。

plan_idinteger必須

プランID。

ボディapplication/json必須
billing_retryobject

請求再試行の詳細。

billing_retry.​valueinteger必須

請求の再試行回数。

chargeobject

請求の詳細。

charge.​amountnumber(float)

請求額。

charge.​currencystring

購入通貨。ISO 4217に準拠した3文字の通貨コード。

charge.​periodobject必須

請求期間。

charge.​period.​typestring必須

時間の単位。daymonthまたはlifetimeにすることができます。

列挙型"day""month""lifetime"
charge.​period.​valueinteger必須

時間単位の数。値はタイプパラメータに依存し、次のようになります:
-typedayの場合 、1から366まで
-typemonthの場合、1から12まで、
-typelifetimeの場合、0です

charge.​pricesArray of objects

異なる通貨での価格を一覧表示します。

charge.​prices[].​amountnumber(float)必須

請求額。

charge.​prices[].​currencystring必須

購入通貨。ISO 4217に準拠した3文字の通貨コード。

charge.​prices[].​setup_feenumber(float)

最初の請求書の一部として請求される1回のセットアップ費用。

descriptionobject

プランの説明文。"localization":"plan description"のペアで構成されます。

description.​arstring

アラビア語。

description.​bgstring

ブルガリア語。

description.​cnstring

中国語(簡体字)。

description.​csstring

チェコ語。

description.​destring

ドイツ語。

description.​enstring

英語。

description.​esstring

スペイン語。

description.​frstring

フランス語。

description.​hestring

ヘブライ語。

description.​itstring

イタリア語。

description.​jastring

日本語。

description.​kostring

韓国語。

description.​plstring

ポーランド語。

description.​ptstring

ポルトガル語。

description.​rostring

ルーマニア語。

description.​rustring

ロシア語。

description.​thstring

タイ語。

description.​trstring

トルコ語。

description.​twstring

中国語(繁体字)。

description.​vistring

ベトナム語。

expirationobject

サブスクリプションの有効期限の詳細。

expiration.​typestring必須

時間の単位。dayまたはmonthにすることができます。

列挙型"day""month"
expiration.​valueinteger or null必須

有効期間。

external_idstring

プラン外部ID(32文字)。

grace_periodobject

猶予期間の詳細。

grace_period.​typestring必須

時間の単位。dayにすることができます。

"day"
grace_period.​valueinteger必須

時間単位の数。

group_idstring

プランがリンクされているグループID。

nameobject

プラン名。"localization":"plan name"のペアで構成されます。

name.​arstring

アラビア語。

name.​bgstring

ブルガリア語。

name.​cnstring

中国語(簡体字)。

name.​csstring

チェコ語。

name.​destring

ドイツ語。

name.​enstring

英語。

name.​esstring

スペイン語。

name.​frstring

フランス語。

name.​hestring

ヘブライ語。

name.​itstring

イタリア語。

name.​jastring

日本語。

name.​kostring

韓国語。

name.​plstring

ポーランド語。

name.​ptstring

ポルトガル語。

name.​rostring

ルーマニア語。

name.​rustring

ロシア語。

name.​thstring

タイ語。

name.​trstring

トルコ語。

name.​twstring

中国語(繁体字)。

name.​vistring

ベトナム語。

refund_periodinteger or null

ユーザーがサブスクリプションプランの支払いを返金できる期間(日単位)。

statusobject
status.​valuestring

サブスクリプションプランのステータス

列挙型"active""disabled"
tagsArray of strings

プランのタグ。

trialobject

試用期間の詳細。このパラメータが渡されない場合、デフォルト値(0日)が使用されます。

trial.​typestring必須

時間の単位。dayにすることができます。

"day"
trial.​valueinteger必須

時間単位の数。

curl -i -X PUT \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ja/api/subscriptions/projects/{project_id}/subscriptions/plans/{plan_id}' \
  -H 'Content-Type: application/json' \
  -d '{
    "billing_retry": {
      "value": 1
    },
    "charge": {
      "amount": 20,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      },
      "prices": [
        {
          "amount": 17,
          "currency": "EUR",
          "setup_fee": 1.5
        },
        {
          "amount": 2000,
          "currency": "JPY",
          "setup_fee": 2.5
        }
      ]
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": null
    },
    "external_id": "exp",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "name": {
      "en": "Experience boost"
    },
    "refund_period": null,
    "tags": [],
    "trial": {
      "type": "day",
      "value": 7
    }
  }'

レスポンス

OK。

ボディapplication/json
レスポンス
application/json
{ "billing_retry": { "value": 1 }, "charge": { "amount": 20, "currency": "USD", "period": {}, "prices": [] }, "description": { "en": "3x more experience!" }, "expiration": { "type": "day", "value": 0 }, "external_id": "exp", "grace_period": { "type": "day", "value": 2 }, "group_id": null, "id": 241082, "localized_name": "Experience boost", "name": { "en": "Experience boost" }, "project_id": 40797, "refund_period": null, "status": { "value": "active" }, "tags": [], "trial": { "type": "day", "value": 7 }, "type": "all" }
操作

Subscription management

操作
操作

プロモーション

操作
操作

Subscription management

操作