Skip to content

Create Catalog Rule

Creates a catalog rule — the Create Rule action on the admin Marketing → Promotions → Catalog Rules screen. Saving recomputes affected product prices in the background, so a new rule may take a moment to show on the storefront.

TIP

New here? Read the Catalog Rules overview for what a catalog rule does and how its fields behave.

Operation

OperationTypePurpose
createAdminMarketingCatalogRuleMutationCreate a catalog rule

Details

  • Requires an admin Bearer token and the marketing.promotions.catalog_rules.create permission.
  • The mutation returns the rule's scalar fields plus conditions.
  • channels and customerGroups are connections and do not resolve on a mutation payload — query the detail query (adminMarketingCatalogRule) afterwards to read them back.
  • The request still sends channels / customerGroups as plain id arrays (e.g. [1]); only the returned shape differs.

Input fields

FieldTypeRequiredNotes
nameStringYesRule name
descriptionStringNoFree-text description
startsFromStringNoStart date (YYYY-MM-DD) or null
endsTillStringNoEnd date (YYYY-MM-DD) or null; must be >= startsFrom
statusIntNo0 inactive / 1 active
sortOrderIntNoPriority — lower runs first
conditionTypeIntNo1 match all conditions / 0 match any
conditionsArrayNoProduct-attribute filters
endOtherRulesIntNo1 stops lower-priority rules from also applying
actionTypeStringYesby_percent, by_fixed, to_percent, to_fixed
discountAmountFloatYesDiscount value; capped at 100 when actionType is by_percent
channelsArrayYesNon-empty list of channel ids
customerGroupsArrayYesNon-empty list of customer-group ids

Released under the MIT License.