0

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
Anim8r
  • 191
  • 1
  • 9

1 Answers1

1

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.

  • Cheers! Xero responded directly saying that the PurchaseOrder model doesn't support "where" searches like the Invoice model does, so your answer solves the problem. – Anim8r Nov 08 '17 at 22:48