Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

price_rule API not returning all codes

Solved

price_rule API not returning all codes

stant
Shopify Partner
10 1 0

I've been using the price_rule API to fetch ongoing promocodes for a while without issues.

And today I realized that the API doesn't fetch them all. I've managed to get a few more by filtering with the ends_at_min parameter, but some are still missing.

I'm verifying with the admin discount code page by filtering with the "Active" button, which shows all currently active promo codes (only around 40), but the API only returns 25 of them.

Is this a temporary bug? (it seemed to work before that)

Thanks

Accepted Solution (1)
stant
Shopify Partner
10 1 0

This is an accepted solution.

Hey sorry for the late reply, I didn't see the notification.

I ended up finding why: I was giving date limits to only fetch those that are not expired. But discount code with no time limit don't show up in this case, which makes sense.

View solution in original post

Replies 2 (2)

awwdam
Shopify Staff
249 42 38

Hey @stant,

Just wanted to grab a few more details here: Can you share example request body (GraphQL or REST json) and would you be able to provide an x-request-id response header from a request you feel is returning unexpected data? I will keep an eye out for that info to take a closer look - Cheers!

awwdam | 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

stant
Shopify Partner
10 1 0

This is an accepted solution.

Hey sorry for the late reply, I didn't see the notification.

I ended up finding why: I was giving date limits to only fetch those that are not expired. But discount code with no time limit don't show up in this case, which makes sense.