# Getting an external order\_number with graphQL, in shipments query

**URL:** <https://community.shiphero.com/t/getting-an-external-order-number-with-graphql-in-shipments-query/620>\
**Category:** GraphQL API\
**Created:** [July 23, 2020, 8:29pm UTC](https://community.shiphero.com/t/getting-an-external-order-number-with-graphql-in-shipments-query/620 "2020-07-23T20:29:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orion](https://avatars.discourse-cdn.com/v4/letter/o/a88e4f/32.png) [@Orion](https://community.shiphero.com/u/Orion)\
**Post date:** [July 23, 2020, 8:29pm UTC](https://community.shiphero.com/t/getting-an-external-order-number-with-graphql-in-shipments-query/620/1 "2020-07-23T20:29:07Z")

</div>

Hi,

Is there a shipments query that can also return an order name, like the legacy API does when querying shipments(in order\_number field)? The below query’s order\_number in the shipping\_labels section is actually just returning the legacy id. If not, I will need to use another query to lookup order\_number in the order query (which is the order name i’m referring to above) by order id. Thanks!

query {  
shipments(date\_from: “2020-06-04T19:19:40”) {  
request\_id  
complexity  
data(first: 1 after:"") {  
pageInfo {  
hasNextPage  
hasPreviousPage  
startCursor  
endCursor  
}  
edges {  
node {  
id  
legacy\_id  
order\_id  
user\_id  
warehouse\_id  
pending\_shipment\_id  
address {  
name  
address1  
address2  
city  
state  
country  
zip  
phone  
}  
picked\_up  
needs\_refund  
refunded  
delivered  
shipped\_off\_shiphero  
dropshipment  
created\_date  
line\_items {  
edges {  
node {  
id  
legacy\_id  
line\_item\_id  
shipment\_id  
shipping\_label\_id  
quantity  
line\_item{  
sku  
}  
}  
}  
}  
shipping\_labels {  
id  
legacy\_id  
account\_id  
shipment\_id  
order\_id  
box\_id  
status  
tracking\_number  
order\_number  
carrier  
shipping\_name  
shipping\_method  
cost  
box\_code  
address {  
name  
address1  
address2  
city  
state  
country  
zip  
phone  
}  
device\_id  
delivered  
picked\_up  
refunded  
needs\_refund  
profile  
partner\_fulfillment\_id  
full\_size\_to\_print  
packing\_slip  
warehouse  
insurance\_amount  
carrier\_account\_id  
dimensions {  
weight  
}  
}  
}  
cursor  
}  
}  
}  
}

---

<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:** [July 24, 2020, 1:10pm UTC](https://community.shiphero.com/t/getting-an-external-order-number-with-graphql-in-shipments-query/620/2 "2020-07-24T13:10:15Z")

</div>

Hi @Orion  
Yes I think what you might be looking for is inside order {order\_number}  
Something like this:

```
query {
  shipments(date_from: "2020-06-04T19:19:40") {
    request_id
    complexity
    data(first: 1) {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      edges {
        node {
          id
          legacy_id
          order_id
          order{
            order_number
          }
…

```

Let me know if that doesn’t help  
Thanks!  
Tom
