[PriceRule] How to create Buy X, Get y and setting the minimum purchase amount via GQL?

Hello,

I’m trying to create a PriceRule via GQL. I found the relevant documentation at: https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/priceRuleCreate.

But I didn’t find a description in the documentation of creating Buy X, Get Y and setting the minimum purchase amount.

I found the description of creating Buy X, Get Y and setting the minimum purchase quantity, prerequisiteToEntitlementQuantityRatio and it works fine.

I tried to use prerequisiteToEntitlementAmountRatio, but it prompted me that Field is not defined on PriceRuleInput.

Hey @supportmay ,

I just found that there is now a dedicated gql mutation to create a buy x get y discount which support the minimum purchase amount. Please check this link: https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/discountCodeBxgyCreate

1 Like