Successfully created PriceRules are not visible

Maxli
Visitor
3 0 0

Hello there,

 

we found a serious problem with price rules that are created through REST and GraphQL API. Using GraphQL (2019-10), the price rule is successfully created, API returns id of the new price rule, but the price rule is not listed when calling priceRules query, no matter what parameters we tried. However it is visible in REST API (Odd?).

 

However, no matter what, the price rule is not being applied to the orders. We tried both, examples from API docs, and our parameters, to create price rules, using REST and also GraphQL, but the price is still the same.

 

Selection_128.png

Replies 3 (3)

Maxli
Visitor
3 0 0

Any help? This is very urgent. We are still experiencing this issue. We already contacted the Shopify support, but they were unable to help us and forwarded our request to tech support, but we did not receive any message since then.

 

It seems that the there are at least 3 bugs in the PriceRules' API:

https://community.shopify.com/c/Shopify-APIs-SDKs/Price-Rule-API-problem/td-p/494566

https://community.shopify.com/c/Shopify-APIs-SDKs/Price-Rules-not-working-as-expected/td-p/495805

https://community.shopify.com/c/Shopify-APIs-SDKs/Price-Rule-API-Automatic-Price-Adjustments/td-p/44...

hassain
Shopify Staff (Retired)
624 104 187

Hey @Maxli ,

 

To address your first point:

Using GraphQL (2019-10), the price rule is successfully created, API returns id of the new price rule, but the price rule is not listed when calling priceRules query, no matter what parameters we tried. However it is visible in REST API (Odd?).

 

Using the GraphQL Admin API `priceRules` query root, it will only return price rules in which the DiscountCodesCount is greater than or equal to one. This is the intended behaviour, and would probably explains why you are unable to see the price rules listed upon newly creating them. You would need to add the price rules to discount code using another GraphQL mutation (`priceRuleDiscountCodeCreate`) in order to get the DiscountCodesCount of that price rule to at least be 1, and after that you should be able to see it in the `priceRules` query with no issue.

 

However, no matter what, the price rule is not being applied to the orders. We tried both, examples from API docs, and our parameters, to create price rules, using REST and also GraphQL, but the price is still the same.

 

You are not meant to apply price rules directly to orders. The only intended functionality of price rules is that they are used to create Discount Codes. Once you have a created a discount code based on your price rule, you can then apply that discount code to your order and if the rules match up the discount will be applied. I have just tested this process now on my test store, and can verify this is still working as intended. However if this is the same process you are performing, and you still are having issues with seeing the discount code applied, please let me know.

 

To learn more visit the Shopify Help Center or the Community Blog.

Maxli
Visitor
3 0 0

@hassain Thank you for the reply. This is very bad. According to the GraphQL API docs, one can create PriceRule without any discount code specified in the request and there is no mention that the PriceRules serve only purpose for discount codes, i.e. that you can not use PriceRules alone. There is no mention that priceRules() query returns only price rules with discount codes attached. Its odd behaviour, as it should return all existing/filtered price rules. Same behavior as with other objects.

 

Also, all created price rules have status 'Active'. How could any price rule can be active, when I created it without any discount codes?

 

So basically, if I understand correctly, PriceRules are useless without Discount codes and there is no way how could someone change prices dynamically and per customer without using a discount code?

 

I have a (tagged) group of customers, that should have a specific discount, e.g. whole sale. How can I lower the price for them? Without using discount code and automatic discount, as there is no option to specify target/customers.

 

Thank you for the reply.