# Get vendor by filtering legacy\_id or name

**URL:** <https://community.shiphero.com/t/get-vendor-by-filtering-legacy-id-or-name/1806>\
**Category:** GraphQL API\
**Created:** [January 13, 2022, 5:09pm UTC](https://community.shiphero.com/t/get-vendor-by-filtering-legacy-id-or-name/1806 "2022-01-13T17:09:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sureshdeepal](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@sureshdeepal](https://community.shiphero.com/u/sureshdeepal)\
**Post date:** [January 13, 2022, 5:09pm UTC](https://community.shiphero.com/t/get-vendor-by-filtering-legacy-id-or-name/1806/1 "2022-01-13T17:09:46Z")

</div>

Hi,  
I need to filter vendor by legacy\_id or name. Is that possible to do with GraphQL API.

I’m trying to create a purchase order in ShipHero. Seems to be required vendor\_id on that request payload. The issue is some item doesn’t have an association item and vendor inside the ShipHero. If not that association, then I have to update the item by adding vendor id to make that association. Because without that association I can’t create the purchase orders.  
It gives me this error  
{“errors”:[{“message”:“Purchase Order vendor\_id must match the line item vendor\_ids”,“operation”:“purchase\_order\_create”,“field”:“purchase\_order\_create”,“request\_id”:“61e040a9873bd03b31f0583c”,“code”:3}],“data”:{“purchase\_order\_create”:null}}.

I thought of two options to resolve this

1. Can we create PO without vendor\_id? then vendor not will be the required to send.
2. Or we have to filter vendor by “legacy\_id”. Because we have only that id.

---

<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:** [January 13, 2022, 5:49pm UTC](https://community.shiphero.com/t/get-vendor-by-filtering-legacy-id-or-name/1806/2 "2022-01-13T17:49:52Z")

</div>

Hello @sureshdeepal!  
Welcome to the ShipHero Public API Community.

I’m already working con this request and will get back to you as soon as I have an update.

Have a nice day!  
TomasFD

---

<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:** [January 26, 2022, 8:38pm UTC](https://community.shiphero.com/t/get-vendor-by-filtering-legacy-id-or-name/1806/3 "2022-01-26T20:38:19Z")

</div>

Hello @sureshdeepal!

Apologies for the late answer.

`vendor_id` is not a required field in the PO or each line item.

Please try to create one without them and let me know if you run into any issues.

Kind regards,  
TomasFD
