Query shipments that have been voided

Hi, what is the best way to query shipments that have been voided?

This is what I have tried, and it seems to work, but I was wondering if there is a better way. It seems that what I am really searching for are shipping labels with a date range.

query {
shipments(date_from: “2023-11-29T20:47:58”, date_to: “2023-12-08T20:48:58”) {
request_id
complexity
data(first: 10) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
legacy_id
order_id
created_date
shipping_labels {

        id
        status
        tracking_number
        order_number
        carrier
        shipping_name
        shipping_method
        cost
        box_code
      }
    }
    cursor
  }
}

}
}

Hey @kentroylance,

Thanks for reaching out!

This is pretty much the most efficient way as long as you have the connection to the shipping_labels edge and the status field under that. Depending on credit availability you could try to pull more results.

Please let me know if you have any questions or concerns!

Best,
RayanP

Is there a way to just pull labels that have a void status? Until we get a webhook to handle voids, we are forced to run a daily cron job to checks for voids. Is there a way to just pull back the labels that are voided?

Hey @kentroylance ,

Thanks for hanging in there!
I don’t believe there is any way to sort or filter by the value of the shipping labels status.

Please let me know if there’s anything I can do to assist.

Best,
RayanP

Don’t you think its about time this was addressed? Developers have been complaining for a while…

There is no way to detect voided labels other than polling ALL shipments and checking each label status. This is bad for traffic on your API server and bad for us as developers. Wasting API credits and server processing to get the same Shipments over and over and over. Any integration that sends Shipments with Label data to other systems will need to handle voids. You offer no scalable way to do this.

Give us a webhook or give us an “updated_from” parameter for the Shipments query and make sure changes in labels trigger a change in the Parent shipment. What’s it gonna take for the dev team to take this request seriously?

I have added this to our Feature requests internally.

If you are able to submit a ticket from your company account i can make a better case for the product team to add this