I'm trying to query for a specific purchase order using the "PurchaseOrderNumber" field, however regardless of what value I provide, all PurchaseOrders are returned.
I've replicated the exact same code except swapped out for Invoices and the querying of "InvoiceNumber" works fine, just not PurchaseOrders.
Here's the URL I'm calling:
https://api.xero.com/api.xro/2.0/PurchaseOrders?where=PurchaseOrderNumber%3D%3D%22PO-0007%22
You can query purchase orders both by Id and Purchase order number. So your request would look something like
api.xero.com/api.xro/2.0/PurchaseOrders/PO-0001
PO-0001 can be substituted by the actual id as well.
Look at xero documentation here, and the optional parameters section.
Hope this helps.