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