【问题标题】:Retriving Quotes from xero using XeroOAuth-PHP Fetches Every Quote Work Item使用 Xero OAuth-PHP 从 xero 检索报价 获取每个报价工作项
【发布时间】:2020-01-31 16:51:10
【问题描述】:

我正在尝试使用 XeroOAuth-PHP 从 xero 中检索 Quote workitems

由于我公司的一些限制,我不允许迁移到最新版本 xero-php-oauth2

我已经使用 XeroOAuth-PHPxero 检索了发票工作项

我使用以下代码检索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");

效果很好

当我尝试使用相同的以下过程检索报价工作项时

$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");

它检索我的 xero 帐户中的每个 Quote WorkItem 而不是 QU-0001 的单个工作项

这里是Response

我的问题是为什么根据 Param 引用 Workitem 不起作用

我使用不支持引用检索的旧 XeroOAuth-PHP 是否有任何可能的原因?

【问题讨论】:

    标签: php oauth xero-api


    【解决方案1】:

    Quotes API 不支持任意“where”过滤。 API 支持的文档 (https://developer.xero.com/documentation/api/quotes) 上有一个过滤器列表。

    按 QuoteNumber 过滤不在此列表中,但我刚刚推送了一个应该支持按 QuoteNumber 过滤的更改。这不会反映在文档中,但执行这样的查询应该可以:

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

    希望这会有所帮助!

    【讨论】:

    • 嗨@morgan它有一些问题你能解决吗,当我输入报价编号QU-0001时它工作正常但是当我输入QU它获取每个工作项以QU开头而不是空响应请修复发票号码不会发生这种情况
    猜你喜欢
    • 1970-01-01
    • 2020-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 2018-02-16
    • 1970-01-01
    相关资源
    最近更新 更多