Shipments and has_notified_cart field


#1

I’m working on an integration between Ordoro and a shopping cart app, and I am currently working on shipments. In this case shipment information is added to Ordoro by a set of scripts, and the shopping cart app needs to retrieve information on new shipments from Ordoro before notifying customers via email. My question is about the best way to retrieve exactly the shipments that I need. While reading over the API docs I noticed a field named has_notified_cart. My guess was that this would be a flag field that can be set via update. However, based on my testing it’s not being set by the Shopify integration (figured that out when I got back every shipment ever). Is this field the current best practice, or is there another better way to do it?


#2

Hi GeminiJim,

When Ordoro updates shipment and tracking information in a sales channel, such as Shopify, we’ll mark has_notified_cart=true.

What shipments are you trying to get out of Ordoro? There are filters that you can use based on status that may be more suited to retrieving shipments.

Sophie


#3

Thanks for the fast reply, Sophie. Glad to hear that this is the field I should be using – it sounds like I formatted my search request incorrectly.


#4

Oh, I forgot to answer your question. I’d like to get back all shipments with tracking information present where has_notified_cart is false. That seems like the most sensible thing. Once I process each of these shipments, I’ll queue up update calls so that has_notified_cart is set to true for each one.


#5

Closer examination shows that I got all the orders without any shipment tracking, so I think that’s where I went wrong. You are correct that I need to narrow my filter to shipments that actually have tracking information.


#6

I believe to update the shipment to show that the cart has been notified of tracking, you’ll want to use this endpoint
POST /shipment/<shipment_id>/notified_cart
http://docs.ordoro.apiary.io/#reference/shipment/shipmentshipmentidnotifiedcart/post


#7

Thanks, that sounds perfect for the update. Any suggestions on how to filter out unshipped shipments with no tracking information?


#8

Most shipments would be unshipped and without a tracking number, do you have shipments that are unshipped but do have trackings?


#9

No, I don’t think that case would apply. I am thinking of shipments that have a status of shipped but do not have tracking information (this appears to be quite a few). It appears that in this case, the shopify integration does not notify Shopify and thus does not set the has_notified_cart value to true. That behavior seems correct because there was no notification to make.


#10

So, you’re trying to get shipped shipments with no tracking?
There is no explicit way to get these orders via the api without traversing the shipped orders from the time period you’re searching.


#11

I only want shipped shipments that have tracking information and have has_notified_cart = false.


#12

I see. I think you can narrow it down with /shipment/?status=shipped&has_notified_cart=false but you’ll have to filter out any that do not have tracking information programatically.