Global API
...
Requests
Cash Refund

Update

1min
the following is an example of updating a cash refund record where we are changing some of the fields (see cash refund docid\ t olxh qny0viz7wp1cvj https //app archbee io/docs/ lihuunv 7xnqrtzhskkc/fgc9eqdmrkfq6ct2cri5h for all available fields) the netsuite cash refund id (internalid) is required to update the cash refund note you can only update one record at a time the response returns the complete cash refund 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 refund map\<string, object> nscashrefund = new map\<string, object>(); &#x9;nscashrefund put('internalid', '121357'); nscashrefund put('classification', new map\<string, object>{'internalid'=>'4'}); nscashrefund put('department', new map\<string, object>{'internalid'=>'1'}); &#x9;nscashrefund put('memo', 'cashrefund 215'); nscashrefund put('otherrefnum', '43434544'); // initializing the cash refund custom fields list\<object> crcustomfieldlist = new list\<object>(); map\<string,object> crcustomfield = new map\<string,object>(); crcustomfield put('fieldtype', 'boolean'); crcustomfield put('scriptid', 'custbody checkbox'); crcustomfield put('value', 'false'); crcustomfieldlist add(crcustomfield); // adding the cash refund custom fields nscashrefund put('customfieldlist', new map\<string,object>{'customfield'=>crcustomfieldlist}); // initializing the cash refund 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); &#x9; lineitem put('amount', 150); // 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 refund line item custom fields lineitem put('customfieldlist', new map\<string, object>{'customfield'=>licustomfieldlist}); lineitemlist add(lineitem); // adding the line items to cash refund map\<string, object> crlineitemlist = new map\<string, object>(); crlineitemlist put('item', lineitemlist); &#x9; crlineitemlist put('replaceall', false); nscashrefund put('itemlist', crlineitemlist); // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('cashrefunds', new list\<object>{nscashrefund}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'updatecashrefund'); 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=updatecashrefund, timestamp=1682500479120, validrequest=true, version=1 0, responsejson={ "errors" \[], "status" "200", "cashrefunds" \[ { "tranid" "16", "trandate" 1682478000, "total" 400 0, "taxtotal" 0 0, "subtotal" 400 0, "subsidiary" { "type" null, "name" "parent company", "internalid" "1", "externalid" null }, "status" null, "shippingcost" 0 0, "salesrep" null, "salesforceid" "a061e000003ux0kaas", "refundcheck" false, "otherrefnum" "43434544", "memo" "cashrefund 215", "location" { "type" null, "name" "hyderabad hi tech city", "internalid" "10", "externalid" null }, "lastmodifieddate" 1682500474, "job" null, "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" null, "quantityremaining" null, "quantityreceived" null, "quantitypicked" null, "quantitypacked" null, "quantityonhand" null, "quantityfulfilled" null, "quantitycommitted" null, "quantitybilled" null, "quantitybackordered" null, "quantityavailable" null, "quantity" 15 0, "price" { "type" null, "name" null, "internalid" " 1", "externalid" null }, "ponum" null, "percentcomplete" null, "orderline" null, "onhand" null, "location" null, "line" 1, "jobname" null, "itemreceive" null, "itemname" null, "itemisfulfilled" null, "item" { "type" null, "name" "blue jeans", "internalid" "8823", "externalid" null }, "isclosed" null, "grossamt" 400 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" " lastpurchaseprice", "costestimate" 0 0, "classification" null, "billingschedule" null, "amount" 400 0 } ] }, "internalid" "121459", "handlingcost" 0 0, "externalid" null, "exchangerate" 1 0, "entity" { "type" null, "name" "cust1402at blue origin", "internalid" "109118", "externalid" null }, "discounttotal" 0 0, "discountrate" null, "discountitem" null, "department" { "type" null, "name" "test", "internalid" "3", "externalid" null }, "customform" { "type" null, "name" "custom cash refund", "internalid" "128", "externalid" null }, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "400", "scriptid" "custbody42", "internalid" "869", "fieldtype" null }, { "valuelookup" null, "value" " ", "scriptid" "custbody breadwinner pc internal id", "internalid" "588", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custbody enableimport", "internalid" "691", "fieldtype" null } ] }, "currencyrecord" { "type" null, "name" "inr", "internalid" "1", "externalid" null }, "currencyname" "inr", "createdfrom" null, "createddate" 1682496289, "classification" { "type" null, "name" "partner class", "internalid" "1", "externalid" null }, "applylist" null, "applied" null, "account" { "type" null, "name" "cheque account", "internalid" "1", "externalid" null } } ] } }