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
subscription_idinteger\d+required
project_idinteger\d+required
Bodyapplication/jsonrequired

Renew subscription

settings(object or null)
(object or null)
custom_parametersobject or null

You can pass additional parameters in the token

Default null
steam_user_idstring or null
curl -i -X POST \
  'https://xsolla.redocly.app/_mock/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/{subscription_id}/renew' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "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"
  }'

Responses

Get subscription renew url

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>" }

Request

Security
projectUserJwtAuth
Path
project_idinteger\d+required
Query
countrystring
Bodyapplication/jsonrequired

Buy subscription

plan_external_idstring or null

You must provide either a plan_external_id

Default null
Example: "PlanExternalId"
product_idinteger or null

ID of the product associated with the plan

Default null
Example: "12345"
available_plansobject or null

Subscription plans to show in the payment UI.

Default null
settings(object or null)
(object or null)
custom_parametersobject or null

You can pass additional parameters in the token

Default null
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
  }'

Responses

Get buy subscription url

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>" }
Operations
Operations
Operations
Operations