1

I am trying to retrive Quote workitems from xero using XeroOAuth-PHP .

I am not allowed to migrate to the latest release xero-php-oauth2 due to some limitations in my company.

I already retrieved Invoice workitem from xero using XeroOAuth-PHP

I use the following code to retrieve Invoice WorkItems

$params['where'] = 'InvoiceNumber=="INV-0001"';
$params['page']= 1;
$response = $XeroOAuth->request('GET', https://api.xero.com/api.xro/2.0/Invoices', $params,"","json");
$response_invoice =  $XeroOAuth->parseResponse($response['response'],"json");

It Works Fine

When I try to Retrieve Quote Work Item using the Same Following Procedure

$params['where'] = 'QuoteNumber=="QU-0001"';
$params['page']= 1;
$response   = $XeroOAuth->request('GET','https://api.xero.com/api.xro/2.0/Quotes', $params,"","json");
$response_invoice =  $XeroOAuth->parseResponse($response['response'],"json");

It Retrive Every Quote WorkItem in my xero account Instead of Single Work Item of QU-0001

Here is the Response

My Question is Why Quotes Workitem Not Work According to Param

Is There any Possible reason Im using old XeroOAuth-PHP that doesn't Support Quote Retrieval?

Reza Paidar
  • 863
  • 4
  • 21
  • 51
Vignesh A
  • 289
  • 7
  • 19

1 Answers1

2

The Quotes API does not support arbitrary 'where' filtering. There is a list of filters on the docs (https://developer.xero.com/documentation/api/quotes) that the API supports.

Filtering by QuoteNumber wasn't in this list, but I have just pushed a change that should support filtering by QuoteNumber. This will not be reflected in the Docs yet, but performing a Query like this should work:

https://api.xero.com/api.xro/2.0/Quotes?QuoteNumber=QU-0001

Hope this helps!

  • hi @morgan it has some issue could you fix that ,when i type quote number QU-0001 it works fine but when i type QU it fetches every workitem start with QU instead of empty response please fix that it doesnt happens with invoice number – Vignesh A Feb 03 '20 at 11:37