Xsolla-logo

Create discount promotion for item

post/v2/project/{project_id}/admin/promotion/item

Creates a discount promotion for an item.

Promotions provide a discount (%) on items. The discount will be applied to all prices of the specified items.

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

Project ID.

Example: 44056
Request Body schema: application/json

Object with promotion data.

required
Array of objects
required
object or null
required
object

Name of promotion. Should contain key/value pairs, where key is locale with format "^[a-z]{2}-[A-Z]{2}$", value is string.

date_start
string or null <date-time>
Default: "2020-04-15T18:16:00+05:00"

Date when your promotion will be started.

date_end
string or null <date-time>
Default: "2020-04-15T18:16:00+05:00"

Date when your promotion will be finished. Can be null.

Array of objects [ 1 .. 100 ] items

Conditions which are compared to user attribute values. All conditions must be met for the action to take an effect.

Responses
201

Promotion was successfully created.

401

Basic authentication not passed or wrong. Make sure you used basic authentication or correct credentials.

422

Invalid request.

Request samples
application/json
{
  • "date_start": "2020-04-15T18:16:00+05:00",
  • "date_end": "2020-04-25T18:16:00+05:00",
  • "discount": {
    },
  • "items": [
    ],
  • "name": {
    }
}
Response samples
application/json
{
  • "promotion_id": 2384756
}