Help Needed: Preventing Discount Stacking with Cart Transform API Bundles

Hi everyone,

I’m currently using the Cart Transform API to create product bundles. The API merges multiple items into a single bundle and automatically applies a 10% discount to the bundle.

The issue I’m facing is that when a customer applies an order-level discount code (e.g., from promotions like Facebook/Instagram ads), the discount stacks on top of the 10% bundle discount. This results in a larger discount than intended, which I want to avoid.

Unfortunately, switching from order-level discounts to product-level discounts isn’t an option for us, as these codes are generated automatically by third-party apps like Facebook and Instagram.

Does anyone have suggestions on how to prevent this stacking issue while keeping the current setup?

Thanks in advance for your help!

1 Like

Hey @Jacob_Mellor - hopefully I’m understanding correctly here on my end, but updating the cart line items specifically might help be what you’re looking for (for example, when an order-level discount code is applied you could then adjust the line item’s price directly using the update operation there as needed)

Let me know if this doesn’t work for you and I’d be happy to dig in further - hope this helps!

Thank you for your response however it won’t work. I am using the merge operation so update operation won’t work on the same line items.

Also, in the function input, I don’t think there is a way to know if a discount code is applied or not and if we don’t know that, we cannot add any conditions.

No worries - thanks for clarifying - I’ll do a bit more digging into this on my end and loop back with you if I can share an answer :slight_smile: