Global API
...
Requests
Invoice
Read
2min
to read invoices, 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 invoice 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>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', 'readinvoice'); 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=readinvoice, timestamp=1657006553277, validrequest=true, version=1 0, responsejson={ "currentpagerecords" null, "totalrecords" 2, "totalpages" 1, "searchid" "webservices 5333445 sb1 07052022850827757644992188 17adb3bb3", "pageindex" 1, "errors" \[ ], "customparamters" { "where" { "value" null, "keyvaluemap" { "internalid" "94209,94308" } } }, "status" "200""invoices" \[ { "undepfunds" null, "tranid" "inv439", "trandate" 1642752000, "total" 1 18, "terms" null, "taxtotal" 0 18, "subtotal" 1 0, "subsidiary" { "type" null, "name" "atlanta", "internalid" "20", "externalid" null }, "status" "paid in full", "shippingcost" null, "shippingaddress" null, "salesrep" null, "salesforceid" null, "otherrefnum" null, "nullfieldlist" null, "memo" "3", "location" { "type" null, "name" "testing", "internalid" "14", "externalid" null }, "lastmodifieddate" 1645105569, "itemlist" { "replaceall" null, "item" \[ { "unitsdisplay" null, "taxrate1" "18 0", "taxcode" { "type" null, "name" "vat in\ gst 18", "internalid" "36", "externalid" null }, "tax1amt" 0 18, "shipmethod" null, "shipgroup" null, "serialnumbers" null, "revrecstartdate" null, "revrecschedule" null, "revrecenddate" null, "rate" "1 00", "quantityremaining" null, "quantityreceived" null, "quantitybilled" null, "quantity" 1 0, "price" null, "ponum" null, "orderline" null, "onhand" null, "location" null, "line" 1, "jobname" null, "itemreceive" null, "itemname" null, "itemisfulfilled" null, "item" { "type" null, "name" "touch pad pro", "internalid" "570", "externalid" null }, "grossamt" 1 18, "expectedreceiptdate" null, "description" "linedesc", "department" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "false", "scriptid" "custcol checkbox", "internalid" "443", "fieldtype" null }, { "valuelookup" null, "value" "1", "scriptid" "custcol gh line no", "internalid" "175", "fieldtype" null } ] }, "createpo" null, "costestimatetype" null, "costestimate" null, "classification" null, "amount" 1 0 } ] }, "internalid" "94209", "handlingcost" null, "externalid" null, "exchangerate" 0 02, "entity" { "type" null, "name" "cust975at test account62105", "internalid" "72596", "externalid" null }, "duedate" 1623567600, "discounttotal" null, "discountrate" null, "discountitem" null, "department" { "type" null, "name" "test", "internalid" "3", "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 }, { "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 } ] }, "currencyrecord" { "type" null, "name" "sgd", "internalid" "6", "externalid" null }, "currencyname" "sgd", "createdfrom" null, "createddate" 1642770141, "classification" { "type" null, "name" "testing", "internalid" "3", "externalid" null }, "billingaddress" { "zip" "500081", "state" "telangana", "internalid" "79380", "country" " india", "city" "hyderabad", "attention" null, "addrphone" null, "addressee" "test account62105", "addr3" null, "addr2" null, "addr1" "nehrunagar" }, "account" { "type" null, "name" "accounts receivable", "internalid" "122", "externalid" null } }, { "undepfunds" null, "tranid" "inv440", "trandate" 1643011200, "total" 1 18, "terms" null, "taxtotal" 0 18, "subtotal" 1 0, "subsidiary" { "type" null, "name" "atlanta", "internalid" "20", "externalid" null }, "status" "pending approval", "shippingcost" null, "shippingaddress" null, "salesrep" null, "salesforceid" null, "otherrefnum" null, "nullfieldlist" null, "memo" "3", "location" { "type" null, "name" "testing", "internalid" "14", "externalid" null }, "lastmodifieddate" 1643008927, "itemlist" { "replaceall" null, "item" \[ { "unitsdisplay" null, "taxrate1" "18 0", "taxcode" { "type" null, "name" "vat in\ gst 18", "internalid" "36", "externalid" null }, "tax1amt" 0 18, "shipmethod" null, "shipgroup" null, "serialnumbers" null, "revrecstartdate" null, "revrecschedule" null, "revrecenddate" null, "rate" "1 00", "quantityremaining" null, "quantityreceived" null, "quantitybilled" null, "quantity" 1 0, "price" null, "ponum" null, "orderline" null, "onhand" null, "location" null, "line" 1, "jobname" null, "itemreceive" null, "itemname" null, "itemisfulfilled" null, "item" { "type" null, "name" "touch pad pro", "internalid" "570", "externalid" null }, "grossamt" 1 18, "expectedreceiptdate" null, "description" "linedesc", "department" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "false", "scriptid" "custcol checkbox", "internalid" "443", "fieldtype" null } ] }, "createpo" null, "costestimatetype" null, "costestimate" null, "classification" null, "amount" 1 0 } ] }, "internalid" "94308", "handlingcost" null, "externalid" null, "exchangerate" 0 02, "entity" { "type" null, "name" "cust980at test account62105", "internalid" "72888", "externalid" null }, "duedate" 1623567600, "discounttotal" null, "discountrate" null, "discountitem" null, "department" { "type" null, "name" "test", "internalid" "3", "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 }, { "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 } ] }, "currencyrecord" { "type" null, "name" "sgd", "internalid" "6", "externalid" null }, "currencyname" "sgd", "createdfrom" null, "createddate" 1643008927, "classification" { "type" null, "name" "testing", "internalid" "3", "externalid" null }, "billingaddress" { "zip" "500081", "state" "telangana", "internalid" "79672", "country" " india", "city" "hyderabad", "attention" null, "addrphone" null, "addressee" "test account62105", "addr3" null, "addr2" null, "addr1" "nehrunagar" }, "account" { "type" null, "name" "accounts receivable", "internalid" "122", "externalid" null } } ], }, }