跳转到内容

概览

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

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

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

List plans by product (no auth)

请求

路径
project_idinteger\d+必需
productIdstring必需
查询
plan_idArray of integers
plan_external_idArray of strings
limitinteger
offsetinteger
localestring
countrystring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/subscriptions/api/public/v1/projects/{project_id}/products/{productId}/user_plans?plan_id=0&plan_external_id=string&limit=0&offset=0&locale=string&country=string'

响应

Subscription's plans by product

正文application/json
has_moreboolean必需
示例: "false"
itemsArray of objects
默认值 []
items[].​chargeobject必需
items[].​charge.​amountnumber(float)必需
示例: 4.99
items[].​charge.​currencystring必需
示例: "USD"
items[].​charge.​setup_feenumber(float)必需
示例: 0.99
items[].​periodobject必需
items[].​period.​unitstring or null
默认值 null
示例: "month"
items[].​period.​valueinteger or null
默认值 null
示例: "1"
items[].​plan_descriptionstring必需
示例: "Localized plan description"
items[].​plan_end_datestring or null(date-time)
示例: "2031-04-11T13:51:02+03:00"
items[].​plan_external_idstring必需
示例: "PlanExternalId"
items[].​plan_group_idstring or null
示例: "TestGroupId"
items[].​plan_idinteger必需
示例: "54321"
items[].​plan_namestring必需
示例: "Localized plan name"
items[].​plan_start_datestring or null(date-time)
示例: "2021-04-11T13:51:02+03:00"
items[].​plan_typestring必需
示例: "all"
items[].​promotionobject必需
items[].​promotion.​promotion_charge_amountnumber or null(float)
默认值 null
示例: "3.99"
items[].​promotion.​promotion_remaining_chargesinteger or null
默认值 null
示例: "3"
items[].​trial_periodinteger or null
示例: "7"
响应
application/json
{ "has_more": "false", "items": [] }

请求

路径
project_idinteger\d+必需
查询
plan_idArray of integers
plan_external_idArray of strings
limitinteger
offsetinteger
localestring
countrystring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/subscriptions/api/public/v1/projects/{project_id}/user_plans?plan_id=0&plan_external_id=string&limit=0&offset=0&locale=string&country=string'

响应

Subscription's default plans

正文application/json
has_moreboolean必需
示例: "false"
itemsArray of objects
默认值 []
items[].​chargeobject必需
items[].​charge.​amountnumber(float)必需
示例: 4.99
items[].​charge.​currencystring必需
示例: "USD"
items[].​charge.​setup_feenumber(float)必需
示例: 0.99
items[].​periodobject必需
items[].​period.​unitstring or null
默认值 null
示例: "month"
items[].​period.​valueinteger or null
默认值 null
示例: "1"
items[].​plan_descriptionstring必需
示例: "Localized plan description"
items[].​plan_end_datestring or null(date-time)
示例: "2031-04-11T13:51:02+03:00"
items[].​plan_external_idstring必需
示例: "PlanExternalId"
items[].​plan_group_idstring or null
示例: "TestGroupId"
items[].​plan_idinteger必需
示例: "54321"
items[].​plan_namestring必需
示例: "Localized plan name"
items[].​plan_start_datestring or null(date-time)
示例: "2021-04-11T13:51:02+03:00"
items[].​plan_typestring必需
示例: "all"
items[].​promotionobject必需
items[].​promotion.​promotion_charge_amountnumber or null(float)
默认值 null
示例: "3.99"
items[].​promotion.​promotion_remaining_chargesinteger or null
默认值 null
示例: "3"
items[].​trial_periodinteger or null
示例: "7"
响应
application/json
{ "has_more": "false", "items": [] }

请求

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

响应

Subscription's catalog

正文application/json
default_plansobject必需
default_plans.​has_moreboolean必需
示例: "false"
default_plans.​itemsArray of objects
默认值 []
default_plans.​items[].​chargeobject必需
default_plans.​items[].​charge.​amountnumber(float)必需
示例: 4.99
default_plans.​items[].​charge.​currencystring必需
示例: "USD"
default_plans.​items[].​charge.​setup_feenumber(float)必需
示例: 0.99
default_plans.​items[].​periodobject必需
default_plans.​items[].​period.​unitstring or null
默认值 null
示例: "month"
default_plans.​items[].​period.​valueinteger or null
默认值 null
示例: "1"
default_plans.​items[].​plan_descriptionstring必需
示例: "Localized plan description"
default_plans.​items[].​plan_end_datestring or null(date-time)
示例: "2031-04-11T13:51:02+03:00"
default_plans.​items[].​plan_external_idstring必需
示例: "PlanExternalId"
default_plans.​items[].​plan_group_idstring or null
示例: "TestGroupId"
default_plans.​items[].​plan_idinteger必需
示例: "54321"
default_plans.​items[].​plan_namestring必需
示例: "Localized plan name"
default_plans.​items[].​plan_start_datestring or null(date-time)
示例: "2021-04-11T13:51:02+03:00"
default_plans.​items[].​plan_typestring必需
示例: "all"
default_plans.​items[].​promotionobject必需
default_plans.​items[].​promotion.​promotion_charge_amountnumber or null(float)
默认值 null
示例: "3.99"
default_plans.​items[].​promotion.​promotion_remaining_chargesinteger or null
默认值 null
示例: "3"
default_plans.​items[].​trial_periodinteger or null
示例: "7"
default_plans.​namestring or null
示例: "Some product name"
has_moreboolean必需
示例: "false"
plans_by_productArray of objects
默认值 []
plans_by_product[].​has_moreboolean必需
示例: "false"
plans_by_product[].​itemsArray of objects
默认值 []
plans_by_product[].​items[].​chargeobject必需
plans_by_product[].​items[].​charge.​amountnumber(float)必需
示例: 4.99
plans_by_product[].​items[].​charge.​currencystring必需
示例: "USD"
plans_by_product[].​items[].​charge.​setup_feenumber(float)必需
示例: 0.99
plans_by_product[].​items[].​periodobject必需
plans_by_product[].​items[].​period.​unitstring or null
默认值 null
示例: "month"
plans_by_product[].​items[].​period.​valueinteger or null
默认值 null
示例: "1"
plans_by_product[].​items[].​plan_descriptionstring必需
示例: "Localized plan description"
plans_by_product[].​items[].​plan_end_datestring or null(date-time)
示例: "2031-04-11T13:51:02+03:00"
plans_by_product[].​items[].​plan_external_idstring必需
示例: "PlanExternalId"
plans_by_product[].​items[].​plan_group_idstring or null
示例: "TestGroupId"
plans_by_product[].​items[].​plan_idinteger必需
示例: "54321"
plans_by_product[].​items[].​plan_namestring必需
示例: "Localized plan name"
plans_by_product[].​items[].​plan_start_datestring or null(date-time)
示例: "2021-04-11T13:51:02+03:00"
plans_by_product[].​items[].​plan_typestring必需
示例: "all"
plans_by_product[].​items[].​promotionobject必需
plans_by_product[].​items[].​promotion.​promotion_charge_amountnumber or null(float)
默认值 null
示例: "3.99"
plans_by_product[].​items[].​promotion.​promotion_remaining_chargesinteger or null
默认值 null
示例: "3"
plans_by_product[].​items[].​trial_periodinteger or null
示例: "7"
plans_by_product[].​namestring or null
示例: "Some product name"
响应
application/json
{ "default_plans": { "has_more": "false", "items": [], "name": "Some product name" }, "has_more": "false", "plans_by_product": [] }
操作
操作
操作