GetInvoicesAsync仅获取100张发票,即使还有更多

时间:2020-04-10 17:30:40

标签: xero-api

我使用了var invoicesinxero =等待_accountingApi.GetInvoicesAsync(accessToken,tenantId,状态:新列表{“ DRAFT”},其中:“ Type == \” ACCREC \“”);

我的帐户中有700多张帐单草稿,但以上仅提取了100张帐单 以下是所使用参考的版本: Xero.NetStandard.OAuth2 v0.1.0 Xer.NetStandard.OAuth2Client v0.0.2

我应该使用另一种方法还是有另一种获取发票的方法

1 个答案:

答案 0 :(得分:0)

您将需要通过GetInvoicesAsync中的page参数进行多次调用以获取全部700张发票。我们正在努力使文档适用于所有SDK,但如果您查看该功能代码,则可以看到第20个可选参数为int? page = null,

GetInvoicesAsync (
  string accessToken,
  string xeroTenantId,
  DateTime? ifModifiedSince = null,
  string where = null,
  string order = null,
  List<Guid> iDs = null,
  List<string> invoiceNumbers = null,
  List<Guid> contactIDs = null,
  List<string> statuses = null,
  int? page = null,
  bool? includeArchived = null,
  bool? createdByMyApp = null,
  int? unitdp = null
);

由于这些文件是自动生成的,因此可能会变得很大,尽管解析起来并不理想,但您可以在此处找到函数def:

https://raw.githubusercontent.com/XeroAPI/Xero-NetStandard/master/Xero.NetStandard.OAuth2/Api/AccountingApi.cs

相关问题