PUT /V1/salesRules/:ruleId
PUT /V1/salesRules/:ruleId is a Magento 2 REST endpoint in the SalesRule module. Save sales rule. Requires an admin Bearer token with ACL Magento_SalesRule::quote.
Last verified: against Magento 2.4.9.
Returns
Magento\SalesRule\Api\Data\RuleInterface
Service contract
Magento\SalesRule\Api\RuleRepositoryInterface::save
Authorization
Admin Bearer token with ACL:
- Magento_SalesRule::quote
Body parameters
Example request
Auto-generated from the service contract — paste-ready against your store's /rest/default base. Replace the host, store code, ACL token, and any required values before running.
Headers
Path
/V1/salesRules/:ruleIdBody
{
"rule": {
"action_condition": {
"aggregator_type": "",
"attribute_name": "",
"condition_type": "",
"conditions": [
{}
],
"extension_attributes": {},
"operator": "",
"value": null
},
"apply_to_shipping": false,
"condition": {
"aggregator_type": "",
"attribute_name": "",
"condition_type": "",
"conditions": [
{}
],
"extension_attributes": {},
"operator": "",
"value": null
},
"coupon_type": "",
"customer_group_ids": [
{}
],
"description": "",
"discount_amount": 0,
"discount_qty": 0,
"discount_step": 0,
"extension_attributes": {},
"from_date": "",
"is_active": false,
"is_advanced": false,
"is_rss": false,
"name": "",
"product_ids": [
{}
],
"rule_id": 0,
"simple_action": "",
"simple_free_shipping": "",
"sort_order": 0,
"stop_rules_processing": false,
"store_labels": [
{
"extension_attributes": {},
"store_id": 0,
"store_label": ""
}
],
"times_used": 0,
"to_date": "",
"use_auto_generation": false,
"uses_per_coupon": 0,
"uses_per_customer": 0,
"website_ids": [
{}
]
}
}Related in SalesRule
Other endpoints shipped by the same module.
/V1/coupons
Save a coupon.
SalesRule · Magento\SalesRule\Api\CouponRepositoryInterface::save
/V1/coupons/:couponId
Delete coupon by coupon id.
SalesRule · Magento\SalesRule\Api\CouponRepositoryInterface::deleteById
/V1/coupons/:couponId
Get coupon by coupon id.
SalesRule · Magento\SalesRule\Api\CouponRepositoryInterface::getById
/V1/coupons/:couponId
Save a coupon.
SalesRule · Magento\SalesRule\Api\CouponRepositoryInterface::save
/V1/coupons/deleteByCodes
Delete coupon by coupon codes.
SalesRule · Magento\SalesRule\Api\CouponManagementInterface::deleteByCodes
/V1/coupons/deleteByIds
Delete coupon by coupon ids.
SalesRule · Magento\SalesRule\Api\CouponManagementInterface::deleteByIds
Every Magento dev tool, in one hosted workspace.
Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.