Price Rule API problem

Groon
Shopify Partner
12 0 15

Hello, I'm having a very weird issue trying to create a discount, I want a buy X product and get Y product free. But with a minimum value to win.

 

Here is the discount:

 

https://www.dropbox.com/s/atmnq4od4bp4vxj/Screenshot%202019-03-25%2020.12.40.png?dl=0

 

Very simple, spent $99 and get 100% on Bioderma product.

 

But in the checkout it wont apply =(, its super weird, I have some experience creating discounts via API..this really seems to be a bug.

 

https://www.dropbox.com/s/fghe08fe8bhh3pn/Screenshot%202019-03-25%2020.13.16.png?dl=0

 

Im using this command to create the discount:

 

 

 

    ShopifyAPI::PriceRule.new(
      title: @@code,
      target_type: "line_item",
      allocation_method: "across",
      value_type: "percentage",
      value: "-100",
      customer_selection: "all",
      once_per_customer: true,
      starts_at: DateTime.now,
      usage_limit: 1,
      target_selection: "entitled",
      prerequisite_subtotal_range: {
        greater_than_or_equal_to: "99" 
      },
      "entitled_variant_ids": [variant_id_here]
    )

 

Replies 0 (0)