Skip to content

Overview

  • Version: 2.0
  • Servers: https://api.xsolla.com/merchant/v2/

This API reference describes endpoints for managing subscriptions, coupons, and promotions. To get more information about Subscriptions, see the product guide and the glossary.

Download OpenAPI description
Languages
Servers
Mock server
https://xsolla.redocly.app/_mock/api/subscriptions/
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations

Request

Security
managementJwtAuth
Path
subscription_idinteger\d+required
project_idinteger\d+required
Query
limitinteger
offsetinteger
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/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>'

Responses

List of available plans for change

Bodyapplication/json
itemsArray of objects
Default []
items[].​plan_idintegerrequired
Example: "54321"
items[].​plan_external_idstringrequired
Example: "PlanExternalId"
items[].​plan_group_idstring or null
Example: "TestGroupId"
items[].​plan_typestringrequired
Example: "all"
items[].​plan_namestringrequired
Example: "Localized plan name"
items[].​plan_descriptionstringrequired
Example: "Localized plan description"
items[].​plan_start_datestring or null(date-time)
Example: "2021-04-11T13:51:02+03:00"
items[].​plan_end_datestring or null(date-time)
Example: "2031-04-11T13:51:02+03:00"
items[].​trial_periodinteger or null
Example: "7"
items[].​periodobjectrequired
items[].​period.​valueinteger or null
Default null
Example: "1"
items[].​period.​unitstring or null
Default null
Example: "month"
items[].​chargeobjectrequired
items[].​charge.​amountnumber(float)required
Example: 4.99
items[].​charge.​setup_feenumber(float)required
Example: 0.99
items[].​charge.​currencystringrequired
Example: "USD"
items[].​promotionobjectrequired
items[].​promotion.​promotion_charge_amountnumber or null(float)
Default null
Example: "3.99"
items[].​promotion.​promotion_remaining_chargesinteger or null
Default null
Example: "3"
has_morebooleanrequired
Example: "false"
Response
application/json
{ "items": [], "has_more": "false" }

Request

Security
managementJwtAuth
Path
subscription_idinteger\d+required
plan_idinteger\d+required
project_idinteger\d+required
Query
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/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>'

Responses

Available plans for change with payment details

Bodyapplication/json
plan_idintegerrequired
Example: "54321"
plan_external_idstringrequired
Example: "PlanExternalId"
plan_group_idstring or null
Example: "TestGroupId"
plan_typestringrequired
Example: "all"
plan_namestringrequired
Example: "Localized plan name"
plan_descriptionstringrequired
Example: "Localized plan description"
plan_start_datestring or null(date-time)
Example: "2021-04-11T13:51:02+03:00"
plan_end_datestring or null(date-time)
Example: "2031-04-11T13:51:02+03:00"
trial_periodinteger or null
Example: "7"
periodobjectrequired
period.​valueinteger or null
Default null
Example: "1"
period.​unitstring or null
Default null
Example: "month"
chargeobjectrequired
charge.​amountnumber(float)required
Example: 4.99
charge.​setup_feenumber(float)required
Example: 0.99
charge.​currencystringrequired
Example: "USD"
promotionobjectrequired
promotion.​promotion_charge_amountnumber or null(float)
Default null
Example: "3.99"
promotion.​promotion_remaining_chargesinteger or null
Default null
Example: "3"
payment_detailsobjectrequired
payment_details.​unused(object or null)
Default null
(object or null)
Default null
payment_details.​surcharge(object or null)
Default null
(object or null)
Default null
Response
application/json
{ "plan_id": "54321", "plan_external_id": "PlanExternalId", "plan_group_id": "TestGroupId", "plan_type": "all", "plan_name": "Localized plan name", "plan_description": "Localized plan description", "plan_start_date": "2021-04-11T13:51:02+03:00", "plan_end_date": "2031-04-11T13:51:02+03:00", "trial_period": "7", "period": { "value": "1", "unit": "month" }, "charge": { "amount": 4.99, "setup_fee": 0.99, "currency": "USD" }, "promotion": { "promotion_charge_amount": "3.99", "promotion_remaining_charges": "3" }, "payment_details": { "unused": null, "surcharge": null } }
Operations