Null vendor returned from purchase_orders query

Please run this query:

{purchase_orders(created_from:“20210223”){request_id complexity data(sort:“created_at” first:1 ){pageInfo{hasNextPage endCursor} edges{node{id account_id po_number created_at date_closed po_date arrived_at fulfillment_status vendor_id vendor{id name}}}}}}

This query returns a valid “vendor_id” but the “vendor{id}” is null. All fields in the returned “vendor” are null.

Whats up with this? Why no vendor object? Is this a bug?

Id like to be able to get the vendor’s name in the purchase_orders query.

Hi @bbarrett!
The reason you are seeing this is that the PO has Multiple Vendors as a vendor, which means that not all of those products are from the same vendor.

Screen Shot 2021-02-26 at 08.12.57

The ID you are seeing in return is "vendor_id": "VmVuZG9yOjA=", which is Base64 encoding of Vendor:0

When there is no Vendor assigned to the PO we default that value to Multiple Vendors

Let us know if that doesn’t help, if we could explain better or if there is anything else we could help with.
Thanks in advance!

Yes this does help. Thanks for explaining!

1 Like