コンテンツへスキップ

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

請求再試行の詳細。

chargeobject

請求の詳細。

descriptionobject

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

expirationobject

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

external_idstring

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

grace_periodobject

猶予期間の詳細。

group_idstring

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

nameobject

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

refund_periodinteger or null

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

statusobject
tagsArray of strings

プランのタグ。

trialobject

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

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

操作