1 | No | API | URL | Method | Header | Payload | Respond | Error code | Validation |
---|---|---|---|---|---|---|---|---|---|
2 | 1 | Get the rule info via rule ID using API sale rule default attached store view | {{base_url}}/rest/V1/salesRules/:ruleId | GET | Content-Type : application/json | Return the rule information. Example { "rule_id": 3, "name": "222222222222222220% OFF Ever $200-plus purchase!*", "store_labels": [], "description": "Shopping cart price rule for the cart over $200. Does not applied on other sales items", "website_ids": [ 1, 2 ], "customer_group_ids": [ 0, 1, 2, 3 ], "from_date": "2021-05-27", "uses_per_customer": 0, "is_active": true, "condition": { "condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Combine", "conditions": [ { "condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Address", "operator": ">", "attribute_name": "base_subtotal", "value": "10" } ], "aggregator_type": "all", "operator": null, "value": "1" }, "action_condition": { "condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Product\\Combine", "aggregator_type": "all", "operator": null, "value": "1" }, "stop_rules_processing": false, "is_advanced": true, "sort_order": 0, "simple_action": "by_percent", "discount_amount": 20, "discount_step": 0, "apply_to_shipping": false, "times_used": 2, "is_rss": true, "coupon_type": "NO_COUPON", "use_auto_generation": false, "uses_per_coupon": 0, "simple_free_shipping": "0", "extension_attributes": { "store_ids": [ 4 ] } } | 400 bad request | require: ruleId | |
3 | 2 | Add rule | {{base_url}}/rest/V1/bssGiftCard/checkCode | POST | Content-Type : application/json | {
"rule": { "name": "22Test API1", "website_ids": [ 1 ], "customer_group_ids": [ 0,1,2,3 ], "uses_per_customer": 0, "is_active": true, "stop_rules_processing": false, "is_advanced": true, "sort_order": 10, "discount_amount": 1000000, "discount_step": 1, "apply_to_shipping": false, "times_used": 0, "is_rss": true, "coupon_type": "NO_COUPON", "use_auto_generation": false, "uses_per_coupon": 0, "extension_attributes": { "store_ids": [4,3] } } } | Rule Information { "rule_id": 92, "name": "22Test API1", "store_labels": [], "website_ids": [ 1 ], "customer_group_ids": [ 0, 1, 2, 3 ], "uses_per_customer": 0, "is_active": true, "condition": { "condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Combine", "aggregator_type": "all", "operator": null, "value": true }, "action_condition": { "condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Product\\Combine", "aggregator_type": "all", "operator": null, "value": true }, "stop_rules_processing": false, "is_advanced": true, "sort_order": 10, "discount_amount": 1000000, "discount_step": 1, "apply_to_shipping": false, "times_used": 0, "is_rss": true, "coupon_type": "NO_COUPON", "use_auto_generation": false, "uses_per_coupon": 0, "simple_free_shipping": "0", "extension_attributes": { "store_ids": [ 3, 4 ] } } | 400 bad request | require payload |