コンテンツへスキップ

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

サブスクリプション

操作
操作

プロモーション

操作
操作

サブスクリプション

操作

リクエスト

セキュリティ
projectUserJwtAuth
パス
subscription_idinteger\d+必須
project_idinteger\d+必須
クエリ
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/ja/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/{subscription_id}?locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

レスポンス

Get subscription info

ボディapplication/json
chargeobject必須
charge.​amountnumber(float)必須
例: 4.99
charge.​currencystring必須
例: "USD"
charge.​setup_feenumber(float)必須
例: 0.99
date_createstring(date-time)必須
例: "2031-04-11T13:51:02+03:00"
date_endstring or null(date-time)
例: "2031-04-11T13:51:02+03:00"
date_last_chargestring or null(date-time)
例: "2031-04-11T13:51:02+03:00"
date_next_chargestring or null(date-time)
例: "2031-04-11T13:51:02+03:00"
idinteger必須
例: "12345"
is_change_plan_allowedboolean必須
例: "false"
is_change_to_non_renew_possibleboolean必須
例: "true"
is_in_trialboolean必須
例: "false"
is_renew_possibleboolean必須
例: "true"
periodobject必須
period.​unitstring or null
デフォルト null
例: "month"
period.​valueinteger or null
デフォルト null
例: "1"
plan_descriptionstring必須
例: "Localized plan description"
plan_end_datestring or null(date-time)
例: "2031-04-11T13:51:02+03:00"
plan_external_idstring必須
例: "PlanExternalId"
plan_idinteger必須
例: "54321"
plan_namestring必須
例: "Localized plan name"
plan_start_datestring or null(date-time)
例: "2021-04-11T13:51:02+03:00"
product_descriptionstring or null
例: "Localized product description"
product_external_idstring or null
例: "ProductExternalId"
product_idinteger or null
例: "12345"
product_namestring or null
例: "Product name"
statusstring必須
例: "active"
trial_periodinteger or null
例: "0"
レスポンス
application/json
{ "charge": { "amount": 4.99, "currency": "USD", "setup_fee": 0.99 }, "date_create": "2031-04-11T13:51:02+03:00", "date_end": "2031-04-11T13:51:02+03:00", "date_last_charge": "2031-04-11T13:51:02+03:00", "date_next_charge": "2031-04-11T13:51:02+03:00", "id": "12345", "is_change_plan_allowed": "false", "is_change_to_non_renew_possible": "true", "is_in_trial": "false", "is_renew_possible": "true", "period": { "unit": "month", "value": "1" }, "plan_description": "Localized plan description", "plan_end_date": "2031-04-11T13:51:02+03:00", "plan_external_id": "PlanExternalId", "plan_id": "54321", "plan_name": "Localized plan name", "plan_start_date": "2021-04-11T13:51:02+03:00", "product_description": "Localized product description", "product_external_id": "ProductExternalId", "product_id": "12345", "product_name": "Product name", "status": "active", "trial_period": "0" }

Cancel subscription

リクエスト

セキュリティ
projectUserJwtAuth
パス
subscription_idinteger\d+必須
project_idinteger\d+必須
curl -i -X PUT \
  'https://xsolla.redocly.app/_mock/ja/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/{subscription_id}/cancel' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

レスポンス

Make subscription non-renewable

ボディapplication/json
レスポンス
application/json
null

Renew subscription

リクエスト

セキュリティ
projectUserJwtAuth
パス
subscription_idinteger\d+必須
project_idinteger\d+必須
ボディapplication/json必須

Renew subscription

custom_parametersobject or null

You can pass additional parameters in the token

デフォルト null
settings(object or null)
(object or null)
steam_user_idstring or null
curl -i -X POST \
  'https://xsolla.redocly.app/_mock/ja/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/{subscription_id}/renew' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "custom_parameters": null,
    "settings": {
      "currency": "str",
      "external_id": "string",
      "hide_saved_payment_accounts": true,
      "locale": "st",
      "payment_method": 1,
      "redirect_policy": {
        "delay": 0,
        "redirect_button_caption": "string",
        "redirect_conditions": "none",
        "status_for_manual_redirection": "none"
      },
      "return_url": "string",
      "steam_user_id": "stringstringstrin",
      "ui": {
        "desktop": {
          "header": {
            "close_button": true,
            "is_visible": true,
            "type": "compact",
            "visible_logo": true,
            "visible_name": true
          }
        },
        "independent_windows": true,
        "license_url": "string",
        "mobile": {
          "footer": {
            "is_visible": true
          },
          "header": {
            "close_button": true
          },
          "mode": "saved_accounts"
        },
        "mode": "user_account",
        "size": "large",
        "theme": "string",
        "user_account": {
          "history": {
            "enable": true,
            "order": 1
          },
          "info": {
            "enable": true,
            "order": 1
          },
          "payment_accounts": {
            "enable": true,
            "order": 1
          },
          "subscriptions": {
            "enable": true,
            "order": 1
          }
        },
        "version": "desktop"
      },
      "xsolla_product_tag": "string"
    },
    "steam_user_id": "string"
  }'

レスポンス

Get subscription renew url

ボディapplication/json
link_to_psstring必須
例: "https://secure.xsolla.com/paystation2/?access_token=<access_token>"
レスポンス
application/json
{ "link_to_ps": "https://secure.xsolla.com/paystation2/?access_token=<access_token>" }
操作
操作

サブスクリプション

操作
操作