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 36

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.