# Find total label cost for a date

**URL:** <https://community.shiphero.com/t/find-total-label-cost-for-a-date/1718>\
**Category:** GraphQL API\
**Created:** [November 29, 2021, 8:16pm UTC](https://community.shiphero.com/t/find-total-label-cost-for-a-date/1718 "2021-11-29T20:16:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@Raj](https://community.shiphero.com/u/Raj)\
**Post date:** [November 29, 2021, 8:16pm UTC](https://community.shiphero.com/t/find-total-label-cost-for-a-date/1718/1 "2021-11-29T20:16:55Z")

</div>

Hi, How would I go about finding the total shipping label cost for a given date?  
I saw querying using shipment\_id would give me shipping\_labels {cost} - but what’s the simplest way to get the cost using date or order IDs?  
Thank you!

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [November 30, 2021, 2:27pm UTC](https://community.shiphero.com/t/find-total-label-cost-for-a-date/1718/2 "2021-11-30T14:27:49Z")

</div>

Hello @Raj!  
There is no single query that replies with the total for a day, but as you stated, you can do it by polling all shipments for a given date and adding the label cost inside each one. Your query should look something like this:

```auto
query{
  shipments(date_from: ISODateTime, date_to: ISODateTime){
    request_id
    complexity
    data(after: string, first: int){
      edges{
        node{
          shipping_labels{
            cost
          }
        }
      }
      pageInfo{
        endCursor
        hasNextPage
      }
    }
  }
}

```

ISODateTime can be:

- YYYY-mm-dd
- YYYY-mm-dd HH:MM:SS
- YYYY-mm-ddTHH:MM:SS

You can use `pageInfo`, `first`, and `after` to paginate the responses.

If you want to get the label cost for orders, you can do as follows but only a single order at a time:

```auto
query{
  shipments(order_id: string){
    request_id
    complexity
    data(after: string, first: int){
      edges{
        node{
          shipping_labels{
            cost
          }
        }
      }
      pageInfo{
        endCursor
        hasNextPage
      }
    }
  }
}

```

Please let me know if this doesn’t help.  
Kind regards,  
Tomas

---

<div class="post-metadata">

**Author:** ![Raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@Raj](https://community.shiphero.com/u/Raj)\
**Post date:** [November 30, 2021, 3:08pm UTC](https://community.shiphero.com/t/find-total-label-cost-for-a-date/1718/3 "2021-11-30T15:08:19Z")

</div>

Thank you so much Tomas for the two options! I think I’ll try first one and see if that works for me - that will hit the SH servers much lesser times.  
Much appreciated
