Global API
...
Request
Sales Receipt
Update
1min
the following is an example of update sales receipt the quickbooks invoice id (id) is required to update the invoice (see sales receipt docid\ ehs2xojrohwurgt hgng2 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 sales reeceipt list\<object> salesreceiptlist = new list\<object>(); map\<string, object> salesreceiptmap = new map\<string, object>(); salesreceiptmap put('id', '159'); 	salesreceiptmap put('synctoken','0'); 	salesreceiptmap put('customerref',new map\<string, object>{'value' => '9'}); // initializing the sales receipt 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 sales receipt salesreceiptmap put('line',lineitemlist); salesreceiptlist add(salesreceiptmap); // initializing the requestjson data to be passed map\<string, object> reqjsonmap = new map\<string, object>(); reqjsonmap put('salesreceipts' , salesreceiptlist); 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' , 'updatesalesreceipt'); 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=updatesalesreceipt, responsejson={ "statuscode" 200, "salesreceipts" \[ { "txntaxdetail" { "totaltax" 0 }, "txndate" "2021 11 01", "totalamt" 100 00, "synctoken" "1", "sparse" false, "shipaddr" { "postalcode" "94482", "longitude" " 122 0642815", "line1" "370 easy st ", "lat" "37 4031672", "id" "9", "countrysubdivisioncode" "ca", "city" "middlefield" }, "sfrecordid" "a0a5j000000u9jreaa", "metadata" { "lastupdatedtime" "2021 11 01t23 21 32 07 00", "createtime" "2021 11 01t23 15 23 07 00" }, "line" \[ { "salesitemlinedetail" { "unitprice" 50, "taxcoderef" { "value" "tax" }, "qty" 2, "itemref" { "value" "1", "name" "services" } }, "linenum" 1, "id" "2", "detailtype" "salesitemlinedetail", "description" "description updated", "amount" 100 00 }, { "detailtype" "subtotallinedetail", "amount" 100 00 } ], "id" "159", "emailstatus" "notset", "deposittoaccountref" { "value" "4", "name" "undeposited funds" }, "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" 0 } ] }, timestamp=1635834094372, validrequest=true, version=1 0 }