Xsolla-logo

Update item promotionServer-sideAdmin

put/v2/project/{project_id}/admin/promotion/{promotion_id}/item

Updates the promotion.

Note

New data will replace old data. If you want to update only a part of a promotion, you should transfer all required data in request as well.

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. You can find this parameter in your Publisher Account next to the name of the project.

Example: 44056
promotion_id
required
integer

Promotion ID. Unique promotion identifier within the project.

Example: 111425
Request Body schema: application/json

Object with promotion data.

required
Array of objects
Array
sku
required
string
Default: "elven_sword"

Item SKU.

required
object
percent
required
string

Percent discount. The price of item will be decreased using a value calculated by using this percent and then rounded to 2 decimal places.

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.

property name*
additional property
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 type = string (objects) or Array of type = date (objects) or Array of type = number (objects)
One of:

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

[ 1 .. 100 ] items
Array ([ 1 .. 100 ] items)
attribute
required
string [ 1 .. 255 ] characters ^[-_.\\d\\w]+$

User attribute code.

operator
required
string

Type of operation performed by condition. For string attribute type.

Enum: Description
eq

Equals

ne

Not equals

value
required
string <= 255 characters

Condition value which user attribute value will be compared to. Type depends on attribute type.

type
required
string

User attribute type.

Value: "string"
can_be_missing
boolean

Indicates that the condition is met even if attribute is missing from user attributes. Pass true to show the item to users who don't have this attribute. Users who have the attribute, but the value does not match that specified in the condition, will not see the item. False — users who have the attribute, but the value does not match that specified in the condition, or the attribute is missing, will not see the item.

object or null

Condition for applying the promotion to items priced within the specified price range. In the price_range_condition object, you need to provide a value for at least one of the parameters: lower_limit or upper_limit .
If you have specified items in the items object, the promotion only applies to the items within this object and within the specified price range.
To make the promotional condition apply to all items, pass the value null in the items object.

lower_limit
required
string or null

Lower limit of the price range for applying the promotion. If the lower_limit value is set, the promotions will only apply to items whose price is greater than or equal to this value. The price value should be specified in the default currency.
Example: "10.0000"

upper_limit
required
string or null

Upper limit of the price range for applying the promotion. If the upper_limit is set, the promotions will only apply to items whose price is less than or equal to this value. The price value should be specified in the default currency.
Example: "20.0000"

object

Promotion limits.

per_user
integer or null

Promotion limitation for a separate user.

object or null

Limit refresh period.

interval_type = daily (object) or interval_type = weekly (object) or interval_type = monthly (object)
One of:

Daily type of user limits refresh.

interval_type
required
string

Recurrent refresh period.

Value: "daily"
time
required
string((0[0-9]|1[0-9]|2[0-3]):00:00)(\+|-)(0[0-9]|1...

Time of limit refresh in the desired time zone (rounding to hours).

Responses
204

Promotion was successfully updated.

401

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

404

Promotion not found. Make sure promotion_id is correct.

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
{
  • "statusCode": 401,
  • "errorCode": 1020,
  • "errorMessage": "[0401-1020]: Error in Authentication method occurred"
}