Calculated shipping rates not working

Solved
ValentinMercier
Tourist
10 1 0

I'm on a developer account and try to offer custom shipping rates that I retrieve from an HTTP request made to one of my own Server. 

 

Let's call that endpoint : https://my_server.com/calculated_shipping_rates

 

When I call that endpoint through a curl : 

 

curl -X POST \                                                             

  https://my_server.com/calculated_shipping_rates

  -H 'Content-Type: application/json'

 

I have a valid response and I retrieve a JSON object with shipping rates. 

 

I created a new carrier service ("My Custom Rates Service") through the RestApi (/admin/api/2020-04/carrier_services.json). 

 

Then I configured a shipping zone (France) and added a calculated rate to that zone (Use carrier or app to calculate rates). I selected "My Custom Rates Service" as Carrier.

 

When I create an order and go to checkout, I got an error Message saying that there are no shipping to France.

 

Screenshot 2020-05-17 at 14.03.54.png 

My endpoint isn't even call by Shopify (I checked it through multiple logs).

 

It seems that I made a mistake or forgot to configure something but I cannot see what it is. Your help would be much appreciated !

 

0 Likes
ValentinMercier
Tourist
10 1 0

I wonder if there is a way to access any kind of log of what happens when Shopify Back end is trying to find a shipping rate ? Any idea ? 

0 Likes
_JB
Shopify Staff
Shopify Staff
760 89 169

Hey @ValentinMercier,

 

There's a few things you can check. Make sure the product you're using on the test order is classified as a physical product that requires shipping, and make sure you use a different address in the checkout each time you test. The checkout caches carrier rates for 15 mins, so changing the address ensures the checkout polls your app each time.

 

If you're still having trouble with it, please provide the checkout token for a checkout you observed the issue on, and I can check our logs for further details.

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me 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

0 Likes
ValentinMercier
Tourist
10 1 0

This is an accepted solution.

Hi _JB, thanks for the reply. 

 

In fact I found the problem it was a certificate issue. The server where I deployed my rates API was a server with a certificate issued by Sectigo Limited and it seems not to be recognized by Shopify. 

 

I tried to deploy the same API on a server with a certificate issued by Let's Encrypt and it worked. 

 

It was quite painful to find the issue as there are no log at all. Some logs of the server sides processes and stuff would be much appreciated !!

0 Likes
czupet
Shopify Partner
9 0 0

I am trying to do the same thing as you did, but first I need to find information on how to set that up on Shopify end.

Can you point me where I can find documentation on how to display the rates from my server?  I don't know how to setup Shopify web page so it will call my server and then display the returned data. So I need some documentation on how to do that.

0 Likes