Buy subscription
/
Get management link
Subscriptions API (2.0)
- 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/
Bodyapplication/jsonrequired
You must provide either a plan_external_id
Default null
Example: "PlanExternalId"
- https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/buy
- Mock serverhttps://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/buy
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/buy?country=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"plan_external_id": "PlanExternalId",
"product_id": "12345",
"available_plans": null,
"settings": {
"ui": {
"size": "large",
"theme": "string",
"version": "desktop",
"desktop": {
"header": {
"is_visible": true,
"visible_logo": true,
"visible_name": true,
"type": "compact",
"close_button": true
}
},
"mobile": {
"mode": "saved_accounts",
"footer": {
"is_visible": true
},
"header": {
"close_button": true
}
},
"license_url": "string",
"mode": "user_account",
"user_account": {
"history": {
"enable": true,
"order": 1
},
"payment_accounts": {
"enable": true,
"order": 1
},
"info": {
"enable": true,
"order": 1
},
"subscriptions": {
"enable": true,
"order": 1
}
},
"independent_windows": true
},
"currency": "str",
"locale": "st",
"external_id": "string",
"payment_method": 1,
"return_url": "string",
"xsolla_product_tag": "string",
"steam_user_id": "stringstringstrin",
"redirect_policy": {
"redirect_conditions": "none",
"delay": 0,
"status_for_manual_redirection": "none",
"redirect_button_caption": "string"
},
"hide_saved_payment_accounts": true
},
"custom_parameters": null
}'Response
application/json
{ "link_to_ps": "https://secure.xsolla.com/paystation2/?access_token=<access_token>" }
- https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/manage
- Mock serverhttps://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/manage
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/manage?country=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"product_id": "12345",
"available_plans": null,
"settings": {
"ui": {
"size": "large",
"theme": "string",
"version": "desktop",
"desktop": {
"header": {
"is_visible": true,
"visible_logo": true,
"visible_name": true,
"type": "compact",
"close_button": true
}
},
"mobile": {
"mode": "saved_accounts",
"footer": {
"is_visible": true
},
"header": {
"close_button": true
}
},
"license_url": "string",
"mode": "user_account",
"user_account": {
"history": {
"enable": true,
"order": 1
},
"payment_accounts": {
"enable": true,
"order": 1
},
"info": {
"enable": true,
"order": 1
},
"subscriptions": {
"enable": true,
"order": 1
}
},
"independent_windows": true
},
"currency": "str",
"locale": "st",
"external_id": "string",
"payment_method": 1,
"return_url": "string",
"xsolla_product_tag": "string",
"steam_user_id": "stringstringstrin",
"redirect_policy": {
"redirect_conditions": "none",
"delay": 0,
"status_for_manual_redirection": "none",
"redirect_button_caption": "string"
},
"hide_saved_payment_accounts": true
},
"custom_parameters": null,
"steam_user_id": "string"
}'Response
application/json
{ "link_to_ps": "https://secure.xsolla.com/paystation2/?access_token=<access_token>" }
- https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/user_account
- Mock serverhttps://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/user_account
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/user_account?locale=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'Response
application/json
{ "redirect_url": "https://subscriptions-user-account.xsolla.com/?token=<access_token>&projectId=<project_id>&merchantId=<merchant_id>&locale=<locale>" }