# Get last shipped orders for the date range using API

**URL:** <https://community.shiphero.com/t/get-last-shipped-orders-for-the-date-range-using-api/1055>\
**Category:** GraphQL API\
**Created:** [January 15, 2021, 5:15am UTC](https://community.shiphero.com/t/get-last-shipped-orders-for-the-date-range-using-api/1055 "2021-01-15T05:15:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [January 15, 2021, 5:15am UTC](https://community.shiphero.com/t/get-last-shipped-orders-for-the-date-range-using-api/1055/1 "2021-01-15T05:15:55Z")

</div>

Hi,

I need to fetch the last shipped orders for the given date range and it’s shipment details from ShipHero using APIs.

Please do let me know if there is any API.

Thanks in Advance!  
Supritha

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [January 15, 2021, 1:52pm UTC](https://community.shiphero.com/t/get-last-shipped-orders-for-the-date-range-using-api/1055/2 "2021-01-15T13:52:03Z")

</div>

Hi @supritha!  
You could use a query like this:

```
query {
  shipments(date_from: "2021-01-13", date_to: "2021-01-15") {
    request_id
    complexity
    data(first: 10) {
      edges {
        node {
          id
          legacy_id
          order_id
          user_id
          warehouse_id
          pending_shipment_id
          profile
          picked_up
          needs_refund
          refunded
          delivered
          dropshipment
          shipped_off_shiphero
          completed
          created_date
          line_items(first: 10) {
            edges {
              node {
                id
                quantity
                shipping_label_id
              }
            }
          }
          shipping_labels {
            label {
              pdf_location
            }
            tracking_number
            created_date
          }
        }
      }
    }
  }
}

```

Using the time range that you need.  
There might be fields you want to remove or add, but for all the fields you can see them by [navigating through the schema & docs](https://developer.shiphero.com/getting-started/#schemaanddocs) if needed

Let me know if there is anything else I could help you with,  
Thanks in advance!  
Tom

---

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [January 18, 2021, 3:44am UTC](https://community.shiphero.com/t/get-last-shipped-orders-for-the-date-range-using-api/1055/3 "2021-01-18T03:44:53Z")

</div>

Thanks for the reply, @tomasw !

Is there a way to get order number in the shipments API?

Regards,  
Supritha

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [January 18, 2021, 12:41pm UTC](https://community.shiphero.com/t/get-last-shipped-orders-for-the-date-range-using-api/1055/4 "2021-01-18T12:41:24Z")

</div>

Absolutely @supritha !  
You can include the

```
 order{
            order_number
          }

```

Field, something like:

```
query {
  shipments(date_from: "2021-01-13", date_to: "2021-01-15") {
    request_id
    complexity
    data(first: 10) {
      edges {
        node {
          id
          legacy_id
          order_id
          user_id
          warehouse_id
          pending_shipment_id
          profile
          picked_up
          needs_refund
          refunded
          delivered
          dropshipment
          shipped_off_shiphero
          completed
          created_date
          order{
            order_number
          }
          line_items(first: 10) {
            edges {
              node {
                id
                quantity
                shipping_label_id
              }
            }
          }
          shipping_labels {
            label {
              pdf_location
            }
            tracking_number
            created_date
          }
        }
      }
    }
  }
}

```

Thanks again!  
Tom

---

<div class="post-metadata">

**Author:** ![supritha](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@supritha](https://community.shiphero.com/u/supritha)\
**Post date:** [January 22, 2021, 7:40am UTC](https://community.shiphero.com/t/get-last-shipped-orders-for-the-date-range-using-api/1055/5 "2021-01-22T07:40:00Z")

</div>

That would be helpful.

thanks for the reply, @tomasw !

Regards,  
Supritha
