What triggers a call to Custom Carrier Service?

Highlighted
Shopify Partner
12 0 1

https://help.shopify.com/en/api/reference/shipping-and-fulfillment/carrierservice

 

so we're using the above, and we're using a custom call back url (webhook) to receive the shipping rate request from shopify. but what we're seeing is that 2 calls are being made to the webhook each time a user goes to the shipping rates page in checkout. so directly after selecting a shipping address and hitting continue to shipping button.

 

we're not sure what triggers the call to the webhook (assuming some JS call)

 

has anyone else seen this before? 

0 Likes
Shopify Staff
Shopify Staff
1087 75 140

Hey @Kele_Nakamura , 

 

In preparation for our coming delivery profiles feature, we've setup a rate comparison system to ensure shipping rates are consistent before and after the move to profiles. This will result in two (nearly) identical requests being sent to test that the response is the same to each.

 

As long as you are responding with the same rates to each of the two requests, this is intentional behaviour and nothing to worry about - if you had been responding with different rates to each request there's a chance that someone from Shopify would get in touch to ask for some details on what happened.

 

Once the feature has launched, you may end up getting multiple requests in the event a shop has multiple products shipping to/from multiple locations. But at this point in time this is meant more as a precaution to ensure that the launch won't cause major issues for apps and merchants.

 

 

0 Likes
Shopify Partner
12 0 1
okay so this is just a recent change, and thats why we're now seeing 2 calls to the carrier service (as we never did before)? so moving forward this is always going to happen, even if we're not using shopify to provide rates, but we're using the custom carrier service? it just seems excessive to the webhook/api we have set-up for custom carrier to receive 2 calls back to back. the issue is, since there is the 10 sec limit that checkout will wait for a response from custom carrier webhook, before it just shows a "no rates" exist message, which essentially blocks a user from checking out, because there is no option to re-request rates, or display default rates or anything. so we have to display a refresh button and in the webhook server we try to cache the original response we get back from the shipping apis, so when a user re-requests the carrier webhook, that cached response can be sent back in < 10 secs. i don't think the webhook server was expecting 2 back to back calls so quickly, so we're getting strange results.
0 Likes
Shopify Staff
Shopify Staff
1087 75 140

Hey again @Kele_Nakamura , 

 

It is somewhat recent, yes, but moving forward it won't necessarily be exactly the same. Right now, there will be two requests sent. But going forward once the delivery profiles feature launches it is possible that there can be even more than two, and they won't be the same like they are right now either. 

 

If a shop has multiple delivery profiles and products shipping from multiple locations, there will be carrier service requests for each of them

0 Likes
Shopify Partner
12 0 1

so is there any way to set up the store to have a single origin at the moment? and not have multiple calls happening?

 

its definitely having an adverse affect on the custom carrier service endpoint we have set-up.

0 Likes
Shopify Staff
Shopify Staff
1087 75 140

Hey again @Kele_Nakamura , 

 

I believe this can be done, but am not familiar with how just yet. Once this feature launches the multiple requests will be able to happen on a regular basis depending on how a shop is set up anyway, though. Is your app only being used on one store, and is that the long-term plan going forward if so? If not, setting a shop to single-origin may not be of much use anyway. If you're only planning to use it on one shop though, then I can look into how to set this up for you.

0 Likes
Shopify Partner
12 0 1
yes its a custom web hook endpoint for a specific shop. basically its to interface with the clients ERP system to return shipping quotes.

so all the logic is handled in the web hook for multiple warehouses. so none of this logic needs to be handled on the shopify side.

it just needs to send the items and destination to the custom carrier web hook. and preferably only make a single call each time.

thanks Kele.
0 Likes
Shopify Partner
12 0 1

Hi @Josh 

 

Wondering if you've found any way for us to turn off the double calls?

 

Thanks Kele.

0 Likes
Shopify Staff
Shopify Staff
1087 75 140

Hey @Kele_Nakamura , 

 

Sorry for the delay here - are you able to confirm you're still seeing the double requests at this point though? I wasn't able to replicate any longer when trying to confirm that I'm able to stop the behaviour. 

0 Likes
Shopify Partner
12 0 1

yes we're still seeing a second call come in usually around 3 to 4 millseconds after the 1st call.

0 Likes