Global API
...
Requests
Credit Memo

Read

2min
to read credit memos, 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 customer 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 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>1682507614+and+lastmodifieddate<1682507708', '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', 'readcreditmemo'); 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=readcreditmemo, timestamp= 1682507750255, validrequest=true, version=1 0, responsejson={ "currentpagerecords" 2, "totalrecords" 2, "totalpages" 1, "searchid" "webservices 5333445 042620231119430988205277638 1320f0b19719", "pageindex" 1, "errors" \[], "customparamters" { "where" { "value" null, "keyvaluemap" { "subsidiary" "1,2", "additionalfilter" "lastmodifieddate%3e1682507614%2band%2blastmodifieddate%3c1682507708" } } }, "status" "200", "creditmemos" \[ { "tranid" "171", "trandate" 1682478000, "total" 4183 64, "taxtotal" 638 19, "subtotal" 3545 45, "subsidiary" { "type" null, "name" "parent company", "internalid" "1", "externalid" null }, "status" "open", "shippingcost" null, "salesrep" null, "salesforceid" null, "refundcheck" null, "otherrefnum" null, "memo" null, "location" { "type" null, "name" "test 1", "internalid" "13", "externalid" null }, "lastmodifieddate" 1682507663, "job" null, "itemlist" { "replaceall" null, "item" \[ { "unitsdisplay" null, "taxrate1" "18 0", "taxcode" { "type" null, "name" "vat in\ gst 18", "internalid" "36", "externalid" null }, "tax1amt" 638 19, "shipmethod" null, "shipgroup" null, "serialnumbers" "1", "revrecstartdate" null, "revrecschedule" null, "revrecenddate" null, "rate" "3545 45454545", "quantityremaining" null, "quantityreceived" null, "quantitypicked" null, "quantitypacked" null, "quantityonhand" null, "quantityfulfilled" null, "quantitycommitted" null, "quantitybilled" null, "quantitybackordered" null, "quantityavailable" null, "quantity" 1 0, "price" { "type" null, "name" "alternate price 2", "internalid" "3", "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" "apple", "internalid" "444", "externalid" null }, "isclosed" null, "grossamt" 4183 64, "expectedreceiptdate" null, "description" "sales", "department" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "false", "scriptid" "custcol checkbox", "internalid" "443", "fieldtype" null } ] }, "createpo" null, "costestimatetype" " averagecost", "costestimate" 0 0, "classification" null, "billingschedule" null, "amount" 3545 45 } ] }, "internalid" "121663", "handlingcost" null, "externalid" null, "exchangerate" 0 011, "entity" { "type" null, "name" "12 gs solutions", "internalid" "46", "externalid" null }, "discounttotal" null, "discountrate" null, "discountitem" null, "department" null, "customform" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "1", "scriptid" "custbody15", "internalid" "182", "fieldtype" null }, { "valuelookup" null, "value" "3545 45", "scriptid" "custbody42", "internalid" "869", "fieldtype" null }, { "valuelookup" null, "value" "83890 test 12223", "scriptid" "custbody breadwinner pc internal id", "internalid" "588", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custbody checkbox", "internalid" "272", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custbody enableimport", "internalid" "691", "fieldtype" null } ] }, "currencyrecord" { "type" null, "name" "gbp", "internalid" "5", "externalid" null }, "currencyname" "gbp", "createdfrom" null, "createddate" 1682507663, "classification" null, "applylist" null, "applied" 0 0, "account" { "type" null, "name" "accounts receivable", "internalid" "122", "externalid" null } }, { "unapplied" 2360 0, "tranid" "172", "trandate" 1682478000, "total" 2360 0, "taxtotal" 360 0, "subtotal" 2000 0, "subsidiary" { "type" null, "name" "parent company", "internalid" "1", "externalid" null }, "status" "open", "shippingcost" null, "salesrep" null, "salesforceid" null, "refundcheck" null, "otherrefnum" null, "memo" null, "location" { "type" null, "name" "hyderabad hi tech city", "internalid" "10", "externalid" null }, "lastmodifieddate" 1682507702, "job" null, "itemlist" { "replaceall" null, "item" \[ { "unitsdisplay" null, "taxrate1" "18 0", "taxcode" { "type" null, "name" "vat in\ gst 18", "internalid" "36", "externalid" null }, "tax1amt" 360 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" 1 0, "price" { "type" null, "name" "custom", "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" "apple apple 001", "internalid" "11538", "externalid" null }, "isclosed" null, "grossamt" 2360 0, "expectedreceiptdate" null, "description" "a refrigerator", "department" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "false", "scriptid" "custcol checkbox", "internalid" "443", "fieldtype" null } ] }, "createpo" null, "costestimatetype" " averagecost", "costestimate" 0 0, "classification" null, "billingschedule" null, "amount" 2000 0 } ] }, "internalid" "121664", "handlingcost" null, "externalid" null, "exchangerate" 23 0, "entity" { "type" null, "name" "12 1 gs solutions gs solutions sub company", "internalid" "22501", "externalid" null }, "discounttotal" null, "discountrate" null, "discountitem" null, "department" null, "customform" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "1", "scriptid" "custbody15", "internalid" "182", "fieldtype" null }, { "valuelookup" null, "value" "2000", "scriptid" "custbody42", "internalid" "869", "fieldtype" null }, { "valuelookup" null, "value" "13730 gh contact", "scriptid" "custbody breadwinner pc internal id", "internalid" "588", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custbody checkbox", "internalid" "272", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custbody enableimport", "internalid" "691", "fieldtype" null } ] }, "currencyrecord" { "type" null, "name" "us dollars", "internalid" "2", "externalid" null }, "currencyname" "us dollars", "createdfrom" null, "createddate" 1682507702, "classification" null, "applylist" null, "applied" 0 0, "account" { "type" null, "name" "accounts receivable", "internalid" "122", "externalid" null } } ] } }