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

Sets the subject of a promotion. If the promotion is read-only (read_only = true), you cannot update the subject. The subject can take the following values: purchase, or items, or packages.

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
purchaseboolean

Whether the promotion applies to the whole purchase.

itemsArray of objects

Array of virtual items that the promotion applies to.

packagesArray of objects or null

Array of virtual currency packages that the promotion applies to.

subscriptionsobject or null

Subscription plans or products that the promotion applies to.

digital_contentsobject or null
curl -i -X PUT \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/api/subscriptions/merchants/{merchant_id}/promotions/{promotion_id}/subject' \
  -H 'Content-Type: application/json' \
  -d '{
    "digital_contents": null,
    "items": [
      {
        "sku": "1234"
      }
    ],
    "packages": null,
    "purchase": false,
    "subscriptions": null
  }'

Responses

No content.

Request

Gets information on the subject of 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}/subject'

Responses

OK.

Bodyapplication/json
purchaseboolean

Whether the promotion applies to the whole purchase.

itemsArray of objects

Array of virtual items that the promotion applies to.

packagesArray of objects or null

Array of virtual currency packages that the promotion applies to.

subscriptionsobject or null

Subscription plans or products that the promotion applies to.

digital_contentsobject or null
idinteger
Response
application/json
{ "digital_contents": null, "id": 178, "items": [ {} ], "packages": null, "purchase": false, "subscriptions": null }

Request

Sets payment systems supported for a promotion. If the list is empty, the promotion will apply to all payment systems. If the promotion is read-only (read_only = true), you cannot call this method.

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
payment_systemsArray of objects

Payment systems.

curl -i -X PUT \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/api/subscriptions/merchants/{merchant_id}/promotions/{promotion_id}/payment_systems' \
  -H 'Content-Type: application/json' \
  -d '{
    "payment_systems": [
      {
        "id": 24,
        "name": "PayPal"
      }
    ]
  }'

Responses

No content.

Operations
Operations