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
subscriptionsManagementJwtAuth
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(PlanResponse)
Default []
has_morebooleanrequired
Example: "false"
Response
application/json
{ "items": [], "has_more": "false" }

Request

Security
subscriptionsManagementJwtAuth
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"
periodobject(Period2)required
period.​valueinteger or null
Default null
Example: "1"
period.​unitstring or null
Default null
Example: "month"
chargeobject(Charge2)required
charge.​amountnumber(float)required
Example: "4.99"
charge.​setup_feenumber or null(float)
Example: "0.99"
charge.​currencystringrequired
Example: "USD"
promotionobject(Promotion)required
promotion.​promotion_charge_amountnumber or null(float)
Default null
Example: "3.99"
promotion.​promotion_remaining_chargesinteger or null
Default null
Example: "3"
payment_detailsobject(PaymentDetails)required
payment_details.​unused(Unused (object or null))
Default null
(Unused (object or null))
Default null
payment_details.​surcharge(Surcharge (object or null))
Default null
(Surcharge (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 } }

Request

Security
subscriptionsManagementJwtAuth
Path
subscription_idinteger\d+required
project_idinteger\d+required
Query
sandboxboolean
curl -i -X POST \
  'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/management/projects/{project_id}/subscriptions/{subscription_id}/payment_account/manage?sandbox=true' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Returns link for managing payment accounts

Bodyapplication/json
link_to_psstringrequired
Example: "https://secure.xsolla.com/paystation2/?access_token=<access_token>"
Response
application/json
{ "link_to_ps": "https://secure.xsolla.com/paystation2/?access_token=<access_token>" }