Shipments Query (how to get order_date, order_number and line item total)

Hello,
how to get the shipments order number (not id), order_date because i’m only getting shipping date
and line items total
thanks

the query i’m using

      query {
          shipments{
            request_id
            complexity
            data(last:20) {
              edges {
                node {
                  id
                  legacy_id
                  order_id
                  user_id
                  warehouse_id
                  pending_shipment_id
                  address {
                    name
                    address1
                    address2
                    city
                    state
                    country
                    zip
                    phone
                  }
                  shipped_off_shiphero
                  dropshipment
                  created_date
                  line_items(first: 50){
                    edges {
                      node {
                        quantity
                      }
                    }
                  }
                  shipping_labels {
                    id
                    legacy_id
                    account_id
                    tracking_number
                    carrier
                    shipping_name
                    shipping_method
                    cost
                    profile
                    packing_slip
                    warehouse
                    insurance_amount
                    carrier_account_id
                    source
                    created_date
                  }
                }
              }
            }
          }
        }

Hi @karimedrees,
Please send a request-id and I can take a closer look. Thanks in advance!

Hi @Theresa
the request id is 616b2d9cd3948677bef37a0f

please note that i need to get the order number ,order date and line items total for each shipment

thanks

Hi @karimedrees,
If you have the order id, you can run the order query, and it will have the order number, order date, and the shipments with line item data associated with that order. That is a slightly different way to get all the information in one query. Not sure if it will work for you to associate it this way, but all the information you asked for is available.

query {
  order(id: "<order_id here>") {
    request_id
    complexity
    data {
      order_number
      order_date
      shipments {
        line_items {
          edges {
            node {
              line_item_id
              line_item {
                subtotal
              }
            }
          }
        }
      }
    }
  }
}