Shipping Calculation for carrier services using API in my private app

Shopify Expert
4 0 0

Hi,

 

I'm creating a private app for one of my client which require us to calculate shipping within the app.  I'm this API for calculation 

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

 

I have all data ready to post the shipping request but I'm unable to get the call back URL on which I have to sent this data and calculate shipping. When I'm trying to fetch the carrier services, it is giving me following response

 

{
"carrier_services": [{
"id": som_id,
"name": "dhl_express",
"active": true,
"service_discovery": true,
"carrier_service_type": "legacy"
}, {
"id": som_id,
"name": "ups_shipping",
"active": true,
"service_discovery": true,
"carrier_service_type": "legacy"
}, {
"id": som_id,
"name": "usps",
"active": true,
"service_discovery": true,
"carrier_service_type": "legacy"
}]
}

 

but I'm not seeing any URL on which I have to send the shipping data

0 Likes
Highlighted
Explorer
139 6 14

Hello @Nick52 ,

There is  a solution to this request, but there is already an app that calculates shipping within the app - would you like to jump on a call to discuss?  

0 Likes
Highlighted
Shopify Partner
149 9 23

Hey @Nick52,

 

It appears that you are looking to run the shipping calculation through an installed carrier service.  Shopify blocks the callback_url for carrier services from the public for privacy reasons. 

 

There is still a way to request rates using the Shopify Ajax API.  This would require you to add products you wish to use for the calculation to a temporary cart, then request shipping rates while passing the shipping address details in the call url:

/cart/shipping_rates.json?shipping_address%5Bzip%5D=K1N+5T2&shipping_address%5Bcountry%5D=Canada&shipping_address%5Bprovince%5D=Ontario

 

I hope this helps!

 

 

Regards,

Joel.

Co-Founder / CTO @ Intuitive Shipping Inc.
Intuitive Shipping | Automate Shipping Profiles
2 Likes
Highlighted
Shopify Partner
15 0 0

I agree with what the other guy said - there are apps that already calculate rates and beyond. I would say take a look at ShipperHQ. It allows merchants to apply all kinds of rules and conditions to live and custom rates, so they have full control over what they are charging customers for shipping. ShipperHQ accounts for all kinds of things like dimensional shipping, surcharges and discounts, multiple warehouses, LTL, pretty much anything that would affect your client's shipping strategy and rates.

0 Likes