const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Accrue March rent',
date: '2026-03-31',
journal_no: 'JE-2026-031',
currency: 'NGN',
status: 'draft',
items: [
{
category: 'Rent Expense',
debit: 250000,
credit: 0,
description: 'March office rent'
},
{
category: 'Accrued Expenses',
debit: 0,
credit: 250000,
description: 'March office rent accrual'
}
]
})
};
fetch('https://staging-api.usetyms.com/v1/adam/create/journal', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));