We need to find a way how to set previously assigned checkout shippingRateHandle to blank. We struggle to do it via checkoutShippingLineUpdate mutation in Storefront API
Here is the scenario which leads to that
Our store has a combination of products which require shipping and digital products which don’t require shipping
-
Customer adds items which require shipping to cart. For which we create a new checkout via storefront and set items via checkoutLineItemsAdd
-
Customer sets his shippingAddress, which we save via checkoutShippingAddressUpdateV2
-
After that we get availableShippingRates and assign one via checkoutShippingLineUpdate
-
At this point in journey, customer decides that he wants to change items. She goes back and change items. Removes those which require shipping and leaves only digital. We update it via checkoutLineItemsReplace
-
Surprisingly when items requiring shipping are removed, shippingLineItem is still assigned to checkout. So here is where we need to find a way how to blank previously assigned shippingRateHandle/shippingLineItem.
We are trying the following options to pass to mutation checkoutShippingLineUpdate
1. “shippingRateHandle”: “” - empty string. Which gets en error
{
"errors": [
{
"message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 8699873e-a700-4841-b7e9-a2fa12a83c71 (include this in support requests)."
}
]
}
2. If we try to assign anything else to “shippingRateHandle” it gets error
"checkoutUserErrors": [
{
"code": "PRESENT",
"field": [
"shippingRateHandle"
],
"message": "Shipping rate must be blank"
}
]
Hence my question
What is the right way to remove assigned shippingRateHandle from a checkout or assign it to blank?