Custom Carrier Services

Shopify Partner
10 0 0

Hi, can someone help me on how to get orders details before the customer make payment so, I can calculate the shipping price for the orders.

0 Likes
Trailblazer
195 0 84

CarrierService API is down today it seems, effecting production stores (and i think USPS)

0 Likes
Shopify Partner
10 0 0

Bttw, do you know how can I get Shopify Data  so I can calculate shipping price using my own custom carrier service?

0 Likes
Highlighted
Trailblazer
195 0 84

It's pretty easy to implement if you're a developer.


The API documentation is here:
https://help.shopify.com/api/reference/shipping_and_fulfillment/carrierservice

With that said, I'd highly recommend looking at this next week as carrierService API is having issues this week and the API is not currently reliable. So you'll run into problems, which normally would not exist.

See this incident report:
https://status.shopify.com/incidents/k0wskw6lfgk0

You can follow along here with when this will be resolved:
https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/custom-carrier-service-not-requesting-...

I personally use AWS Lambda using serverless.com framework for my code. The good thing about this, is if you implement it this way, you should be under lambda rate limit in the free tier, so it won't cost you any money to run. I didn't know this when I implemented it myself, but I haven't paid in 2+ years.

0 Likes
Shopify Partner
10 0 0

Hi Jordan,

Do I need to call some API to get the order data or I need to do something else? Btw can you see my code here I'm actually stuck at getting the order data because I finally realize the data that I get was order that had been paid. I'm creating private app.

Here the url: "https://github.com/MirFaith/Ondemand_Rate"

0 Likes
Trailblazer
195 0 84

You need to host your code on your own servers.

Then you use this API request to point shopify to your CarrierService Endpoint URL

Then you need to enable your new shipping option in your stores shipping methods.

 

Then when a customer is checking out and Shopify is attempting to calculate the shipping price,  shopify will send over the order data to your CarrierService Endpoint URL, and you need to return shipping rates for that order.

Does that make sense?

0 Likes
Shopify Partner
10 0 0

If I can register my custom carrier service it means I can use carrier service API right? Because right now I want to know why did the shipping method didn't appear at checkout pages. My shop currently using custom/monthly plan. 

0 Likes
Trailblazer
195 0 84

Straight from: https://help.shopify.com/api/reference/shipping_and_fulfillment/carrierservice

Requirements for accessing the CarrierService resource

To access the CarrierService resource, add the write_shipping permission to your app's requested scopes. For more information, see API access scopes.

The store installing your carrier service must also meet one of the following requirements:

  • It is on the Advanced Shopify plan or higher.
  • Its Shopify plan is paid annually.
  • It is a development store.

You're gonna have to do some reading yourself man, i can't be your brain. I told you, you need to enable it after registering it in the shipping settings for your store.

0 Likes
Shopify Partner
10 0 0

I already enabled it I think there might be some problem with the server because sometimes my carrier service will show and sometime it will not show.

0 Likes
Trailblazer
195 0 84

As mentioned Mir, carrierService is having issues currently.

I believe they're mostly worked out, but bugs you may be experiencing may be a problem with Shopify currently and not your fault. As mentioned, you can follow along here:
https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/custom-carrier-service-not-requesting-...

 

Additionally with carrierServices, results will be cached. So for Customer A, they get a carrierService rate, and you change the code, they will not get a new rate. It will be cached for that customer.

There are two ways to avoid this:

1. Change the contents of the cart. That will get a new rate from your server
2. Delete & re-add your carrierService API endpoint. This will also remove the cache. 

0 Likes