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:
Thank you for your assistance
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
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?