Error when trying to create BOGO Price Rule

Vadzim
Shopify Partner
66 2 9

I am trying to create a Price Rule that gives a 5% discount on one product if I buy another but I am getting an error 

item_prerequisites: must be empty if prerequisite_to_entitlement_quantity_ratio is not defined

Code:

$.post('/admin/price_rules.json', 
{
  "price_rule": {
    "title": "test",
    "value_type": "percentage",
    "value": "-5.0",
    "customer_selection": "all",
    "target_type": "line_item",
    "target_selection": "entitled",
    "allocation_method": "each",
    "starts_at": "2018-03-22T00:00:00-00:00",
    "prerequisite_product_ids": [
        962990800953
    ],
    "entitled_product_ids": [
        962990997561
    ],
    "prerequisite_to_entitlement_quantity_ratio": {
      "prerequisite_quantity": 1,
      "entitled_quantity": 1
    }
  }
});

 

Developer @ MageWorx | Explore our Shopify apps | Need theme customization or migration? Reach us at apps@mageworx.com
0 Likes
Sky93
New Member
1 0 0

Could you solve this problem? I have the same issue

0 Likes