Pull tracking link from order?

Hey there, is there any way to pull the tracking number/link on an order once it has shipped and posted? If so, what query would I use?

Helo @Metrelli!

Yes, there is, it would be something like this:

query{
  shipments(order_id:"string"){
    request_id
    complexity
    data(first:10){
      edges{
        node{
          id
          legacy_id
          shipping_labels{
            tracking_number
          }
        }
      }
    }
  }
}

This is because the tracking belongs to the label, which is associated with each shipment, as each order could have multiple shipments. So you can query all shipments that belong to an order this way and get the tracking ID from its associated labels.

Please let me know if this doesn’t help.

Kind regards,
TomasFD

Awesome, thank you so much! Will try this out and let you know how it goes.