Creates a promotion.
To learn more about how to create a promotion, read the Promotions Overview.
For examples grouped by use case, see the promotions examples.
Note:
The default rate limit for this endpoint is 40 concurrent requests.
Authentication
X-Auth-Token in header
Parameters
store_hash in path - string
Accept in header with default of application/json - string
An auto-generated unique identifier for the discount rule.
Example: 1
redemption_typestring
read-only
A read-only field indicating the type of promotion. Promotions applied automatically have a value of AUTOMATIC whereas promotions requiring a coupon have a value of COUPON.
Allowed: AUTOMATIC | COUPON
namestring
required
An internal name for this rule that the merchant can refer to.
Example: Buy Product X Get Free Shipping
display_namestring
Customer-facing name for this rule, that the merchant want to display to customers.
Example: WOW!!! FREE SHIPPING for Product X
channelsarray[object]
Channels that the promotion targets. Empty array [] means targeting all the channels. In POST request, if omitted, this field defaults to an empty array [] value.
customerobject
Specifies the requirements which make the customer eligible for the promotion.
Note:
Only "group_ids" or "excluded_group_ids" should be specified (have non-empty array data), but not both.
group_id zero (0) signifies guest customers or registered customers who are not assigned to any groups.
rulesarray[object]
required
An ordered list of rules to be executed until the first applicable one applies a discount successfully and the rest will be skipped.
current_usesinteger
read-only
A read-only count of the times this rule has been used by customers. A rule is considered to be used when a customer successfully checks out with a rule that has applied a discount to their cart.
Example: 2
max_usesinteger
The maximum number of times this discount can be used by customers.
Example: 10
statusstring
Controls whether or not a discount rule can be used by customers. INVALID is a read-only status into which enabled discount rules may transition when they become invalid.
Allowed: ENABLED | DISABLED | INVALID
start_datestring
The date and time when this rule will become active.
Example: 2005-12-30T01:02:03+00:00
end_datestring
The date and time when this rule will expire. If this property is left null, the promotion never expires.
Example: 2025-12-30T01:02:03+00:00
stopboolean
Boolean value that specifies whether to stop evaluating promotions down the priority list when the promotion is applied successfully.
can_be_used_with_other_promotionsboolean
Boolean value that specifies whether this promotion can be used with other promotions. When set to false, only apply this promotion if there are no discounts applied already, and stop executing other promotions if this promotion applies successfully.
Default: true
currency_codestring
The ISO-4217-based transactional currency code to which the promotion applies OR * for all currencies.
Example: USD
notificationsarray[object]
Notifications to display on the storefront based on the result of the evaluation for promotion eligibility.
This field only has effect when the redemption_type is COUPON and can_be_used_with_other_promotions is false:
When the property is set to "true", the coupon will override the applied automatic promotions if it provides a greater discount.
When the property is set to "false", the coupon will not be applied if automatic promotions are already applied.
Trying to set the value of this field to "true" when the redemption_type is not COUPON, or when can_be_used_with_other_promotions is true will yield a 422 error response.
Default: false
example
JSONcURLNode.jsPHPJava
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
{
"name": "Buy Product X Get Free Shipping",
"display_name": "WOW!!! FREE SHIPPING for Product X",
"channels": [
{
"id": 1
}
],
"customer": {
"group_ids": [
1,
2,
3
],
"minimum_order_count": 0,
"excluded_group_ids": [
1,
2,
3
],
"segments": {
"id": [
"ccec121a-f9bc-4a04-809e-1fe0d8ae7fdd"
]
}
},
"rules": [
{
"action": {
"cart_value": {
"discount": {
"fixed_amount": "12.95"
}
}
},
"apply_once": true,
"stop": true,
Response
201400403422
Body
object | application/json
data
Any of:Coupon PromotionAutomatic Promotion
idinteger
read-only
An auto-generated unique identifier for the discount rule.
Example: 1
redemption_typestring
read-only
A read-only field indicating the type of promotion. Promotions applied automatically have a value of AUTOMATIC whereas promotions requiring a coupon have a value of COUPON.
Allowed: AUTOMATIC | COUPON
namestring
required
An internal name for this rule that the merchant can refer to.
Example: Buy Product X Get Free Shipping
display_namestring
Customer-facing name for this rule, that the merchant want to display to customers.
Example: WOW!!! FREE SHIPPING for Product X
channelsarray[object]
Channels that the promotion targets. Empty array [] means targeting all the channels. In POST request, if omitted, this field defaults to an empty array [] value.
customerobject
Specifies the requirements which make the customer eligible for the promotion.
Note:
Only "group_ids" or "excluded_group_ids" should be specified (have non-empty array data), but not both.
group_id zero (0) signifies guest customers or registered customers who are not assigned to any groups.
rulesarray[object]
required
An ordered list of rules to be executed until the first applicable one applies a discount successfully and the rest will be skipped.
current_usesinteger
read-only
A read-only count of the times this rule has been used by customers. A rule is considered to be used when a customer successfully checks out with a rule that has applied a discount to their cart.
Example: 2
max_usesinteger
The maximum number of times this discount can be used by customers.
Example: 10
statusstring
Controls whether or not a discount rule can be used by customers. INVALID is a read-only status into which enabled discount rules may transition when they become invalid.
Allowed: ENABLED | DISABLED | INVALID
start_datestring
The date and time when this rule will become active.
Example: 2005-12-30T01:02:03+00:00
end_datestring
The date and time when this rule will expire. If this property is left null, the promotion never expires.
Example: 2025-12-30T01:02:03+00:00
stopboolean
Boolean value that specifies whether to stop evaluating promotions down the priority list when the promotion is applied successfully.
can_be_used_with_other_promotionsboolean
Boolean value that specifies whether this promotion can be used with other promotions. When set to false, only apply this promotion if there are no discounts applied already, and stop executing other promotions if this promotion applies successfully.
Default: true
currency_codestring
The ISO-4217-based transactional currency code to which the promotion applies OR * for all currencies.
Example: USD
notificationsarray[object]
Notifications to display on the storefront based on the result of the evaluation for promotion eligibility.
This field only has effect when the redemption_type is COUPON and can_be_used_with_other_promotions is false:
When the property is set to "true", the coupon will override the applied automatic promotions if it provides a greater discount.
When the property is set to "false", the coupon will not be applied if automatic promotions are already applied.
Trying to set the value of this field to "true" when the redemption_type is not COUPON, or when can_be_used_with_other_promotions is true will yield a 422 error response.
Default: false
metaobject
Empty meta object, which may be used at a later time.
example
JSON
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
{
"data": {
"name": "Buy Product X Get Free Shipping",
"display_name": "WOW!!! FREE SHIPPING for Product X",
An auto-generated unique identifier for the discount rule.
Example: 1
redemption_typestring
read-only
A read-only field indicating the type of promotion. Promotions applied automatically have a value of AUTOMATIC whereas promotions requiring a coupon have a value of COUPON.
Allowed: AUTOMATIC | COUPON
namestring
required
An internal name for this rule that the merchant can refer to.
Example: Buy Product X Get Free Shipping
display_namestring
Customer-facing name for this rule, that the merchant want to display to customers.
Example: WOW!!! FREE SHIPPING for Product X
channelsarray[object]
Channels that the promotion targets. Empty array [] means targeting all the channels. In POST request, if omitted, this field defaults to an empty array [] value.
customerobject
Specifies the requirements which make the customer eligible for the promotion.
Note:
Only "group_ids" or "excluded_group_ids" should be specified (have non-empty array data), but not both.
group_id zero (0) signifies guest customers or registered customers who are not assigned to any groups.
rulesarray[object]
required
An ordered list of rules to be executed until the first applicable one applies a discount successfully and the rest will be skipped.
current_usesinteger
read-only
A read-only count of the times this rule has been used by customers. A rule is considered to be used when a customer successfully checks out with a rule that has applied a discount to their cart.
Example: 2
max_usesinteger
The maximum number of times this discount can be used by customers.
Example: 10
statusstring
Controls whether or not a discount rule can be used by customers. INVALID is a read-only status into which enabled discount rules may transition when they become invalid.
Allowed: ENABLED | DISABLED | INVALID
start_datestring
The date and time when this rule will become active.
Example: 2005-12-30T01:02:03+00:00
end_datestring
The date and time when this rule will expire. If this property is left null, the promotion never expires.
Example: 2025-12-30T01:02:03+00:00
stopboolean
Boolean value that specifies whether to stop evaluating promotions down the priority list when the promotion is applied successfully.
can_be_used_with_other_promotionsboolean
Boolean value that specifies whether this promotion can be used with other promotions. When set to false, only apply this promotion if there are no discounts applied already, and stop executing other promotions if this promotion applies successfully.
Default: true
currency_codestring
The ISO-4217-based transactional currency code to which the promotion applies OR * for all currencies.
Example: USD
notificationsarray[object]
Notifications to display on the storefront based on the result of the evaluation for promotion eligibility.
This field only has effect when the redemption_type is COUPON and can_be_used_with_other_promotions is false:
When the property is set to "true", the coupon will override the applied automatic promotions if it provides a greater discount.
When the property is set to "false", the coupon will not be applied if automatic promotions are already applied.
Trying to set the value of this field to "true" when the redemption_type is not COUPON, or when can_be_used_with_other_promotions is true will yield a 422 error response.
Default: false
metaobject
Empty meta object, which may be used at a later time.
example
JSON
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
{
"data": {
"name": "Buy Product X Get Free Shipping",
"display_name": "WOW!!! FREE SHIPPING for Product X",
An auto-generated unique identifier for the discount rule.
Example: 1
redemption_typestring
read-only
A read-only field indicating the type of promotion. Promotions applied automatically have a value of AUTOMATIC whereas promotions requiring a coupon have a value of COUPON.
Allowed: AUTOMATIC | COUPON
namestring
required
An internal name for this rule that the merchant can refer to.
Example: Buy Product X Get Free Shipping
display_namestring
Customer-facing name for this rule, that the merchant want to display to customers.
Example: WOW!!! FREE SHIPPING for Product X
channelsarray[object]
Channels that the promotion targets. Empty array [] means targeting all the channels. In POST request, if omitted, this field defaults to an empty array [] value.
customerobject
Specifies the requirements which make the customer eligible for the promotion.
Note:
Only "group_ids" or "excluded_group_ids" should be specified (have non-empty array data), but not both.
group_id zero (0) signifies guest customers or registered customers who are not assigned to any groups.
rulesarray[object]
required
An ordered list of rules to be executed until the first applicable one applies a discount successfully and the rest will be skipped.
current_usesinteger
read-only
A read-only count of the times this rule has been used by customers. A rule is considered to be used when a customer successfully checks out with a rule that has applied a discount to their cart.
Example: 2
max_usesinteger
The maximum number of times this discount can be used by customers.
Example: 10
statusstring
Controls whether or not a discount rule can be used by customers. INVALID is a read-only status into which enabled discount rules may transition when they become invalid.
Allowed: ENABLED | DISABLED | INVALID
start_datestring
The date and time when this rule will become active.
Example: 2005-12-30T01:02:03+00:00
end_datestring
The date and time when this rule will expire. If this property is left null, the promotion never expires.
Example: 2025-12-30T01:02:03+00:00
stopboolean
Boolean value that specifies whether to stop evaluating promotions down the priority list when the promotion is applied successfully.
can_be_used_with_other_promotionsboolean
Boolean value that specifies whether this promotion can be used with other promotions. When set to false, only apply this promotion if there are no discounts applied already, and stop executing other promotions if this promotion applies successfully.
Default: true
currency_codestring
The ISO-4217-based transactional currency code to which the promotion applies OR * for all currencies.
Example: USD
notificationsarray[object]
Notifications to display on the storefront based on the result of the evaluation for promotion eligibility.
This field only has effect when the redemption_type is COUPON and can_be_used_with_other_promotions is false:
When the property is set to "true", the coupon will override the applied automatic promotions if it provides a greater discount.
When the property is set to "false", the coupon will not be applied if automatic promotions are already applied.
Trying to set the value of this field to "true" when the redemption_type is not COUPON, or when can_be_used_with_other_promotions is true will yield a 422 error response.
Default: false
example
JSONcURLNode.jsPHPJava
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
{
"name": "Buy Product X Get Free Shipping",
"display_name": "WOW!!! FREE SHIPPING for Product X",
"channels": [
{
"id": 1
}
],
"customer": {
"group_ids": [
1,
2,
3
],
"minimum_order_count": 0,
"excluded_group_ids": [
1,
2,
3
],
"segments": {
"id": [
"ccec121a-f9bc-4a04-809e-1fe0d8ae7fdd"
]
}
},
"rules": [
{
"action": {
"cart_value": {
"discount": {
"fixed_amount": "12.95"
}
}
},
"apply_once": true,
"stop": true,
Response
200404
Body
object | application/json
data
Any of:Coupon PromotionAutomatic Promotion
idinteger
read-only
An auto-generated unique identifier for the discount rule.
Example: 1
redemption_typestring
read-only
A read-only field indicating the type of promotion. Promotions applied automatically have a value of AUTOMATIC whereas promotions requiring a coupon have a value of COUPON.
Allowed: AUTOMATIC | COUPON
namestring
required
An internal name for this rule that the merchant can refer to.
Example: Buy Product X Get Free Shipping
display_namestring
Customer-facing name for this rule, that the merchant want to display to customers.
Example: WOW!!! FREE SHIPPING for Product X
channelsarray[object]
Channels that the promotion targets. Empty array [] means targeting all the channels. In POST request, if omitted, this field defaults to an empty array [] value.
customerobject
Specifies the requirements which make the customer eligible for the promotion.
Note:
Only "group_ids" or "excluded_group_ids" should be specified (have non-empty array data), but not both.
group_id zero (0) signifies guest customers or registered customers who are not assigned to any groups.
rulesarray[object]
required
An ordered list of rules to be executed until the first applicable one applies a discount successfully and the rest will be skipped.
current_usesinteger
read-only
A read-only count of the times this rule has been used by customers. A rule is considered to be used when a customer successfully checks out with a rule that has applied a discount to their cart.
Example: 2
max_usesinteger
The maximum number of times this discount can be used by customers.
Example: 10
statusstring
Controls whether or not a discount rule can be used by customers. INVALID is a read-only status into which enabled discount rules may transition when they become invalid.
Allowed: ENABLED | DISABLED | INVALID
start_datestring
The date and time when this rule will become active.
Example: 2005-12-30T01:02:03+00:00
end_datestring
The date and time when this rule will expire. If this property is left null, the promotion never expires.
Example: 2025-12-30T01:02:03+00:00
stopboolean
Boolean value that specifies whether to stop evaluating promotions down the priority list when the promotion is applied successfully.
can_be_used_with_other_promotionsboolean
Boolean value that specifies whether this promotion can be used with other promotions. When set to false, only apply this promotion if there are no discounts applied already, and stop executing other promotions if this promotion applies successfully.
Default: true
currency_codestring
The ISO-4217-based transactional currency code to which the promotion applies OR * for all currencies.
Example: USD
notificationsarray[object]
Notifications to display on the storefront based on the result of the evaluation for promotion eligibility.
This field only has effect when the redemption_type is COUPON and can_be_used_with_other_promotions is false:
When the property is set to "true", the coupon will override the applied automatic promotions if it provides a greater discount.
When the property is set to "false", the coupon will not be applied if automatic promotions are already applied.
Trying to set the value of this field to "true" when the redemption_type is not COUPON, or when can_be_used_with_other_promotions is true will yield a 422 error response.
Default: false
metaobject
Empty meta object, which may be used at a later time.
example
JSON
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
{
"data": {
"name": "Buy Product X Get Free Shipping",
"display_name": "WOW!!! FREE SHIPPING for Product X",