Global API
Request
Invoice
6 min
in xero, the "invoice" object includes invoices, bills when requesting an invoice, use the requestjson to pass the invoice data, and the response will have responsejson which stores the invoices response returned by xero the invoice object has the following parameters invoice field name data type description type string represents whether the record is invoice (accrec) or bill (accpay) contact contact docid\ xpsz7qutzphbpo3vustz the id (unique xero id) for the referenced customer datestring string date invoice was issued duedatestring string date invoice is due status string status of the invoice lineamounttypes string type of amounts like tax "exclusive", "inclusive" and "notax" lineitems https //docs breadwinner com/xero/invoice#ag lineitem individual line items of a transaction subtotal decimal total of invoice excluding taxes totaltax decimal total tax on invoice total decimal total of invoice tax inclusive (i e subtotal + totaltax) currencycode string the currency that invoice has been raised in currencyrate decimal the currency rate for a multicurrency invoice invoiceid string read only; unique identifier generated by xero invoicenumber string accrec unique alpha numeric code identifying invoice (printable ascii characters only) accpay non unique alpha numeric code identifying invoice (printable ascii characters only) this value will also display as reference in the ui for accpay reference string accrec only additional reference number brandingthemeid string payments https //docs breadwinner com/xero/invoice#rh payment details of payments that have been applied to an invoice creditnotes https //docs breadwinner com/xero/invoice#p1 creditnote details of credit notes that have been applied to an invoice amountdue decimal amount remaining to be paid on invoice amountpaid decimal sum of payments received for invoice amountcredited decimal sum of all credit notes, over payments and pre payments applied to an invoice salesforce account id string to link the invoice with the salesforce account salesforce opportunity id string to link the invoice with the salesforce opportunity emailinvoice boolean to send the invoice via email after creating it lineitem field name data type description itemcode string code of the product description string description of the line item taxtype string used as an override if the default tax code for the selected accountcode is not correct accountcode string lineitemid string the xero generated identifier for a lineitem unitamount decimal lineitem unit amount taxamount decimal the tax amount is auto calculated as a percentage of the line amount based on the tax rate lineamount decimal the line amount reflects the discounted price if a discountrate has been used i e lineamount = quantity unit amount ((100 discountrate)/100) quantity decimal lineitem quantity discountrate decimal percentage discount being applied to a line item only supported on accrec invoices accpay invoices tracking list< https //docs breadwinner com/xero/invoice#dw trackingcategory > section for optional tracking category any lineitem can have a maximum of 2 trackingcategories payment field name data type description paymentid string paymentdate date datevariable string reference string amount decimal currencyrate decimal hasaccount boolean creditnote field name data type description creditnoteid string creditnotenumber string id string datestring string datevariable string appliedamount decimal total decimal trackingcategory field name data type description name string the name of the tracking category e g department, region option string name of the option (required) trackingcategoryid string the xero identifier for a tracking option e g ae777a87 5ef3 4fa0 a4f0 d10e1f13073a