GraphQL availableShippingRates & shipping discounts, how to handle?

Highlighted
New Member
2 0 1

Here is a scenario, I have a custom storefront and a discount code that gives 100% discount on shipping rates when the shipping costs less than $10. 

This works fine on Shopify native checkout see screenshot below.

Screen Shot 2020-09-29 at 4.11.44 pm.png 

Now, when using GraphQL to get the same checkout object to render my custom checkout experience I can't find a way to figure out how to apply the discount only to a certain shippingRates when rendering the screen, see GraphQL responses for checkout.discountApplications and discount.availableShippingRates

0cce1c6a-6712-4e30-be36-56253f39fa17.png

378bcc24-1942-4a63-9254-1e51964c17e8.png

Any help would be awesome!

Highlighted
New Member
2 0 1

We're currently facing the same problem. We're creating a custom checkout using the storefront API, but we're facing some issues with visualising a discount being applied to a shipping rate.
With the script editor, you can create a discount for a specific shipping rate. When using the storefront API, there's no way to link a shipping discount created with the script editor to a shipping rate.

However discounts being applied to a line item are collected in a discountAllocations array for each line item. Isn't this possible to do this as well for the shipping rates?