XeroAPI/XeroAPI.Net

Invoices with Tracking

Closed this issue · 1 comments

According to the Api Documentation tracking is POST/PUT but the C# wrapper notes that tracing is read only.

here is some sample code:
Invoice XeroInv = new Invoice
{
Type = "ACCREC",
InvoiceNumber = "INV0001",
Contact = new Contact
{
ContactNumber = "C00001",
FirstName = "Henzard",
LastName = "Kruger"
},
LineItems = new LineItems()
};
XeroInv.LineItems.Add(new LineItem
{
Description = "Stuff",
Quantity = 5,
UnitAmount = 1.10M,
ItemCode = "I0001",
Tracking = new TrackingCategory //Error on this Line
{
Name = "One",
Option = "1"
}
});

Error 1 Property or indexer 'Tracking' cannot be assigned to -- it is read only

Are you looking here? -> http://developer.xero.com/documentation/api/tracking-categories/ There is only GET in the supported methods. You can add existing tracking categories options to a line item though:

aLineItem.Tracking.Add( new TrackingCategory( )
{
    TrackingCategoryID = trackingCategoryGuid,
    Name = trackingCategoryName,
    Option = optionName
} );