Global API
...
Request
Invoice
Update
1min
the following is an example of update invoice the quickbooks invoice id (id), customer reference id (customerref) and sync token (synctoken) are required to update the invoice (see invoice docid\ gee1fj42amxfapeumyyqi for the available fields) note you can only update one record at a time request // create a map to store all the data of a invoice list\<object> invoicelist = new list\<object>(); map\<string, object> invoicemap = new map\<string, object>(); invoicemap put('id', '13'); 	invoicemap put('synctoken','2'); 	invoicemap put('customerref',new map\<string, object>{'value' => '9'}); // initializing the invoice line items list\<object> lineitemlist = new list\<object>(); map\<string, object> lineitemmap = new map\<string, object>(); 	 lineitemmap put('linenum',1); lineitemmap put('amount',100); lineitemmap put('description','description updated'); 	 lineitemmap put('detailtype', 'salesitemlinedetail'); 	 map\<string, object> saleslineitemdetailmap = new map\<string, object>(); saleslineitemdetailmap put('qty',2); saleslineitemdetailmap put('unitprice',50); 	 saleslineitemdetailmap put('taxcoderef' , new map\<string, object>{'value' => 'tax'}); lineitemmap put('salesitemlinedetail', saleslineitemdetailmap); lineitemlist add(lineitemmap); // adding the line items to invoice invoicemap put('line',lineitemlist); invoicelist add(invoicemap); // initializing the requestjson data to be passed map\<string, object> reqjsonmap = new map\<string, object>(); reqjsonmap put('invoices' , invoicelist); string reqjson = json serialize(reqjsonmap); map\<string, object> finalreqmap = new map\<string, object>(); map\<string, object> reqoptions = new map\<string, object>(); finalreqmap put('options' , reqoptions); finalreqmap put('version' , '1 0'); finalreqmap put('action' , 'updateinvoice'); finalreqmap put('requestjson' , reqjson); finalreqmap put('skipdml' , false); //required, if quickbooks multi org is enabled in breadwinner finalreqmap put('qborgid', '4620816365285051610'); system debug('request ' + finalreqmap); // placing a request to breadwinner global api map\<string, object> respmap = breadwinner qbo breadwinnerqbapi call(finalreqmap); system debug('response ' + respmap); response { action=updateinvoice, responsejson={ "statuscode" 200, "invoices" \[ { "txntaxdetail" { "totaltax" 0 }, "txndate" "2021 11 01", "totalamt" 100 00, "synctoken" "3", "sparse" false, "shipaddr" { "postalcode" "94482", "longitude" " 122 0642815", "line1" "370 easy st ", "lat" "37 4031672", "id" "9", "countrysubdivisioncode" "ca", "city" "middlefield" }, "sfrecordid" "a0a5j000000u7oneay", "metadata" { "lastupdatedtime" "2021 11 01t06 14 57 07 00", "createtime" "2021 07 22t15 05 48 07 00" }, "line" \[ { "salesitemlinedetail" { "unitprice" 50, "taxcoderef" { "value" "tax" }, "qty" 2, "itemref" { "value" "1", "name" "services" } }, "linenum" 1, "id" "3", "detailtype" "salesitemlinedetail", "description" "description updated", "amount" 100 00 }, { "detailtype" "subtotallinedetail", "amount" 100 00 } ], "id" "13", "emailstatus" "notset", "duedate" "2021 11 01", "docnumber" "1005", "customfield" \[ { "type" "stringtype", "name" "crew #", "definitionid" "1" } ], "customerref" { "value" "9", "name" "55 twin lane" }, "currencyref" { "value" "usd", "name" "united states dollar" }, "billaddr" { "postalcode" "94482", "longitude" " 122 0642815", "line1" "370 easy st ", "lat" "37 4031672", "id" "9", "countrysubdivisioncode" "ca", "city" "middlefield" }, "balance" 50 00, "allowonlinecreditcardpayment" false, "allowonlineachpayment" false } ] }, timestamp=1635772499333, validrequest=true, version=1 0 }