Global API
...
Requests
Purchase Order
Read
2min
to read purchase orders, 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 po 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 employee string to filter the records based on the employee 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', 'readpurchaseorder'); 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=readpurchaseorder, timestamp=1657008201370, validrequest=true, version=1 0, responsejson={ "currentpagerecords" null, "totalrecords" 2, "totalpages" 1, "searchid" "webservices 5333445 sb1 07052022849177422515921851 933af4dfa", "pageindex" 1, "errors" \[ ], "customparamters" { "where" { "value" null, "keyvaluemap" { "internalid" "642,929" } } }, "status" "200""purchaseorders" \[ { "tranid" "33", "trandate" 1553497200, "trackingnumbers" null, "total" 250000 0, "terms" null, "taxtotal" 0 0, "subtotal" 250000 0, "subsidiary" { "type" null, "name" "parent company", "internalid" "1", "externalid" null }, "status" "pending receipt", "source" null, "shipto" { "type" null, "name" "22 chandana brothers", "internalid" "364", "externalid" null }, "shippingaddress" { "zip" "123456", "state" "andhra pradesh", "internalid" "220", "country" " india", "city" "eluru", "attention" null, "addrphone" null, "addressee" "test chandana brothers", "addr3" null, "addr2" "main bazar", "addr1" "chandana bros" }, "shipmethod" null, "shipdate" 1553497200, "salesforceid" null, "otherrefnum" null, "nullfieldlist" null, "memo" null, "location" null, "lastmodifieddate" 1642685917, "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" "500 00", "quantityremaining" null, "quantityreceived" 0 0, "quantitybilled" 50 0, "quantity" 500 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" "test men's vintage jeans pant", "internalid" "23", "externalid" null }, "grossamt" 250000 0, "expectedreceiptdate" null, "description" null, "department" null, "customfieldlist" null, "createpo" null, "costestimatetype" null, "costestimate" null, "classification" null, "amount" 250000 0 } ] }, "internalid" "642", "fax" null, "externalid" null, "expenselist" null, "exchangerate" 1 0, "entity" { "type" null, "name" "test anuvarthh apparels pvt ltd", "internalid" "371", "externalid" null }, "employee" null, "email" null, "duedate" null, "department" null, "customform" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "false", "scriptid" "custbody34", "internalid" "558", "fieldtype" null }, { "valuelookup" null, "value" "372 nikhil jain", "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" "inr", "internalid" "1", "externalid" null }, "currencyname" "inr", "createdfrom" { "type" null, "name" "sales order #57", "internalid" "641", "externalid" null }, "createddate" 1553507677, "classification" null, "billingaddress" { "zip" "560011", "state" "karnataka", "internalid" "223", "country" " india", "city" "bangalore", "attention" null, "addrphone" null, "addressee" "test anuvarthh apparels pvt ltd", "addr3" null, "addr2" "jaya nagar east\tjayanagar", "addr1" "#, 108, 7th main rd, 2nd block," } }, { "tranid" "46", "trandate" 1553670000, "trackingnumbers" null, "total" 250 0, "terms" null, "taxtotal" 0 0, "subtotal" 250 0, "subsidiary" { "type" null, "name" "parent company", "internalid" "1", "externalid" null }, "status" "fully billed", "source" null, "shipto" { "type" null, "name" "30 shobha paradise", "internalid" "386", "externalid" null }, "shippingaddress" null, "shipmethod" null, "shipdate" 1553670000, "salesforceid" null, "otherrefnum" null, "nullfieldlist" null, "memo" null, "location" null, "lastmodifieddate" 1649745916, "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" "250 00", "quantityremaining" null, "quantityreceived" 1 0, "quantitybilled" 3 0, "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" "men's cotton pant", "internalid" "32", "externalid" null }, "grossamt" 250 0, "expectedreceiptdate" null, "description" null, "department" null, "customfieldlist" null, "createpo" null, "costestimatetype" null, "costestimate" null, "classification" null, "amount" 250 0 } ] }, "internalid" "929", "fax" null, "externalid" null, "expenselist" null, "exchangerate" 1 0, "entity" { "type" null, "name" "test h m clothing pvt ltd", "internalid" "388", "externalid" null }, "employee" null, "email" "lavanya\@dhruvsoft com", "duedate" null, "department" null, "customform" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "false", "scriptid" "custbody34", "internalid" "558", "fieldtype" null }, { "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" "inr", "internalid" "1", "externalid" null }, "currencyname" "inr", "createdfrom" { "type" null, "name" "sales order #77", "internalid" "928", "externalid" null }, "createddate" 1553666652, "classification" null, "billingaddress" null } ], }, }