How Does Shopify Determine the "Origin" Location for CarrierService Rate Requests ?

Shopify Partner
2 0 0

Dear Shopify Friends,


I am in the process of integrating a custom carrier service n for my Shopify store using the CarrierService API, with guidelines outlined here (Shopify Admin API - CarrierService).


I am currently able to receive shipping rate requests to my CarrierService Webhook callback URL. However, I have encountered a scenario that is not explicitly addressed in the documentation. For products that are available at multiple inventory locations, I don't understand how the "origin" location is selected by Shopify when initiating a shipping rate request to my CarrierService. My guesses are:


- Shopify chooses the "origin" based on the inventory availability
- If there are multiple candidates, Shopify chooses the earliest-created location 


I have observed this behavior but would really appreciate it if you could confirm / provide more information about this subject matter:


  1. How does Shopify determine which location to use as the "origin" for shipping rate calculations, particularly for products available at multiple locations?
  2. Is there an established hierarchy or set of rules that Shopify follows in such cases?


Thank you for your assistance


Replies 2 (2)
Shopify Staff
Shopify Staff
1597 226 333

Hey @Meowship 


If there are multiple location, Shopify will use the one closest to the shipping address.


Let me know if this clears things up!

Scott | Developer Advocate @ Shopify 

Shopify Partner
2 0 0

Hi SBD_,


thank you for the quick reponse



we tested and verified the behavior, and there are some minor exceptions to the rule you mentioned. But we believe this is due to the distance calculation method used under the hood.(We have found that if the HereMap API is used to measure distance, everything seems to work as intended.)


Please provide your insight on this follow up question as well:

If an order contains multiple products from multiple locations, Shopify sends multiple shipping rate requests for that order, with different origin and destination addresses. We have observed that Shopify displays the earliest rate response to the buyer. Is this true? Are there any other rules?