Retrieving package measurements for shipping rate calculation

Retrieving package measurements for shipping rate calculation

ExaltedBovine
Shopify Partner
1 0 0

I'm a developer trying to build an embedded Shopify app to calculate shipping rates at checkout. For this, I need to get the package weight and measurements. Currently, the JSON payload that Shopify sends me is as follows:

ExaltedBovine_0-1723567366054.png

 

 But as pictured above, it's not currently sending the measurements of the package, which I require to calculate the cost. Making a quote solely based on the weight would greatly overestimate or underestimate the cost to the user's detriment, as couriers charge based on the dimensional weight. For this to work at all I understand you need to set a default saved packaging in the Admin panel, which I have set to a 30x30x30 cardboard box.

 

My specific queries are:

 

  1. Is it possible to retrieve the default packaging via REST | GraphQL?
  2. Is it possible to set and retrieve product measurements with the goal of determining if N products will fit in a given saved packaging, if at all? If not, then
  3. Is it possible to associate a saved packaging with a given product or products?

It seems very odd that I couldn't find any documentation on any the above, except for a GraphQL mutation named shippingPackageMakeDefault (shopify.dev). Any pointers would be greatly appreciated and naturally I'd like to avoid relying on third-party apps.

Replies 0 (0)