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

Request

List of all promotions.

Notice

This API call does not contain the project_id path-parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization.

Security
basicAuth
Path
merchant_idintegerrequired

Merchant ID.

curl -i -X GET \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/api/subscriptions/merchants/{merchant_id}/promotions'

Responses

OK.

Bodyapplication/json
Response
application/json
[ { "datetime": {}, "enabled": true, "id": 17840, "is_active": true, "is_infinite": false, "project": {}, "read_only": false, "technical_name": "christmas" }, { "datetime": null, "enabled": false, "id": 17891, "is_active": false, "is_infinite": true, "project": {}, "read_only": false, "technical_name": "Sale promotion" } ]

Request

Retrieves a promotion.

Notice

This API call does not contain the project_id path-parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization.

Security
basicAuth
Path
merchant_idintegerrequired

Merchant ID.

promotion_idintegerrequired

Promotion ID.

curl -i -X GET \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/api/subscriptions/merchants/{merchant_id}/promotions/{promotion_id}'

Responses

OK.

Bodyapplication/json
technical_namestring

Technical name of the promotion.

project_idinteger

Project ID.

labelobject

Array of localized labels to show in the payment UI.

nameobject

Array of localized promotion names.

descriptionobject

Array of localized promotion descriptions.

idinteger
read_onlyboolean
show_bannerboolean
enabledboolean
Response
application/json
{ "description": { "en": "Promotion with 30% discount", "ru": "Акция со скидкой 30%" }, "enabled": false, "id": 17890, "label": { "en": "30%", "ru": "30%" }, "name": { "en": "30% discount", "ru": "Скидка 30%" }, "project_id": 40544, "read_only": false, "show_banner": true, "technical_name": "Sale promotion" }

Request

Updates a promotion. If the promotion is read-only (read_only = true), you are not allowed to change project_id parameter.

Notice

This API call does not contain the project_id path-parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization.

Security
basicAuth
Path
merchant_idintegerrequired

Merchant ID.

promotion_idintegerrequired

Promotion ID.

Bodyapplication/jsonrequired
technical_namestringrequired

Technical name of the promotion.

project_idintegerrequired

Project ID.

labelobject

Array of localized labels to show in the payment UI.

nameobject

Array of localized promotion names.

descriptionobject

Array of localized promotion descriptions.

idinteger
read_onlyboolean
show_bannerboolean
enabledboolean
curl -i -X PUT \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/api/subscriptions/merchants/{merchant_id}/promotions/{promotion_id}' \
  -H 'Content-Type: application/json' \
  -d '{
    "description": {
      "en": "Promotion with 5% discount",
      "ru": "Акция со скидкой 5%"
    },
    "label": {
      "en": "5%",
      "ru": "5%"
    },
    "name": {
      "en": "5% discount",
      "ru": "скидка 5%"
    },
    "project_id": 40544,
    "technical_name": "Sale promotion"
  }'

Responses

No content.

Operations
Operations