Update an Invoice using QBO SDK

Update an Invoice using QBO SDK C#.NET Code

Update an Invoice using QBO SDK C#.NET Code
                    
public void Update(string customer_name)

       {

       //get customer and add use it's id to find the invoice for that customer 

          QBCustomer qbcustomer = new QBCustomer();


           Customer customer = qbcustomer.FillByName(customer_name);

         Invoice invoice = FillById((Invoice)base.GetAll().Where(x => x.CustomerRef.Value == customer.Id).FirstOrDefault());

          //change the value of deposit

           invoice.Deposit = new Decimal(45.20);

            base.Update(invoice);

}


//Add the following lines to avoid the serialization issue
context.IppConfiguration.Message.Request.SerializationFormat = Intuit.Ipp.Core.Configuration.SerializationFormat.Json;

context.IppConfiguration.Message.Response.SerializationFormat = Intuit.Ipp.Core.Configuration.SerializationFormat.Json;