We are currently using the GraphQL API to handle discount code management and revenue calculation specifically for discount codes. We are facing a problem getting the orders for a discount code when there is more than one discount code applied.
Example: I created an order and applied 2 discount codes, TESTCODE-1 and TESTCODE-2.
Querying for TESTCODE-2 returns the expected result.
It seems like this query only checks the first discount code child and ignores all others. We tried to recreate this multiple times and it is always only the first discount_code in the array that yields results.
We are currently forced to fetch ALL orders from a timeframe because we were missing several orders for our revenue calculations due to this bug. Is there any possibility to circumvent this?
Thank you for your reply. I checked this solution and it doesn’t seem feasible to me but please correct me if I am wrong. As I understand it you need to explicitly set the tag value and it cannot be a dynamic value (i.e. the name of the discount code), right? So when we are working with hundreds of codes, that would mean creating a flow event for every single code?
We are currently using the approach you mentioned (query all orders and filter locally) but would like to reduce the filesize of the bulk queries since it doesn’t really make sense to download & parse 450mb files multiple times a day to fetch a few hundred orders.
Is there any chance that this bug will be fixed in the forseeable future?
I have logged this as a request to improve the API so querying discounts will be simplified, but for now the approach I recommended is the best option.