Skip to content
Discussion options

You must be logged in to vote

Hi,
This small function will pull history for a given invoice.
Add to "AccountingApi.cs" at line #1513, just after the "//TODO Added History" comment :)

    public List<HistoryRecord> GetInvoiceHistory(Guid invoiceID)
    {
        var results = Task.Run(() => APIClient.GetInvoiceHistoryAsync(APICore.XeroConfig.AccessTokenSet.AccessToken, APICore.XeroConfig.SelectedTenantID, invoiceID )).ConfigureAwait(false).GetAwaiter().GetResult();
        var records = new List<HistoryRecord>(); // Hold the records
        if (results != null)
        {
            records.AddRange(results._HistoryRecords);
        }
        return records;
    }

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by LarkSpurMarauder
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant