Discount codes shows twice on discount report

Hello everyone,

We have a Shopify merchant reach out to us to ask why Discount Codes generated in our app are showing up twice on their Shopify’s Revenue per Discount report.

Our app’s discounts are using the Shopify Functions API.

One of the discounts have an ID “1833375924566”

We’d love to know what could have caused this.

Thank you in advance.

As a first guess as to how that might be possible, is that they could have a column with different values, for example if they have added ‘discount line id"‘:

1 Like

Hi Sammy, thanks for your response.

The issue turned out to be neither a bug in Shopify nor in our app. It came down to the merchant’s SQL query for this report.

They had GROUP BY discount_name, discount_method, discount_type, discount_class. The kicker here is discount_type - Complex discounts (like from most Shopify Functions apps) can easily contain either percentage or fixed amounts in the same proposal. So, grouping by discount type (percentage/fixed amount) can result in separate rows for the same discount code.

I hope this helps someone in the future!