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

Solved

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

Meowship
Shopify Partner
3 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

 

Accepted Solution (1)
SBD_
Shopify Staff
1830 273 418

This is an accepted solution.

Hey @Meowship + @trellus 

 

I got some more info on this from the delivery team:

 

---

 


If a rate request fails or times out, we might use the backup rates.

Scott | Developer Advocate @ Shopify 

View solution in original post

Replies 6 (6)

SBD_
Shopify Staff
1830 273 418

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 

Meowship
Shopify Partner
3 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?

 

SBD_
Shopify Staff
1830 273 418

This is an accepted solution.

Hey @Meowship + @trellus 

 

I got some more info on this from the delivery team:

 

---

 


If a rate request fails or times out, we might use the backup rates.

Scott | Developer Advocate @ Shopify 

Tatiana12
Shopify Partner
3 0 0

@SBD_ we are facing the same problem. What happens if customer doesn't want to use backup shipping rate. Is there a way to replace it?

Meowship
Shopify Partner
3 0 0

 

I realized I didn't accept your answer as I should. Thank you for taking the time to answer and connect with the delivery team.

Now I have enough information about how Shopify calculate the multilocation shipping rate to work with.

 

 

trellus
Shopify Partner
1 0 0

Having more details on the questions that Meowship are asking would be helpful to us at Trellus as well