Missing automatic discounts in checkout webhooks

This issue is two-fold. The first is that automatic discounts do not appear at all in checkout created/updated webhooks. Discount codes that are entered trigger checkout updated webhooks, but we miss the already-applied automatic discounts.

The second is that while the pixel does contain the automatically-applied discounts in its payload, it does not fire again when the user enters discount codes. If the user enters a discount and then edits something like contact info or shipping address, the pixel updates finally fire and do contain the entered discounts, but this is incredibly unreliable.

I would love to not have to rely on the pixel at all since it rarely fires due to Shop App checkouts not being able to fire pixel events.

One solution I found but dislike is to use the cart_token and fetch the current cart with graph QL. The issue with this method is the payload does not contain shipping discounts…

In any case I would need cumbersome logic to aggregate and merge discounts from the cart. Is there not a way to reliably get cart discounts from a single source? I’m talking all the discounts, including automatic, order-level, product/collection-level, and shipping.

Hi @Jake_Cahoon

If you can wait for order creation you can use orders/create as your single source of truth for all discounts. This is the most complete and reliable option.

If you need discount data during checkout, you could consider using a Checkout UI Extension with access to the discountAllocations and discountCodes APIs on the cart lines. Extensions have access to the real-time checkout state including automatic discounts.