Global API
...
Requests
Cash Sale
Read
2min
to read cash sales, please use the below parameters supported “ where ” filters field name data type description datecreated long this will filter on an exact match (equal) use the “additionalfilter” option for a range of dates internalid string internal id of the cash sale multiple values can be passed in a comma separated string lastmodifieddate long this will filter on an exact match (equal) use the “additionalfilter” option for a range of dates subsidiary string internal id of subsidiary (primary) do not use this in additonalfilter multiple ids can be passed in a comma separated string ex 1,2 additonalfilter string construct the additional filter with a combination of the above fields using ‘+and+’ separator and pass it as a single string make sure to wrap the whole string using encodingutil urlencode trandate long transaction date of the record use the “additionalfilter” option for a range of dates status string to filter the records based on the status value ex status=active customer string to filter the records based on the customer multiple ids can be passed in a comma separated string ex 6,7 example request map\<string, object> filters = new map\<string, object>(); filters put('subsidiary', '1,2'); filters put('additionalfilter', encodingutil urlencode('lastmodifieddate>1628091060+and+lastmodifieddate<1629127860', 'utf 8')); // encode additionalfilter after constructing it with +and+ for multi filters // field filters and additionalfilter for where param map\<string, object> filtermap = new map\<string, object>(); filtermap put('where', new map\<string, object>{'keyvaluemap'=>filters}); map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('customparameters', filtermap); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'readcashsale'); reqobj put('requestjson', reqjson); // place a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp); response { action=readcashsale, timestamp=1657007086564, validrequest=true, version=1 0, responsejson={ "currentpagerecords" null, "totalrecords" 1, "totalpages" 1, "searchid" "webservices 5333445 sb1 07052022850298616113790521 b28e5b57f", "pageindex" 1, "errors" \[ ], "customparamters" { "where" { "value" null, "keyvaluemap" { "internalid" "73450" } } }, "status" "200""cashsales" \[ { "undepfunds" true, "tranid" "9", "trandate" 1615878000, "total" 146 32, "terms" null, "taxtotal" 22 32, "subtotal" 124 0, "subsidiary" { "type" null, "name" "parent company", "internalid" "1", "externalid" null }, "status" "not deposited", "shippingcost" null, "shippingaddress" { "zip" "94567", "state" "ca", "internalid" "23528", "country" " india", "city" "pope valley", "attention" null, "addrphone" null, "addressee" "cust465at rakesh reddy", "addr3" null, "addr2" null, "addr1" "palo alto" }, "salesrep" null, "salesforceid" null, "otherrefnum" null, "nullfieldlist" null, "memo" "2312", "location" { "type" null, "name" "hyderabad", "internalid" "6", "externalid" null }, "lastmodifieddate" 1656405363, "itemlist" { "replaceall" null, "item" \[ { "unitsdisplay" null, "taxrate1" "18 0", "taxcode" { "type" null, "name" "vat in\ gst 18", "internalid" "36", "externalid" null }, "tax1amt" 22 32, "shipmethod" null, "shipgroup" null, "serialnumbers" null, "revrecstartdate" null, "revrecschedule" null, "revrecenddate" null, "rate" null, "quantityremaining" null, "quantityreceived" null, "quantitybilled" null, "quantity" 1 0, "price" { "type" null, "name" "custom", "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" "laptop", "internalid" "591", "externalid" null }, "grossamt" 146 32, "expectedreceiptdate" null, "description" null, "department" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "true", "scriptid" "custcol checkbox", "internalid" "443", "fieldtype" null }, { "valuelookup" null, "value" "123 0", "scriptid" "custcol decimal", "internalid" "449", "fieldtype" null }, { "valuelookup" null, "value" "desc", "scriptid" "custcollinedes", "internalid" "242", "fieldtype" null } ] }, "createpo" null, "costestimatetype" null, "costestimate" null, "classification" null, "amount" 124 0 } ] }, "internalid" "73450", "handlingcost" null, "externalid" null, "exchangerate" 23 0, "entity" { "type" null, "name" "cust465at gs solutions rakesh reddy", "internalid" "20198", "externalid" null }, "duedate" null, "discounttotal" null, "discountrate" null, "discountitem" null, "department" 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 }, { "valuelookup" null, "value" "76 89", "scriptid" "custbody decimal", "internalid" "448", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custbody edoc gen trans pdf", "internalid" "925", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custbody ei ds txn identifier", "internalid" "932", "fieldtype" null }, { "valuelookup" null, "value" "prw", "scriptid" "custbody freeformtext", "internalid" "451", "fieldtype" null } ] }, "currencyrecord" { "type" null, "name" "us dollars", "internalid" "2", "externalid" null }, "currencyname" "us dollars", "createdfrom" null, "createddate" 1615876585, "classification" null, "billingaddress" { "zip" "94567", "state" "ca", "internalid" "23528", "country" " india", "city" "pope valley", "attention" null, "addrphone" null, "addressee" "cust465at rakesh reddy", "addr3" null, "addr2" null, "addr1" "palo alto" }, "account" null } ], }, }