Creates a promo code promotion.
| project_id required | integer Project ID. You can find this parameter in your Publisher Account next to the name of the project. Example: 44056 |
| external_id required | string Default: "coupon_external_id" Unique promotion ID. The | ||||||||||||||||||
required | object Default: {"en-US":"Coupon title","de-DE":"Gutscheintitel"} Name of promotion. Should contain key/value pairs where key is a locale with "^[a-z]{2}-[A-Z]{2}$" format, value is string. | ||||||||||||||||||
Array of objects Promotion validity periods. If multiple periods are specified, both | |||||||||||||||||||
Array of objects or null | |||||||||||||||||||
| redeem_total_limit | integer or null Default: 10 Limits total numbers of coupons. | ||||||||||||||||||
| redeem_user_limit | integer or null Default: 10 Limits total numbers of coupons redeemed by single user. | ||||||||||||||||||
| redeem_code_limit | integer or null Default: 10 Number of redemptions per code. | ||||||||||||||||||
object or null | |||||||||||||||||||
Array of objects or null List of items that are discounted by a promo code. | |||||||||||||||||||
Array of type = string (object) or type = number (object) or type = date (object) [ 1 .. 100 ] items Conditions for validating user attributes. Determine promotion availability based on whether user attributes match all specified conditions. | |||||||||||||||||||
Array ([ 1 .. 100 ] items) One of: | |||||||||||||||||||
Array of objects or null Array of objects with conditions that set the price range for applying the promotion to the entire cart. | |||||||||||||||||||
Array
| |||||||||||||||||||
Array of objects or null Array of objects with conditions that set the price range for applying the promotion to certain items in the cart. | |||||||||||||||||||
Array
| |||||||||||||||||||
| excluded_promotions | Array of integers List of promotion IDs to exclude when applying this promotion. | ||||||||||||||||||
Promo code was successfully created.
Basic authentication not passed or wrong. Make sure you used basic authentication or correct credentials.
Invalid request.
{- "external_id": "promo_code_external_id",
- "promotion_periods": [
- {
- "date_from": "2020-04-15T18:16:00+05:00",
- "date_until": "2020-04-25T18:16:00+05:00"
}, - {
- "date_from": "2020-05-15T18:16:00+05:00",
- "date_until": "2020-05-25T18:16:00+05:00"
}
], - "name": {
- "en-US": "New Year Bonus",
- "de-DE": "Neujahrsbonus"
}, - "redeem_total_limit": 100,
- "redeem_user_limit": 1,
- "redeem_code_limit": 1,
- "bonus": [
- {
- "sku": "com.xsolla.elven_sword_1",
- "quantity": 1
}, - {
- "sku": "com.xsolla.elven_shield_1",
- "quantity": 2
}, - {
- "sku": "com.xsolla.elven_gloves_1",
- "quantity": 2
}
]
}{- "external_id": "coupon_external_id"
}