const options = {
method: 'PATCH',
headers: {
'x-api-key': '<api-key>',
'x-api-secret': '<api-key>',
'x-connector-id': '<api-key>',
'x-owner-id': '<api-key>',
'x-session-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
invoiceCode: '<string>',
customerContact: {
id: '<string>',
object: 'resourceRef',
model: '<string>',
fields: '<unknown>',
rawResource: '<unknown>',
remote: {id: '<string>'},
createdAt: '<string>',
updatedAt: '<string>'
},
customerCompany: {
id: '<string>',
object: 'resourceRef',
model: '<string>',
fields: '<unknown>',
rawResource: '<unknown>',
remote: {id: '<string>'},
createdAt: '<string>',
updatedAt: '<string>'
},
issuedAt: '<string>',
dueAt: '<string>',
paidAt: '<string>',
status: 'draft',
lineItems: [
{
id: '<string>',
object: 'resourceRef',
model: '<string>',
fields: '<unknown>',
rawResource: '<unknown>',
remote: {id: '<string>'},
createdAt: '<string>',
updatedAt: '<string>'
}
],
currency: '<string>',
preTaxAmount: 1,
taxAmount: 1,
totalAmount: 1,
inclusiveOfTax: true,
balance: 1,
note: '<string>'
})
};
fetch('https://api.runmorph.dev/v1/resources/accountingInvoice/{resourceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));