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

Request

Security
projectUserJwtAuth
Path
project_idinteger\d+required
Query
limitinteger
offsetinteger
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions?limit=0&offset=0&locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Get subscription info

Bodyapplication/json
itemsArray of objects
Default []
items[].​idintegerrequired
Example: "12345"
items[].​plan_idintegerrequired
Example: "54321"
items[].​plan_external_idstringrequired
Example: "PlanExternalId"
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[].​product_idinteger or null
Example: "12345"
items[].​product_external_idstring or null
Example: "ProductExternalId"
items[].​product_namestring or null
Example: "Product name"
items[].​product_descriptionstring or null
Example: "Localized product description"
items[].​statusstringrequired
Example: "active"
items[].​is_in_trialbooleanrequired
Example: "false"
items[].​trial_periodinteger or null
Example: "0"
items[].​date_createstring(date-time)required
Example: "2031-04-11T13:51:02+03:00"
items[].​date_next_chargestring or null(date-time)
Example: "2031-04-11T13:51:02+03:00"
items[].​date_last_chargestring or null(date-time)
Example: "2031-04-11T13:51:02+03:00"
items[].​chargeobjectrequired
items[].​charge.​amountnumber(float)required
Example: 4.99
items[].​charge.​amount_with_promotionnumber or null(float)
Default null
Example: 3.99
items[].​charge.​currencystringrequired
Example: "USD"
items[].​periodobjectrequired
items[].​period.​valueinteger or null
Default null
Example: "1"
items[].​period.​unitstring or null
Default null
Example: "month"
has_morebooleanrequired
Example: "false"
Response
application/json
{ "items": [], "has_more": "false" }

Request

Security
projectUserJwtAuth
Path
subscription_idinteger\d+required
project_idinteger\d+required
Query
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/{subscription_id}?locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Get subscription info

Bodyapplication/json
idintegerrequired
Example: "12345"
plan_idintegerrequired
Example: "54321"
plan_external_idstringrequired
Example: "PlanExternalId"
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"
product_idinteger or null
Example: "12345"
product_external_idstring or null
Example: "ProductExternalId"
product_namestring or null
Example: "Product name"
product_descriptionstring or null
Example: "Localized product description"
statusstringrequired
Example: "active"
is_in_trialbooleanrequired
Example: "false"
trial_periodinteger or null
Example: "0"
date_createstring(date-time)required
Example: "2031-04-11T13:51:02+03:00"
date_next_chargestring or null(date-time)
Example: "2031-04-11T13:51:02+03:00"
date_last_chargestring or null(date-time)
Example: "2031-04-11T13:51:02+03:00"
date_endstring or null(date-time)
Example: "2031-04-11T13:51:02+03:00"
chargeobjectrequired
charge.​amountnumber(float)required
Example: 4.99
charge.​setup_feenumber(float)required
Example: 0.99
charge.​currencystringrequired
Example: "USD"
periodobjectrequired
period.​valueinteger or null
Default null
Example: "1"
period.​unitstring or null
Default null
Example: "month"
is_renew_possiblebooleanrequired
Example: "true"
is_change_to_non_renew_possiblebooleanrequired
Example: "true"
is_change_plan_allowedbooleanrequired
Example: "false"
Response
application/json
{ "id": "12345", "plan_id": "54321", "plan_external_id": "PlanExternalId", "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", "product_id": "12345", "product_external_id": "ProductExternalId", "product_name": "Product name", "product_description": "Localized product description", "status": "active", "is_in_trial": "false", "trial_period": "0", "date_create": "2031-04-11T13:51:02+03:00", "date_next_charge": "2031-04-11T13:51:02+03:00", "date_last_charge": "2031-04-11T13:51:02+03:00", "date_end": "2031-04-11T13:51:02+03:00", "charge": { "amount": 4.99, "setup_fee": 0.99, "currency": "USD" }, "period": { "value": "1", "unit": "month" }, "is_renew_possible": "true", "is_change_to_non_renew_possible": "true", "is_change_plan_allowed": "false" }

Request

Security
projectUserJwtAuth
Path
subscription_idinteger\d+required
project_idinteger\d+required
curl -i -X PUT \
  'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/{subscription_id}/cancel' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Make subscription non-renewable

Bodyapplication/json
Response
application/json
null
Operations
Operations
Operations
Operations