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 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.

payment_systems[].​idinteger

Payment system ID.

payment_systems[].​namestring

Payment system name.

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.

Request

Gets payment systems supported for a promotion. If the list is empty, the promotion will apply to all payment systems.

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}/payment_systems'

Responses

OK.

Bodyapplication/json
idinteger
payment_systemsArray of objects

Payment systems.

payment_systems[].​idinteger

Payment system ID.

payment_systems[].​namestring

Payment system name.

Response
application/json
{ "id": 17840, "payment_systems": [ {} ] }

Request

Sets date/time ranges when a promotion is valid. If the promotion is read-only (read_only = true), you cannot edit existing periods, but you can add new ones.

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

Date/time ranges.

periods[].​fromstring(datetime)

Period start.

periods[].​offsetstring

Number of the element from which the list is generated (the count starts from 0).

periods[].​tostring(datetime)

Period end.

curl -i -X PUT \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/api/subscriptions/merchants/{merchant_id}/promotions/{promotion_id}/periods' \
  -H 'Content-Type: application/json' \
  -d '{
    "periods": [
      {
        "from": "2019-03-02T00:00:00+04:00",
        "to": "2019-04-02T00:00:00+04:00"
      }
    ]
  }'

Responses

No content.

Operations
Operations