Does anyone know why Shopify does not send discounts in the following carrier service request: CarrierService?
Hi @Brad_Kubie,
The Carrier Service Request sent is meant specifically to send the needed information for shipping services to calculate and provide estimated shipping rates during checkout. It isn’t meant to send all information on a checkout or cart, just the information needed to calculate shipping.
If your app needs to know the discounts applied during checkout as well, I may suggest subscribing to the checkouts/update webhook to get notified when a checkout is updated with information including applied discounts.
That makes sense, but what if the shipping rates I am returning are based on cart subtotal? A discount would potentially push the shipping rate into a different shipping tier. I am not sure the checkouts/update hook would work because the Carrier Service Request will have no knowledge of the checkouts/update. All I am saying is the prices that Shopify is sending in the Carrier Service Request should reflect all totals within the cart/checkout inclusive of discounts.
That use case definitely does seem valid, and I’ll be submitting some feedback on your behalf that you’d like to see discounts included in the Carrier Service Request in the future.
In the meantime, you can potentially use the checkouts/update webhook in addition to the Carrier Service Request, with your app in the back end caching checkout updates received from the webhooks, and referring to the cached data when you receive a Carrier Service Request, using the shipping address, line item, and timestamp to link a specific checkout update to a Carrier Service Request.
Thanks I appreciate you submitting feedback about this and you quick responses!