Create discount promotion for itemServer-sideAdmin
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. You can find this parameter in your Publisher Account next to the name of the project.
Example: 44056
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 Array of type = string (objects) or Array of type = date (objects) or Array of type = number (objects)
Array
One of:
[ 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.
Array of objects or null
Array of objects with conditions that set the price range for applying the promotion. The promotion applies only to items whose price meets all the conditions in the array. If you pass this array, set the value of the items object to null.
Array
operator
required
string
Comparison operator for setting the price range for applying the promotion.
Enum:
Description
ge
Greater or equal
gt
Greater than
le
Less or equal
lt
Less than
eq
Equals
ne
Not equals
value
required
string^\d+(\.\d{1,4})?$
Value for determining the price range for applying the promotion.
object
Promotion limits.
per_user
integer or null
Promotion limitation for a separate user.
object or null
Limit refresh period.
object
User limit refresh period.
interval_type
string
Recurrent refresh period type.
Enum:"daily""weekly""monthly"
day_of_week
integer or null [ 1 .. 7 ]
Day of the week when the limits refresh. Where 1 is Monday and 7 is Sunday. Not null only for weekly limit refresh period type.
day_of_month
integer or null [ 1 .. 31 ]
Day of the month when limits refresh. If there's no selected day of the month as it's shorter, then the refresh will occur on the last day of the month. Not null only for monthly limit refresh period type.
time
string <full-time>
Time of limit refresh in the desired time zone (rounding to hours).
reset_next_date
integer
Date and time when limits refresh (Unix Timestamp).
displayable_reset_start_date
string <date-time>
Date and time of the first limit refresh (ISO 8601).
displayable_reset_next_date
string <date-time>
Date and time when limits should reset (ISO 8601).
excluded_promotions
Array of integers
List of promotion IDs to exclude when applying this promotion. Example: [12, 789]
Responses
201
Promotion was successfully created.
401
Basic authentication not passed or wrong. Make sure you used basic authentication or correct credentials.