# Purchase Order - line\_items - Unexpected Error 22

**URL:** <https://community.shiphero.com/t/purchase-order-line-items-unexpected-error-22/738>\
**Category:** GraphQL API\
**Created:** [September 2, 2020, 9:14pm UTC](https://community.shiphero.com/t/purchase-order-line-items-unexpected-error-22/738 "2020-09-02T21:14:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jarvis](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@Jarvis](https://community.shiphero.com/u/Jarvis)\
**Post date:** [September 2, 2020, 9:14pm UTC](https://community.shiphero.com/t/purchase-order-line-items-unexpected-error-22/738/1 "2020-09-02T21:14:28Z")

</div>

I’m trying to migrate from legacy REST API to GraphQL API.

Unexpected Error 22 keeps coming out as I test purchase\_order query command, following the doc: [https://developer.shiphero.com/examples-query/#purchaseorder](https://developer.shiphero.com/examples-query/#purchaseorder)

* * *

## Exception: {‘message’: ‘Unexpected Error’, ‘operation’: ‘purchase\_order’, ‘field’: ‘line\_items’, ‘request\_id’: ‘5f5006de eeec1973aadff3a8’, ‘code’: 22}

As I remove the line\_items node totally from GraphQL, the query works.

How can I query line\_items correctly by using purchase\_order command?

---

<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:** [September 2, 2020, 9:33pm UTC](https://community.shiphero.com/t/purchase-order-line-items-unexpected-error-22/738/2 "2020-09-02T21:33:21Z")

</div>

Hi @Jarvis!  
That would be because the Product in the PO doesn’t exist in ShipHero, so when it tries to pull the line item’s information it returns empty and an error for that as it was not able to find any product in ShipHero with that description.  
We have a ticket already to be able to return valid information, but in the meantime the product needs to be created in ShipHero to avoid getting the error.  
I will let you know as soon as I have an update on the fix for this.  
Thanks in advance!  
Tom
