Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit ca4508a

Browse files
authored
Merge pull request #259 from MJMortimer/f-InvoiceIds
Add support for find invoices by ids list beta functionality
2 parents bf56bec + 0f05daf commit ca4508a

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

CoreTests/Integration/Invoices/Find.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ public void find_by_id()
2626
Assert.AreEqual(expected, id);
2727
}
2828

29+
[Test]
30+
public void find_by_id_list()
31+
{
32+
var created = Given_an_invoice();
33+
var invoices = Api.Invoices.Ids(new[] {created.Id}).Find().ToList();
34+
35+
Assert.AreEqual(1, invoices.Count());
36+
Assert.AreEqual(created.Id, invoices.First().Id);
37+
}
38+
2939
[Test]
3040
public void find_by_value()
3141
{

Xero.Api/Core/Endpoints/InvoicesEndpoint.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace Xero.Api.Core.Endpoints
1313
public interface IInvoicesEndpoint : IXeroUpdateEndpoint<InvoicesEndpoint, Invoice, InvoicesRequest, InvoicesResponse>, IPageableEndpoint<IInvoicesEndpoint>
1414
{
1515
OnlineInvoice RetrieveOnlineInvoiceUrl(Guid invoiceId);
16+
IInvoicesEndpoint Ids(IEnumerable<Guid> ids);
1617
}
1718

1819
public class InvoicesEndpoint
@@ -30,6 +31,12 @@ public IInvoicesEndpoint Page(int page)
3031
return this;
3132
}
3233

34+
public IInvoicesEndpoint Ids(IEnumerable<Guid> ids)
35+
{
36+
AddParameter("ids", string.Join(",", ids));
37+
return this;
38+
}
39+
3340
public override void ClearQueryString()
3441
{
3542
base.ClearQueryString();

0 commit comments

Comments
 (0)