Global API
...
Request
Purchase Order
Read
1 min
you can read all pos from xero without passing any filters however, to retrieve specific records based on any filter conditions, you can add the following filters as "queryparameters" as shown in the below example param name type description order string order by any element returned page string up to 100 purchase orders will be returned per call, with line items shown for each, when the page parameter is used e g page=1 status string filter by purchase order status draft, authorised, billed date from date filter by purchase order date date to date filter by purchase order date request // create a map to store all the data of a purchase order map\<string, object> purchaseordermap = new map\<string, object>(); purchaseordermap put('status', 'draft'); // initializing the request data to be passed map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'readpurchaseorder'); reqobj put('queryparameters', purchaseordermap); //required, if xero multi org is enabled in breadwinner reqobj put('xeroorgid', '!aa00tm'); // placing a request to breadwinner global api map\<string, object> respmap = bread winner breadwinnerxeroapi call(reqobj); system debug(respmap); response { action=readpurchaseorder, responsejson={ "statuscode" 200 "purchaseorders" \[ { "updateddateutc"\ null, "type" "purchaseorder", "totaltax" 0 00, "totaldiscount"\ null, "total" 1000 00, "telephone" "", "subtotal" 1000 00, "status" "draft", "senttocontact"\ null, "salesforcerecordid"\ null, "reference"\ null, "purchaseordernumber" "po 0001", "purchaseorderid" "2fef007e 1979 4634 9bb7 87c4559a0038", "payments"\ null, "lineitems" \[ { "unitamount" 100 0000, "tracking" \[ ], "taxtype" "input", "taxamount" 0 00, "quantity" 10 0000, "lineitemid" "fd9bd48c 9f10 44de aee4 c6185b2868c3", "lineamount" 1000 00, "itemcode"\ null, "discountrate"\ null, "description" "line item description updated", "accountcode" "310" } ], "lineamounttypes" "exclusive", "isdiscounted"\ false, "invoicenumber"\ null, "invoiceid"\ null, "haserrors"\ false, "duedatestring"\ null, "duedate"\ null, "deliveryinstructions" "", "deliverydatestring" "2021 12 06t00 00 00", "deliverydate" "2021 12 06", "deliveryaddress" "", "datevariable" "/date(1636588800000+0000)/", "datestring" "2021 11 11t00 00 00", "currencyrate" 1 0000000000, "currencycode" "inr", "creditnotes"\ null, "contact" { "name" "test contact 2", "contactstatus" "active", "contactid" "c84ebb15 0a8d 4145 933f 203e68d014a0" }, "brandingthemeid"\ null, "attentionto" "", "amountpaid"\ null, "amountdue"\ null, "amountcredited" 0 00 } ], "errors" \[ ] }, timestamp=1636638418069, validrequest=true, version=1 0 }