Xero API - QueryParseException 类型 'Invoice' 中不存在 属性 或字段 'ACCPAY'

Xero API - QueryParseException No property or field 'ACCPAY' exists in type 'Invoice'

我需要显示我们欠供应商的每周账单摘要 以下是联系 ID 给出的特定供应商的 api 呼叫示例。我们应用的过滤器包括日期和 invoice type

联系人 ID:56f1293d-c234-4579-b144-061c1ce591b9

where : Date >= DateTime(2019, 03, 01) && Date < DateTime(2019, 03, 12)&&Type==ACCPAY

状态:授权

原始 HTTP GET 请求

https://api.xero.com/api.xro/2.0/Invoices?ContactIDs=56f1293d-c234-4579-b144-061c1ce591b9&where=Date%20%3E%3D%20DateTime(2019,%2003,%2001)%20%26%26%20Date%20%3C%20DateTime(2019,%2003,%2012)%26%26Type%3D%3DACCPAY&Statuses=AUTHORISED

但是我得到的回复是

{
  "ErrorNumber": 16,
  "Type": "QueryParseException",
  "Message": "No property or field 'ACCPAY' exists in type 'Invoice'"
}

知道为什么会这样吗?凭据或任何东西都没有问题,其他 API 调用工作正常。

其实我会post我的评论作为答案。

Xero API 在其 where 子句中使用 c# 语法,因此您需要用双引号将 ACCPAY 括起来。 所以你的 where 子句的正确语法是:

Date >= DateTime(2019, 03, 01) && Date < DateTime(2019, 03, 12)&&Type=="ACCPAY"