A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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.
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
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.
I have same issue exactly.
any update on this issue? 🙂
Finally found some guide here https://community.shopify.com/c/shopify-apis-and-sdks/discount-codes-for-one-time-purchases-and-subs...
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.