calculatedDraftOrder always returns empty array for availableShippingRates for Canadian address

Solved

calculatedDraftOrder always returns empty array for availableShippingRates for Canadian address

Meraj
Shopify Partner
2 0 1

Hello,

 

I am trying to get available shipping rates for my store. I have setup couple of products and created two zones - USA and Canada as below - 

 

Screen Shot 2023-01-25 at 8.40.44 AM.png

When I tried to fetch availableShippingRates using calculatedDraftOrder GraphQL API, it returns rates properly for US address as below -

 

Screen Shot 2023-01-25 at 8.39.53 AM.png

 

But when I use a Canadian address it returns empty array for availableShippingRates --

 

Screen Shot 2023-01-25 at 8.39.09 AM.png

 

I have same products, same configuration for both zones. So wondering what I am missing here? 

 

Could you please help?

 

Thanks,

-Meraj

Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1453 238 501

This is an accepted solution.

Hi @Meraj,

 

I wasn't able to replicate this behaviour on my test store, but have you checked to see if Canada is in the same market as the United States, and if not, how is the shipping is configured for the Canadian market?

 

If the discrepancy is due to a market specific shipping configuration I would also recommend explicitly setting the DraftOrderInput.marketRegionCountryCode and returning the marketName and marketRegionCountryCode fields to troubleshoot.

 

Hope that helps.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)

ShopifyDevSup
Shopify Staff
1453 238 501

This is an accepted solution.

Hi @Meraj,

 

I wasn't able to replicate this behaviour on my test store, but have you checked to see if Canada is in the same market as the United States, and if not, how is the shipping is configured for the Canadian market?

 

If the discrepancy is due to a market specific shipping configuration I would also recommend explicitly setting the DraftOrderInput.marketRegionCountryCode and returning the marketName and marketRegionCountryCode fields to troubleshoot.

 

Hope that helps.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Meraj
Shopify Partner
2 0 1

Thanks for reply and pointing to the right direction. This did solve the problem. It looks like my primary market was "US" but Canada was in international market which was not active. I created a new Canada specific market and also activated international market. Now shipping rates are returned for any country properly. 

 

Thanks for help!