Retrieving Shipping Costs via API

LukeG
Excursionist
20 1 10

Hi there, thank you for your response.

 

I'am using node.js on the backend and had trouble querying for this verb(s). Turns out it's only availbale when you use the order endpoint:

GET /admin/api/2020-10/orders/450789469/events.json 

 However the offical node.js library does not support this endpoint yet so I had to implement that on my own. 

 

The query itself is quite straight forward:

let params = {
verb: "shipping_label_created_success"
};

const shopify = new ShopifyAPI({
apiVersion: '2020-10',
shopName: url,
accessToken: auth_token,
autoLimit: true
});

let events = await shopify.event.list(orderID, params)

console.log(events);

 

I hope this helps,

0 Likes
nathanaa
Tourist
4 0 6

Is the events API and parsing text from a log entry, still the only way to get shipping costs? 

0 Likes
Shivpal
Shopify Partner
6 0 3

Is there any other api which can provide us the shipping cost in any specific node?. Currently we need to parse this from events.  

Webgility1
Excursionist
33 1 6

Any new api to get the Shipping Costs? 

sethness
Tourist
7 0 2

wouldn't that be nice!!

 

But, as far as I can tell, there is no better way to get the shipping costs for an order (or a fulfillment) then sussing it out of the message string of the label events as described earlier in this thread.

The events that I look for, parse, and then tally to get the total shipping costs for an order (assuming there may be more than one shipping event):

  • shipping_label_created_success (x1)
  • shipping_label_cancelled_success (x -1)
  • external_shipping_label_created_success (x1)
  • external_shipping_label_cancelled_success (x -1)

 

Also, very disappointed to discover that I can't use this same hackish method to get the costs for any return labels that might have been printed for an order.

An event for a return label looks like this:

{
    "id": 2345234523452345,
    "subject_id": 7890789078907890,
    "created_at": "2021-05-27T15:21:13-04:00",
    "subject_type": "Order",
    "verb": "return_label_with_return_created_success",
    "arguments": [
        12341234123,
        "shipping_label_1234.pdf",
        "#1048-R1"
    ],
    "body": null,
    "message": "USER NAME created a return label for return #1234-R1.",
    "author": "USER NAME",
    "description": "USER NAME created a return label for return #1234-R1.",
    "path": "\/admin\/orders\/7890789078907890"
}

 

which makes no reference anywhere to the label cost.

Ugh!  Please deliver a method for us to access our shipping costs, Shopify Dev team. I know you must be busy, but this one is pretty essential!

 

 

drock111
Tourist
7 0 7

Having access to this data is critical to running an efficient shipping program and it's hard to understand why shopify doesn't make this a formal part of the API, but I'm not holding my breath for shopify to add anything new to their API, we have not seen a lot of innovation from Shopify in that department in a very long time as far as I can tell.

0 Likes
CloudlabSam
Pathfinder
125 6 9

Hi Matt,

Any word on when this might be implemented. Seems like a pretty reasonable ask for those using Shopify Shipping.

Thanks,

Sam

0 Likes