Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: [GraphQL] Price Rule API Issue with Buy X Get Y and minimum purchase amount setting

[GraphQL] Price Rule API Issue with Buy X Get Y and minimum purchase amount setting

CodartApp
New Member
7 0 0

Hello everyone.

I have been trying to fetch price rules with the GraphQL API and am having an issue.

Say I'm having this in my GraphQL call:

{
   priceRules(first: 10) {
      edges {
          cursor
          node {
               id
               title
               summary
               startsAt
               endsAt
              discountCodesCount
         }
      }
       pageInfo {
            hasPreviousPage
            hasNextPage
       }
    }
}

 

There seems to be no problem with this call, all price rules are fetched correctly, except for the price rules for any Buy X Get Y discounts having the minimum purchase amount setting!

I have searched everywhere in the forum and people said the GraphQL works, but actually it doesn't.

 

Anyone else having the same issue? 😞

Replies 2 (2)

csam
Shopify Staff (Retired)
267 40 51

Hi @CodartApp 

Thanks for letting us know about this - I'm seeing the same behaviour in my testing. I'm going to do some more investigation here and I'll let you know what I find.

 

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

IamSantosh
Shopify Partner
8 1 1

I'm also facing the same issue. priceRules GraphQL API returns all priceRules except the ones which are created in the Buy X Get Y Category with the Precentage (%) format (minimum purchase amount). If priceRule is created with the item format in Buy X Get Y category, they are appearing in response.

 

Did you find any solution @CodartApp