我已经将xero与我的应用程序集成了,用于我的帐户和帐单。现在,我想更新以前在xero上已经创建的发票。有什么解决办法吗?任何建议都是非常可取的。
答案 0 :(得分:1)
我有以下代码,可以将新项目“新事物”附加到发票上。
app.post('/invoicemodify', async (req, res) => {
let xero = new XeroClient(config);
let invoicemodify = await xero.invoices.update({
"InvoiceID": "*insert Invoice ID*",
"LineItems": [
{
"Description": "Consulting services as agreed (20% off standard rate)",
"Quantity": "10",
"UnitAmount": "100.00",
"AccountCode": "200",
"DiscountRate": "20"
},
{
"Description": "new thing",
"Quantity": "1",
"UnitAmount": "100.00",
"AccountCode": "200",
"DiscountRate": "50"
}
]
});
console.log("modify POST worked");
});