Re: Price rule PURCHASE TYPE API

Price rule PURCHASE TYPE API

sil2
Tourist
4 0 2

We are creating price rules using Shopify API, but there is no control of PURCHASE TYPE property for price rules, only for basic discount codes.

 

By default it's "one time purchase", but we need to be able to create and update prices using your API to set PURCHASE TYPE to both.

Replies 6 (6)

KB77
Shopify Staff
59 6 11

Hey @sil2 I took a look at our docs and you are correct that there is not an option to control Purchase_Type for price rules. The solution that looks appropriate here might be https://shopify.dev/api/admin-graphql/2022-04/input-objects/DiscountCustomerGetsInput

If you have a use case for needing the purchase_type option in price rules please let us know, Id be happy to pass on feedback to our teams on your behalf.

 

Hope this helps. -K

KB77 | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Groon
Shopify Partner
15 0 17

I have a case where I need "purchase_type" to be available on the PriceRule Rest API:

I have a customer using a subscription product with my discount app and he can't apply our discount in his order because the API do not allow me to change the "purchase_type" to "both". 

 

He simply switched the value to "both" in Shopify Admin and saved our discount, after that our discount can be applied in the order, the default value should be "both" (I don't see why not), or the REST API should have the option to create the order with this attribute.

sil2
Tourist
4 0 2

I have same issue exactly. 

aldrien
Shopify Partner
19 0 2

any update on this issue? 🙂

aldrien
Shopify Partner
19 0 2
sil2
Tourist
4 0 2

We create price rules from our backend using Shopify GraphQL API. Because we can not set 'Purchase_Type' somebody needs to login into Shopify backend and change this parameter to 'both' manually every time.  Sorry, but im not getting now 'DiscountCustomerGetsInput' can help.