Global API
...
Request
Invoice

Read

1min
you can read all the invoices 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 invoices will be returned per call, with line items shown for each, when the page parameter is used e g page=1 includearchived boolean e g includearchived=true invoices with a status of archived will be included in the response ids string filter by a comma separated list of invoicesids contactids string filter by a comma separated list of contactids statuses string filter by a comma separated list of statuses invoicenumbers string filter by a comma separated list of invoicenumbers where string filter using the where parameter we recommend you limit filtering to the optimised elements https //developer xero com/documentation/api/accounting/invoices#optimised use of the where filter only request // create a map to store all the data of a invoice map\<string, object> invoicefiltersmap = new map\<string, object>(); invoicefiltersmap put('ids', 'c8a475b9 42db 4c6b 8450 5f62e2df29a1'); // initializing the request data to be passed map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'readinvoice'); reqobj put('queryparameters', invoicefiltersmap); //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=readinvoice, responsejson={ "statuscode" 200, "invoices" \[ { "updateddateutc"\ null, "type" "accrec", "totaltax" 0 00, "totaldiscount"\ null, "total" 1000 00, "telephone" "", "subtotal" 1000 00, "status" "draft", "senttocontact"\ null, "salesforcerecordid"\ null, "reference" "", "purchaseordernumber"\ null, "purchaseorderid"\ null, "payments" \[ ], "lineitems" \[ ], "lineamounttypes" "exclusive", "isdiscounted"\ false, "invoicenumber" "inv 0001", "invoiceid" "c8a475b9 42db 4c6b 8450 5f62e2df29a1", "haserrors"\ false, "duedatestring" "2021 12 06t00 00 00", "duedate" "/date(1638748800000+0000)/", "deliveryinstructions" "", "deliverydatestring"\ null, "deliverydate"\ null, "deliveryaddress" "", "datevariable" "/date(1636588800000+0000)/", "datestring" "2021 11 11t00 00 00", "currencyrate" 1 0000000000, "currencycode" "inr", "creditnotes" \[ ], "contact" { "name" "test contact 2", "contactstatus"\ null, "contactid" "c84ebb15 0a8d 4145 933f 203e68d014a0" }, "brandingthemeid" "8e43230b c814 4435 bdb4 84cad1875e3d", "attentionto" "", "amountpaid" 0 00, "amountdue" 1000 00, "amountcredited" 0 00 } ], "errors" \[ ] }, timestamp=1636611532979, validrequest=true, version=1 0 }