Global API
...
Requests
Cash Sale

Update

1min
the following is an example of update cashsale where we are changing some of the fields (see https //app archbee io/docs/ lihuunv 7xnqrtzhskkc/fgc9eqdmrkfq6ct2cri5h cash sale docid\ rwxpkw l gvoupv njvbc for all available fields) the netsuite cash sale id (internalid) is required to update the cash sale note you can only update one record at a time the response returns the complete cash sale information, but we have shortened the response in our example for ease of reading request //create a map to store all the data of a cash sale map\<string, object> nscashsale = new map\<string, object>(); &#x9;nscashsale put('internalid', '91704'); nscashsale put('classification', new map\<string, object>{'internalid'=>'2'}); nscashsale put('department', new map\<string, object>{'internalid'=>'1'}); &#x9;nscashsale put('memo', 'cashsale 215'); nscashsale put('otherrefnum', '43434544'); // initializing the cash sale custom fields list\<object> cscustomfieldlist = new list\<object>(); map\<string,object> cscustomfield = new map\<string,object>(); cscustomfield put('fieldtype', 'boolean'); cscustomfield put('scriptid', 'custbody checkbox'); cscustomfield put('value', 'false'); cscustomfieldlist add(cscustomfield); // adding the cash sale custom fields nscashsale put('customfieldlist', new map\<string,object>{'customfield'=>cscustomfieldlist}); // initializing the cash sale line items list\<object> lineitemlist = new list\<object>(); map\<string, object> lineitem = new map\<string, object>(); lineitem put('description', ' for shooting arrows'); lineitem put('line', 1); // updates the existing line item with line number as 1 lineitem put('quantity', 15); // initializing the line item custom fields list\<object> licustomfieldlist = new list\<object>(); map\<string, object> licustomfield = new map\<string, object>(); licustomfield put('fieldtype', 'boolean'); licustomfield put('scriptid', 'custcol checkbox'); licustomfield put('value', 'true'); licustomfieldlist add(licustomfield); // adding the cash sale line item custom fields lineitem put('customfieldlist', new map\<string, object>{'customfield'=>licustomfieldlist}); lineitemlist add(lineitem); // adding the line items to cash sale map\<string, object> cslineitemlist = new map\<string, object>(); cslineitemlist put('item', lineitemlist); &#x9; cslineitemlist put('replaceall', false); nscashsale put('itemlist', cslineitemlist); // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('cashsales', new list\<object>{nscashsale}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'updatecashsale'); reqobj put('requestjson', reqjson); // placing a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp); response { action=updatecashsale, timestamp=1639554954330, validrequest=true, version=1 0, responsejson={ "errors" \[], "status" "200", "cashsales" \[ { "undepfunds"\ true, "tranid" "13", "trandate" 1601956800, "total" 30 0, "terms"\ null, "taxtotal" 0 0, "subtotal" 30 0, "subsidiary" { "type"\ null, "name" "parent company", "internalid" "1", "externalid"\ null }, "status" "not deposited", "shippingcost"\ null, "shippingaddress"\ null, "salesrep" { "type"\ null, "name" "navaneeth d", "internalid" "4", "externalid"\ null }, "salesforceid" "a0b0l00000avfsgean", "otherrefnum" "43434544", "nullfieldlist"\ null, "memo" "cashsale 215", "location" { "type"\ null, "name" "test atlanta west", "internalid" "1", "externalid"\ null }, "lastmodifieddate" 1639554948, "itemlist" { "replaceall"\ null, "item" \[ { "unitsdisplay"\ null, "taxrate1" "0 0", "taxcode" { "type"\ null, "name" "vat in\ undef in", "internalid" "5", "externalid"\ null }, "tax1amt" 0 0, "shipmethod"\ null, "shipgroup"\ null, "serialnumbers"\ null, "revrecstartdate"\ null, "revrecschedule"\ null, "revrecenddate"\ null, "rate" "2 00", "quantityremaining"\ null, "quantityreceived"\ null, "quantitybilled"\ null, "quantity" 15 0, "price" { "type"\ null, "name" "base price", "internalid" "1", "externalid"\ null }, "ponum"\ null, "orderline"\ null, "onhand"\ null, "location"\ null, "line" 1, "jobname"\ null, "itemreceive"\ null, "itemname"\ null, "itemisfulfilled"\ null, "item" { "type"\ null, "name" "bow", "internalid" "239", "externalid"\ null }, "grossamt" 30 0, "expectedreceiptdate"\ null, "description" " for shooting arrows", "department"\ null, "customfieldlist" { "customfield" \[ { "valuelookup"\ null, "value" "true", "scriptid" "custcol checkbox", "internalid" "443", "fieldtype"\ null } ] }, "createpo"\ null, "costestimatetype"\ null, "costestimate"\ null, "classification"\ null, "amount" 30 0 } ] }, "internalid" "91704", "handlingcost"\ null, "externalid"\ null, "exchangerate" 1 0, "entity" { "type"\ null, "name" "21 atherton grocery", "internalid" "362", "externalid"\ null }, "duedate"\ null, "discounttotal" 0 0, "discountrate"\ null, "discountitem"\ null, "department" { "type"\ null, "name" "pr department", "internalid" "1", "externalid"\ null }, "customform"\ null, "customfieldlist" { "customfield" \[ { "valuelookup"\ null, "value" " ", "scriptid" "custbody breadwinner pc internal id", "internalid" "588", "fieldtype"\ null }, { "valuelookup"\ null, "value" "false", "scriptid" "custbody checkbox", "internalid" "272", "fieldtype"\ null } ] }, "currencyrecord" { "type"\ null, "name" "us dollars", "internalid" "2", "externalid"\ null }, "currencyname" "us dollars", "createdfrom"\ null, "createddate" 1639554102, "classification" { "type"\ null, "name" "individual partner class", "internalid" "2", "externalid"\ null }, "billingaddress" { "zip" "94567", "state" "ca", "internalid"\ null, "country" " unitedstates", "city" "pope valley", "attention"\ null, "addrphone"\ null, "addressee"\ null, "addr3"\ null, "addr2" "palo alto", "addr1"\ null }, "account"\ null } ] } }