Skip to content

Instantly share code, notes, and snippets.

@SerKnight
Created October 27, 2020 16:41
Show Gist options
  • Save SerKnight/7ab203ca68702b7a2205cdb5653e5293 to your computer and use it in GitHub Desktop.
Save SerKnight/7ab203ca68702b7a2205cdb5653e5293 to your computer and use it in GitHub Desktop.
example
var contact = new Contact();
contact.Name = Name;
var line = new LineItem() {
Description = LineDescription,
Quantity = float.Parse(LineQuantity),
UnitAmount = float.Parse(LineUnitAmount),
AccountCode = LineAccountCode
};
var lines = new List<LineItem>() {
line
};
var invoice = new Invoice() {
Type = Invoice.TypeEnum.ACCREC,
Contact = contact,
Date = DateTime.Today,
DueDate = DateTime.Today.AddDays(30),
LineItems = lines
};
var invoiceList = new List<Invoice>();
invoiceList.Add(invoice);
var invoices = new Invoices();
invoices._Invoices = invoiceList;
var AccountingApi = new AccountingApi();
var response = await AccountingApi.CreateInvoicesAsync(accessToken, xeroTenantId, invoices);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment