availableShippingRates language in draftOrderCalculate mutation

Hello,
My shop is in French with English enabled in secondary language. When I make a request to the admin api with draftOrderCalculate mutation, the shipping rates title are returned in English. How do I get these data in French or better in the customer locale?
Thanks for helping
Magali

1 Like

Hey @MCP_Webdesign

This is a known limitation currently. More context on that here, where I’ve passed this feedback on to our product teams:

Thank you for your response, I hope this feature will come soon.

I have already thought about using the cartCreate mutation on the storefront API but this solution doesn’t work. When I create a cart, deliveryGroups always returns an empty array.
It appears that this bug has already been identified but not resolved. Can you confirm?

Hye @KyleG-Shopify

My question is not about currency but about languages. I don’t understand why availables shipping rates are returning in english while my default store language is french!?
And furthermore your solution is not working because cartCreate mutation return an empty array as deliveryGroups.
I spent hours trying these requests that do not work properly and I really need it for a client.
Please help… thanks

Thanks for sharing that. The issue around the draft orders was specifically the buyer context not returned (presentment currency) and instead just the store currency.

Since your store language is default French and the titles are returned in English, that does seem unexpected. Are the titles in your shipping settings French or English?

Titles in our shipping settings are in French. And they are translated in translate&Adapt App.

Hey Magali,

Thanks for sharing that. I did some further testing. I set up a new development store, with the store default language as French.

I then added a single shipping rate with a french title. When I run a draft order calculate mutation, I am getting the french title returned as that’s the only option on the store.

I then added an english translation just as you have and published English to my market and then the response started returning the english title. Defaulting to English when it’s available does seem to be what’s happening. I will verify to find out for sure.

What I did notice is that adding the shippingLine.code to my response, this field will return the default from the shipping settings.

Hi again Magali,

I have some clarification here. To return the values for a specific language, you can include Accept-Language headers and it will return the title in your specified language.

{
   "Accept-Language": "fr"
}

Hi Kyle,

Thank you for spending time on this issue.

Hi again Kyle,

I just found the solution!

1 Like