SalesRules
Get rule by ID.
Path parameters
ruleIdstringRequiredExample:
(Required)
<integer>
Responses
200
OK
application/json
Responseobject
400
Bad Request
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
get
GET /V1/salesRules/{ruleId} HTTP/1.1
Host: {{baseurl}}
Accept: */*
{
"website_ids": [
"<integer>",
"<integer>"
],
"customer_group_ids": [
"<integer>",
"<integer>"
],
"uses_per_customer": "<integer>",
"is_active": "<boolean>",
"stop_rules_processing": "<boolean>",
"is_advanced": "<boolean>",
"sort_order": "<integer>",
"discount_amount": "<number>",
"discount_step": "<integer>",
"apply_to_shipping": "<boolean>",
"times_used": "<integer>",
"is_rss": "<boolean>",
"coupon_type": "<string>",
"use_auto_generation": "<boolean>",
"uses_per_coupon": "<integer>",
"rule_id": "<integer>",
"name": "<string>",
"store_labels": [
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
},
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
}
],
"description": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"action_condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"product_ids": [
"<integer>",
"<integer>"
],
"simple_action": "<string>",
"discount_qty": "<number>",
"simple_free_shipping": "<string>",
"extension_attributes": "<object>"
}
Save sales rule.
Path parameters
ruleIdstringRequiredExample:
(Required)
<string>
Header parameters
Content-TypestringOptionalExample:
application/json
Body
objectOptionalExample:
{"rule":{"website_ids":["<integer>","<integer>"],"customer_group_ids":["<integer>","<integer>"],"uses_per_customer":"<integer>","is_active":"<boolean>","stop_rules_processing":"<boolean>","is_advanced":"<boolean>","sort_order":"<integer>","discount_amount":"<number>","discount_step":"<integer>","apply_to_shipping":"<boolean>","times_used":"<integer>","is_rss":"<boolean>","coupon_type":"<string>","use_auto_generation":"<boolean>","uses_per_coupon":"<integer>","rule_id":"<integer>","name":"<string>","store_labels":[{"store_id":"<integer>","store_label":"<string>","extension_attributes":"<object>"},{"store_id":"<integer>","store_label":"<string>","extension_attributes":"<object>"}],"description":"<string>","from_date":"<string>","to_date":"<string>","condition":{"condition_type":"<string>","operator":"<string>","value":"<string>","conditions":[{"value":"<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"},{"value":"<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"}],"aggregator_type":"<string>","attribute_name":"<string>","extension_attributes":"<object>"},"action_condition":{"condition_type":"<string>","operator":"<string>","value":"<string>","conditions":[{"value":"<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"},{"value":"<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"}],"aggregator_type":"<string>","attribute_name":"<string>","extension_attributes":"<object>"},"product_ids":["<integer>","<integer>"],"simple_action":"<string>","discount_qty":"<number>","simple_free_shipping":"<string>","extension_attributes":"<object>"}}
Responses
200
OK
application/json
Responseobject
400
Bad Request
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
put
PUT /V1/salesRules/{ruleId} HTTP/1.1
Host: {{baseurl}}
Content-Type: application/json
Accept: */*
Content-Length: 1712
{
"rule": {
"website_ids": [
"<integer>",
"<integer>"
],
"customer_group_ids": [
"<integer>",
"<integer>"
],
"uses_per_customer": "<integer>",
"is_active": "<boolean>",
"stop_rules_processing": "<boolean>",
"is_advanced": "<boolean>",
"sort_order": "<integer>",
"discount_amount": "<number>",
"discount_step": "<integer>",
"apply_to_shipping": "<boolean>",
"times_used": "<integer>",
"is_rss": "<boolean>",
"coupon_type": "<string>",
"use_auto_generation": "<boolean>",
"uses_per_coupon": "<integer>",
"rule_id": "<integer>",
"name": "<string>",
"store_labels": [
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
},
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
}
],
"description": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"action_condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"product_ids": [
"<integer>",
"<integer>"
],
"simple_action": "<string>",
"discount_qty": "<number>",
"simple_free_shipping": "<string>",
"extension_attributes": "<object>"
}
}
{
"website_ids": [
"<integer>",
"<integer>"
],
"customer_group_ids": [
"<integer>",
"<integer>"
],
"uses_per_customer": "<integer>",
"is_active": "<boolean>",
"stop_rules_processing": "<boolean>",
"is_advanced": "<boolean>",
"sort_order": "<integer>",
"discount_amount": "<number>",
"discount_step": "<integer>",
"apply_to_shipping": "<boolean>",
"times_used": "<integer>",
"is_rss": "<boolean>",
"coupon_type": "<string>",
"use_auto_generation": "<boolean>",
"uses_per_coupon": "<integer>",
"rule_id": "<integer>",
"name": "<string>",
"store_labels": [
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
},
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
}
],
"description": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"action_condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"product_ids": [
"<integer>",
"<integer>"
],
"simple_action": "<string>",
"discount_qty": "<number>",
"simple_free_shipping": "<string>",
"extension_attributes": "<object>"
}
Delete rule by ID.
Path parameters
ruleIdstringRequiredExample:
(Required)
<integer>
Responses
200
OK
application/json
Responseobject
400
Bad Request
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
delete
DELETE /V1/salesRules/{ruleId} HTTP/1.1
Host: {{baseurl}}
Accept: */*
true
Save sales rule.
Header parameters
Content-TypestringOptionalExample:
application/json
Body
objectOptionalExample:
{"rule":{"website_ids":["<integer>","<integer>"],"customer_group_ids":["<integer>","<integer>"],"uses_per_customer":"<integer>","is_active":"<boolean>","stop_rules_processing":"<boolean>","is_advanced":"<boolean>","sort_order":"<integer>","discount_amount":"<number>","discount_step":"<integer>","apply_to_shipping":"<boolean>","times_used":"<integer>","is_rss":"<boolean>","coupon_type":"<string>","use_auto_generation":"<boolean>","uses_per_coupon":"<integer>","rule_id":"<integer>","name":"<string>","store_labels":[{"store_id":"<integer>","store_label":"<string>","extension_attributes":"<object>"},{"store_id":"<integer>","store_label":"<string>","extension_attributes":"<object>"}],"description":"<string>","from_date":"<string>","to_date":"<string>","condition":{"condition_type":"<string>","operator":"<string>","value":"<string>","conditions":[{"value":"<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"},{"value":"<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"}],"aggregator_type":"<string>","attribute_name":"<string>","extension_attributes":"<object>"},"action_condition":{"condition_type":"<string>","operator":"<string>","value":"<string>","conditions":[{"value":"<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"},{"value":"<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"}],"aggregator_type":"<string>","attribute_name":"<string>","extension_attributes":"<object>"},"product_ids":["<integer>","<integer>"],"simple_action":"<string>","discount_qty":"<number>","simple_free_shipping":"<string>","extension_attributes":"<object>"}}
Responses
200
OK
application/json
Responseobject
400
Bad Request
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
post
POST /V1/salesRules HTTP/1.1
Host: {{baseurl}}
Content-Type: application/json
Accept: */*
Content-Length: 1712
{
"rule": {
"website_ids": [
"<integer>",
"<integer>"
],
"customer_group_ids": [
"<integer>",
"<integer>"
],
"uses_per_customer": "<integer>",
"is_active": "<boolean>",
"stop_rules_processing": "<boolean>",
"is_advanced": "<boolean>",
"sort_order": "<integer>",
"discount_amount": "<number>",
"discount_step": "<integer>",
"apply_to_shipping": "<boolean>",
"times_used": "<integer>",
"is_rss": "<boolean>",
"coupon_type": "<string>",
"use_auto_generation": "<boolean>",
"uses_per_coupon": "<integer>",
"rule_id": "<integer>",
"name": "<string>",
"store_labels": [
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
},
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
}
],
"description": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"action_condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"product_ids": [
"<integer>",
"<integer>"
],
"simple_action": "<string>",
"discount_qty": "<number>",
"simple_free_shipping": "<string>",
"extension_attributes": "<object>"
}
}
{
"website_ids": [
"<integer>",
"<integer>"
],
"customer_group_ids": [
"<integer>",
"<integer>"
],
"uses_per_customer": "<integer>",
"is_active": "<boolean>",
"stop_rules_processing": "<boolean>",
"is_advanced": "<boolean>",
"sort_order": "<integer>",
"discount_amount": "<number>",
"discount_step": "<integer>",
"apply_to_shipping": "<boolean>",
"times_used": "<integer>",
"is_rss": "<boolean>",
"coupon_type": "<string>",
"use_auto_generation": "<boolean>",
"uses_per_coupon": "<integer>",
"rule_id": "<integer>",
"name": "<string>",
"store_labels": [
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
},
{
"store_id": "<integer>",
"store_label": "<string>",
"extension_attributes": "<object>"
}
],
"description": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"action_condition": {
"condition_type": "<string>",
"operator": "<string>",
"value": "<string>",
"conditions": [
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
},
{
"value": "<Circular reference to #/components/schemas/sales-rule-data-condition-interface detected>"
}
],
"aggregator_type": "<string>",
"attribute_name": "<string>",
"extension_attributes": "<object>"
},
"product_ids": [
"<integer>",
"<integer>"
],
"simple_action": "<string>",
"discount_qty": "<number>",
"simple_free_shipping": "<string>",
"extension_attributes": "<object>"
}