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
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/management/projects/{project_id}/subscriptions/{subscription_id}?locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Get subscription info

Bodyapplication/json
idintegerrequired
Example: "12345"
plan_namestringrequired
Example: "Localized plan name"
plan_descriptionstringrequired
Example: "Localized plan description"
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"
chargeobject(Charge)required
charge.​amountnumber(float)required
Example: "4.99"
charge.​amount_with_promotionnumber or null(float)
Default null
Example: "3.99"
charge.​currencystringrequired
Example: "USD"
periodobject(Period)required
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"
payment_account(PaymentRecurrentAccountResponse2 (object or null))
(PaymentRecurrentAccountResponse2 (object or null))
last_successful_charge(LastSuccessfulCharge (object or null))
(LastSuccessfulCharge (object or null))
Response
application/json
{ "id": "12345", "plan_name": "Localized plan name", "plan_description": "Localized plan description", "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", "amount_with_promotion": "3.99", "currency": "USD" }, "period": { "value": "1", "unit": "month" }, "is_renew_possible": "true", "is_change_to_non_renew_possible": "true", "is_change_plan_allowed": "false", "payment_account": { "id": "123", "type": "card", "name": "** 7398", "card_expiry_date": {}, "ps_name": "Mastercard", "switch_icon_name": "mastercard.svg" }, "last_successful_charge": { "date": "2031-04-11T13:51:02+03:00", "amount": "3.99", "currency": "USD" } }

Request

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

Responses

Make subscription non-renewable

Bodyapplication/json
Response
application/json
null

Request

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

Responses

Get payment account info

Bodyapplication/json
idintegerrequired
Example: "123"
typestringrequired
Example: "card"
namestring or null
Example: "** 7398"
card_expiry_dateobject or null
ps_namestring or null
Example: "Mastercard"
switch_icon_namestring or null
Example: "mastercard.svg"
Response
application/json
{ "id": "123", "type": "card", "name": "** 7398", "card_expiry_date": { "year": "2023", "month": "09" }, "ps_name": "Mastercard", "switch_icon_name": "mastercard.svg" }