コンテンツへスキップ

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

操作
操作

プロモーション

操作
操作

Subscription management

操作

リクエスト

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

レスポンス

Get subscription info

ボディapplication/json
chargeobject(Charge)必須
charge.​amountnumber(float)必須
例: "4.99"
charge.​amount_with_promotionnumber or null(float)
デフォルト null
例: "3.99"
charge.​currencystring必須
例: "USD"
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"
last_successful_charge(LastSuccessfulCharge (object or null))
(LastSuccessfulCharge (object or null))
payment_account(PaymentRecurrentAccountResponse2 (object or null))
(PaymentRecurrentAccountResponse2 (object or null))
periodobject(Period)必須
period.​unitstring or null
デフォルト null
例: "month"
period.​valueinteger or null
デフォルト null
例: "1"
plan_descriptionstring必須
例: "Localized plan description"
plan_namestring必須
例: "Localized plan name"
product_descriptionstring or null
例: "Localized product description"
product_namestring or null
例: "Product name"
statusstring必須
例: "active"
trial_periodinteger or null
例: "0"
レスポンス
application/json
{ "charge": { "amount": "4.99", "amount_with_promotion": "3.99", "currency": "USD" }, "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", "last_successful_charge": { "amount": "3.99", "currency": "USD", "date": "2031-04-11T13:51:02+03:00" }, "payment_account": { "card_expiry_date": {}, "id": "123", "name": "** 7398", "ps_name": "Mastercard", "switch_icon_name": "mastercard.svg", "type": "card" }, "period": { "unit": "month", "value": "1" }, "plan_description": "Localized plan description", "plan_name": "Localized plan name", "product_description": "Localized product description", "product_name": "Product name", "status": "active", "trial_period": "0" }

Activate subscription

リクエスト

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

レスポンス

Move subscription from non-renew to active

ボディapplication/json
レスポンス
application/json
{ "status": "successful" }

Cancel subscription

リクエスト

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

レスポンス

Make subscription non-renewable

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