Determine shipping profile used for each line item

I need to know the shipping profile used by Shopify to determine the shipping rate for a specific line item on an order. The only option I can find is to infer the profile by comparing it to the calculated rate but this does not work for my case. I’ve looked extensively at the various APIs, Shopify Functions, and Shopify Scripts but I cannot find any way to see the profile used. Any ideas?

Hey Ross,

Digging into this, but if you can explain your use case a bit more and why comparing to calculated rate wouldn’t work, that would be helpful.

We use ShipperHQ to fetch shipping quotes at checkout. ShipperHQ will usually provide a specific and descriptive ship method code for each quote which we sync to our downstream systems (ERP, WMS, Shipping) when the order is placed. The warehouse needs to know which ship method the customer paid for. Usually the ship method provided by shipperHQ can be easily mapped to a corresponding method in our downstream systems. However, when an order contains line items that belong to two (or more) different shipping profiles, ShipperHQ combines the two ship methods into a single rate with a single generic ship method: “Shipping”. This generic method cannot be mapped to a corresponding method in our downstream systems. For example, one line item may need to be shipped LTL, while other line items can ship ground. There is no way to know by looking at the combined rate or the generic shipping code that an order contains a line item that needs to be shipped LTL. These orders end up in our warehouse and shipping software with incorrect ship methods.

Shopify does not provide the shipping profile used anywhere on the order object.

Shopify functions can interact with rate quotes, but there is no way to see which shipping profile was used to generate the rate.

ShipperHQ does not provide a way to query previous quotes.

Still digging into this, but it does look like since Shopify doesn’t directly expose the shipping profile used for a specific order in the order object it might be challenging to get the info you need.

You may need to explore implementing custom logic in your app to map shipping methods to downstream systems based on product attributes or other metadata.

Thanks @Liam-Shopify. Any luck with this?