跳转到内容

概览

  • Version: 2.0
  • 服务器https://api.xsolla.com/merchant/v2/

本API参考介绍管理订阅、优惠券和促销活动的端点。 如需了解关于订阅的详细信息,请参考产品指南词汇表

下载 OpenAPI 描述
语言
服务器
Mock server
https://xsolla.redocly.app/_mock/zh/api/subscriptions/
操作
操作
操作
操作
操作
操作
操作
操作

请求

安全
subscriptionsManagementJwtAuth
路径
subscription_idinteger\d+必需
project_idinteger\d+必需
查询
limitinteger
offsetinteger
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/subscriptions/api/user/v1/management/projects/{project_id}/subscriptions/{subscription_id}/plans_for_change?limit=0&offset=0&locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

响应

List of available plans for change

正文application/json
has_moreboolean必需
示例: "false"
itemsArray of objects(PlanResponse)
默认值 []
响应
application/json
{ "has_more": "false", "items": [] }

请求

安全
subscriptionsManagementJwtAuth
路径
subscription_idinteger\d+必需
plan_idinteger\d+必需
project_idinteger\d+必需
查询
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/subscriptions/api/user/v1/management/projects/{project_id}/subscriptions/{subscription_id}/plans_for_change/{plan_id}?locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

响应

Available plans for change with payment details

正文application/json
chargeobject(Charge2)必需
charge.​amountnumber(float)必需
示例: "4.99"
charge.​currencystring必需
示例: "USD"
charge.​setup_feenumber or null(float)
示例: "0.99"
payment_detailsobject(PaymentDetails)必需
payment_details.​surcharge(Surcharge (object or null))
默认值 null
(Surcharge (object or null))
默认值 null
payment_details.​unused(Unused (object or null))
默认值 null
(Unused (object or null))
默认值 null
periodobject(Period2)必需
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_group_idstring or null
示例: "TestGroupId"
plan_idinteger必需
示例: "54321"
plan_namestring必需
示例: "Localized plan name"
plan_start_datestring or null(date-time)
示例: "2021-04-11T13:51:02+03:00"
plan_typestring必需
示例: "all"
promotionobject(Promotion)必需
promotion.​promotion_charge_amountnumber or null(float)
默认值 null
示例: "3.99"
promotion.​promotion_remaining_chargesinteger or null
默认值 null
示例: "3"
trial_periodinteger or null
示例: "7"
响应
application/json
{ "charge": { "amount": "4.99", "currency": "USD", "setup_fee": "0.99" }, "payment_details": { "surcharge": null, "unused": null }, "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_group_id": "TestGroupId", "plan_id": "54321", "plan_name": "Localized plan name", "plan_start_date": "2021-04-11T13:51:02+03:00", "plan_type": "all", "promotion": { "promotion_charge_amount": "3.99", "promotion_remaining_charges": "3" }, "trial_period": "7" }