# Search records by tote ID/barcode

**URL:** <https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529>\
**Category:** GraphQL API\
**Created:** [August 31, 2021, 10:36pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529 "2021-08-31T22:36:07Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbeuerlein](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bbeuerlein](https://community.shiphero.com/u/bbeuerlein)\
**Post date:** [August 31, 2021, 10:36pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/1 "2021-08-31T22:36:07Z")

</div>

Hello,

We are working on implementing a shipping platform for a ShipHero user, and it has been requested that we load data in using the tote ID/barcode, since they are picking the orders in SH and there is no current paperwork being generated that a user can use to load the order by (all the shipper has is their tote). Is there a way to query the tote\_history API to retrieve records that match the barcode on the tote? I’ve tried the following request, however I am not getting any data:

{“query”:“query tote\_history ($sort: String, $before: String, $after: String, $first: Int, $last: Int, $tote\_name: String, $tote\_id: String, $date\_from: ISODateTime, $date\_to: ISODateTime, $analyze: Boolean) {\n tote\_history (tote\_name: $tote\_name, tote\_id: $tote\_id, date\_from: $date\_from, date\_to: $date\_to, analyze: $analyze) {\n request\_id\n complexity\n data (sort: $sort, before: $before, after: $after, first: $first, last: $last) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n node {\n tote\_name\n tote\_id\n action\n created\_at\n }\n cursor\n }\n }\n }\n}”,“variables”:{  
“sort”: “”,  
“before”: “”,  
“after”: “”,  
“first”: 0,  
“last”: 0,  
“tote\_name”: “”,  
“tote\_id”: “”,  
“date\_from”: “8-30-2021”,  
“date\_to”: “9-1-2021”,  
“analyze”: true  
}}

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 1, 2021, 7:23pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/2 "2021-09-01T19:23:22Z")

</div>

Hi @bbeuerlein,  
Welcome!  
I am not 100% sure I understand. Are you wanting to get a list of the orders in a tote?

---

<div class="post-metadata">

**Author:** ![jesusGG](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jesusGG](https://community.shiphero.com/u/jesusGG)\
**Post date:** [September 1, 2021, 10:09pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/3 "2021-09-01T22:09:28Z")

</div>

We need to call an order data taking the tote as a reference, is for shipping label processing purposes through API, since we don’t have the order number printed anywhere the only barcode available is the tote one. So that we need to correlate the data from the tote number

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 2, 2021, 8:02pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/4 "2021-09-02T20:02:48Z")

</div>

This will get the tote pick from the order line item history. Will this help?

```auto
query{
  order(id:"<order id here>"){
    request_id
    complexity
    data{
      order_history{
            order{
          line_items{
            edges{
              node{
                tote_picks{
                  tote_id
                }
              }
            }
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![bbeuerlein](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bbeuerlein](https://community.shiphero.com/u/bbeuerlein)\
**Post date:** [September 2, 2021, 9:18pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/5 "2021-09-02T21:18:33Z")

</div>

Unfortunately not, we actually need the inverse (to get the order from the tote itself). So something like:

```auto
query{
  totes(id:"<tote id/barcode here>"){
    request_id
    complexity
    data{
            order{
                 id
                 ...
              }
         }
     }
}

```

We are essentially needing this because the user does not know what the order is when they are shipping the box; all they have is the tote id/barcode. In SH today, the user can scan this tote barcode and SH pulls in the necessary information to allow the user to ship the order.

Let me know if you need anything further on this.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 3, 2021, 8:40pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/6 "2021-09-03T20:40:59Z")

</div>

Thank you for the clarification, I will look into it.

---

<div class="post-metadata">

**Author:** ![bbeuerlein](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bbeuerlein](https://community.shiphero.com/u/bbeuerlein)\
**Post date:** [September 20, 2021, 7:39pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/7 "2021-09-20T19:39:43Z")

</div>

Checking in… any update on this topic?

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 21, 2021, 5:47pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/8 "2021-09-21T17:47:00Z")

</div>

I have it in for a feature request, apologies for the update delay. I do not have any new information. I will refresh this when I get more feedback.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 29, 2021, 7:34pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/10 "2021-09-29T19:34:23Z")

</div>

Hi @bbeuerlein  
You can access this information in the UI here: [https://app.shiphero.com/dashboard/totes](https://app.shiphero.com/dashboard/totes) and in the bottom of the page, put in the tote and it will tell you all the orders that are in the tote. In order to go ahead with the request, I would need a use case for having this in the API.  
What would be the use case for not using the UI?

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [September 30, 2021, 10:07am UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/11 "2021-09-30T10:07:45Z")

</div>

Hi Theresa,

I’m not the original poster, but a use case for us is that we have users that aren’t always in a place where they can stop and go to the UI to look it up, but they have Slack on their tablets, so we wanted to build it into a slack bot so that they could request a tote ID (our user facing ID, like “Green-42”, not the internal ShipHero tote ID) and have it give them a list of what’s in it.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 30, 2021, 10:38pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/12 "2021-09-30T22:38:38Z")

</div>

Thank you! I will post any new updates.

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [November 22, 2022, 4:54pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/13 "2022-11-22T16:54:10Z")

</div>

Hello!

I just wanted to check on the status of this request. I know it’s been more than a year since this has been updated, but we still have processes where it would be easier to script a way for the user to look up a tote via the API rather than sending them to a computer with the ShipHero UI.

Thanks,  
Jeremy

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [November 22, 2022, 8:19pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/14 "2022-11-22T20:19:33Z")

</div>

Hey @jeremyw,

I’ll go ahead and pass along your feedback to the team.

Thank you!

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![hansdaigle](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/hansdaigle/32/369_2.png) [@hansdaigle](https://community.shiphero.com/u/hansdaigle)\
**Post date:** [December 10, 2022, 3:36pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/15 "2022-12-10T15:36:58Z")

</div>

There is an endpoint already to query totes `tote_history`, but it’s not returning a lot:

 ![Screenshot 2022-12-10 at 10.15.22](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/e01114c0b71fa75199b2f0090ba52dc5a69d5d35.png)

and you also have to query it using a `tote_uuid` which is not really convenient.

> On that note, `tote_id` is not consistent across the API sometimes it expects the `tote_name`, the `tote_id`, or the `tote_uuid` you have to try and error.

+1 for this feature request.

We would like to use the new `inventory_transfer` mutation to transfer all the items that were picked to a **single location** after a `tote_cleared` event. This will allow us to speed up the process of emptying totes after they were cleared and not have to put back items in each location right away without messing up the inventory.

But with the current API, I can’t see a way to trace down which locations were picked. We would like something exactly like this private API endpoint (located at [https://app.shiphero.com/dashboard/totes](https://app.shiphero.com/dashboard/totes)):

 ![Screenshot 2022-12-10 at 10.30.25](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/b79e8a467e3a6f2694e842b2d58b0091e4bac254.jpeg)

Just add more queriable information to the `tote_history` endpoint maybe?

 ![Screenshot 2022-12-10 at 10.34.17](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/5d6fbfae888d5a38fadc99311595458a288bbb3d.png)

Thank you,

---

<div class="post-metadata">

**Author:** ![Gergely](https://avatars.discourse-cdn.com/v4/letter/g/958977/32.png) [@Gergely](https://community.shiphero.com/u/Gergely)\
**Post date:** [December 13, 2022, 1:32pm UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/16 "2022-12-13T13:32:39Z")

</div>

I was going to +1 this feature as well, but I might have found the solution.

I was desperately looking for ways to optimise our [workaround](https://community.shiphero.com/t/query-what-is-currently-in-totes/295/10) for the lack of this feature, when I came across a (new?) query.

 ![shiphero-tote-query](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/26042df15102e4466f46c6475fcbc30cf7326722.png)

Unfortunately, there is not much documentation available on it outside the schema, so not entirely sure what the data returned is _in fact_ meant to be, but after playing around with it a bit, I managed to integrate it into our workflow in a dev env. It seems to cover [our use case](https://community.shiphero.com/t/seemingly-random-403-forbidden/2236) perfectly!

Currently, it only filters by `barcode` but if you don’t routinely create new totes, you could keep a dictionary of all totes that are in use if you want to search by `tote_id` or `tote_name`.

An example query:

```auto
query {
  tote(barcode: "4 ******* 0") {
    request_id
    complexity
    data {
      orders {
        order_number
        line_items {
          edges {
            node {
              sku
              quantity
            }
          }
        }
      }
      picks {
        sku
        quantity
      }
    }
  }
}

```

and response:

```auto
{
  "data": {
    "tote": {
      "request_id": "63987dd58817625211e2de09",
      "complexity": 102,
      "data": {
        "orders": [
          {
            "order_number": "T ******** 5",
            "line_items": {
              "edges": [
                {
                  "node": {
                    "sku": "S ******* 1",
                    "quantity": 1
                  }
                },
                {
                  "node": {
                    "sku": "S ****** 1",
                    "quantity": 1
                  }
                },
                {
                  "node": {
                    "sku": "T ******** 4",
                    "quantity": 1
                  }
                }
              ]
            }
          }
        ],
        "picks": [
          {
            "sku": "T ******** 4",
            "quantity": 1
          },
          {
            "sku": "S ****** 1",
            "quantity": 1
          },
          {
            "sku": "S ******* 1",
            "quantity": 1
          }
        ]
      }
    }
  },
  "extensions": {
    "throttling": {
      "estimated_complexity": 102,
      "cost": 5,
      "cost_detail": {
        "tote": {
          "items_count": 4,
          "cost": 1,
          "total_cost": 5,
          "fields": {}
        }
      },
      "user_quota": {
        "credits_remaining": 1997,
        "max_available": 2002,
        "increment_rate": 30
      }
    }
  }
}

```

I hope this will be useful for others following this thread as well!

Could someone from ShipHero reading this forum confirm that this query is ready to be used in production?

---

<div class="post-metadata">

**Author:** ![hansdaigle](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/hansdaigle/32/369_2.png) [@hansdaigle](https://community.shiphero.com/u/hansdaigle)\
**Post date:** [December 19, 2022, 5:22am UTC](https://community.shiphero.com/t/search-records-by-tote-id-barcode/1529/17 "2022-12-19T05:22:15Z")

</div>

Hi @Gergely,

This is definitely new (or I didn’t refresh in a long time)!

Good catch and thanks for sharing!

Before:

 ![Screenshot 2022-12-19 at 00.18.23](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/f365f60e6eff372b0de24314b1a2ee9608247057.png)

After refreshing:

 ![Screenshot 2022-12-19 at 00.20.58](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/0b09f788187d1f4cf7725745135a41c449275433.png)

This will not solve my issue because the tote is already empty after a cleared\_tote event but fantastic to see that shiphero is working on releasing new endpoints!

Thank you,
