Purchase Order - line_items - Unexpected Error 22

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


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?

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