Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Price rule not working

Price rule not working

Nortski
Shopify Partner
20 0 5

I have created a price rule using GraphQL but nothing seems to be happening. I received no errors when I created it but the rule doesn't seem to getting applied.
Basically, when a specific product has more than 9 in the cart then £1.00 should be deducted from each item:

mutation priceRuleCreate($priceRule: PriceRuleInput!, $priceRuleDiscountCode: PriceRuleDiscountCodeInput) {
    priceRuleCreate(priceRule: $priceRule, priceRuleDiscountCode: $priceRuleDiscountCode) {
      priceRuleUserErrors { field, message, code }
      priceRule {
        id,
        title
      }
      priceRuleDiscountCode {
        id
        code
      }
    }
  }

Variables:

{
  "priceRule": {
  	"title": "price rule 1",
    "allocationMethod": "EACH",
    "customerSelection": {
        "forAllCustomers": true
    },
    "itemEntitlements": {
    "targetAllLineItems": false,
    "productIds": [
      "gid://shopify/Product/6804610678877"
    ]
   },
  "prerequisiteQuantityRange": {
    "greaterThan": 9
  },
  "target": "LINE_ITEM",
  "validityPeriod": {
    "start": "2022-05-26T08:00:00-04:00"
   },
  "value": {
    "fixedAmountValue": "-1.00"
  } 
}
}
Replies 0 (0)