Global API
...
Requests
Cash Sale
Create
1min
to create a cash refund in netsuite, use action as "createcashsale" and pass the cash sale data in the requestjson under "cashsales" note you can only create one record at a time the following is an example of create cashsale where we are setting every possible field (see https //app archbee io/docs/ lihuunv 7xnqrtzhskkc/hnjmkn99qxwdeafyyifsq cash sale docid\ rwxpkw l gvoupv njvbc for the available fields) the response will return the response back from netsuite, which includes the new netsuite cash sale id (internalid), plus the newly created salesforce cash sale id (salesforceid) request //create a map to store all the data of a cash sale map\<string, object> nscashsale = new map\<string, object>(); nscashsale put('classification', new map\<string, object>{'internalid'=>'5'}); nscashsale put('department', new map\<string, object>{'internalid'=>'1'}); 	nscashsale put('entity', new map\<string, object>{'internalid'=>'362'}); 	nscashsale put('location',new map\<string, object>{'internalid'=>'1'}); 	nscashsale put('memo', 'cash sale 300'); nscashsale put('otherrefnum', '4343400'); nscashsale put('trandate', datetime newinstance(2020, 10, 07) gettime()/1000); // 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', 'true'); 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('item', new map\<string, object>{'internalid'=>'239'}); lineitem put('quantity', 4); 	 lineitem put('revrecenddate', datetime newinstance(2021, 09, 07) gettime()/1000); lineitem put('revrecstartdate', datetime newinstance(2021, 09, 07) gettime()/1000); // 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', 'false'); 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); 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', 'createcashsale'); 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=createcashsale, timestamp=1639549899627, validrequest=true, version=1 0, responsejson={ "errors" \[], "status" "200", "cashsales" \[ { "undepfunds"\ true, "tranid" "11", "trandate" 1601956800, "total" 16 0, "terms"\ null, "taxtotal" 0 0, "subtotal" 16 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" "a0b0l00000avfrgea3", "otherrefnum" "4343400", "nullfieldlist"\ null, "memo" "cash sale 300", "location" { "type"\ null, "name" "test atlanta west", "internalid" "1", "externalid"\ null }, "lastmodifieddate" 1639549869, "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" 4 0, "price" { "type"\ null, "name" "base price", "internalid" "1", "externalid"\ null }, "ponum"\ null, "orderline"\ null, "onhand"\ null, "location"\ null, "line" 2, "jobname"\ null, "itemreceive"\ null, "itemname"\ null, "itemisfulfilled"\ null, "item" { "type"\ null, "name" "bow", "internalid" "239", "externalid"\ null }, "grossamt" 8 0, "expectedreceiptdate"\ null, "description"\ null, "department"\ null, "customfieldlist" { "customfield" \[ { "valuelookup"\ null, "value" "false", "scriptid" "custcol checkbox", "internalid" "443", "fieldtype"\ null } ] }, "createpo"\ null, "costestimatetype"\ null, "costestimate"\ null, "classification"\ null, "amount" 8 0 } ] }, "internalid" "91603", "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" "true", "scriptid" "custbody checkbox", "internalid" "272", "fieldtype"\ null } ] }, "currencyrecord" { "type"\ null, "name" "us dollars", "internalid" "2", "externalid"\ null }, "currencyname" "us dollars", "createdfrom"\ null, "createddate" 1639549869, "classification" { "type"\ null, "name" "corporate sales", "internalid" "5", "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 } ] } }