The Mark Expense as Paid endpoint allows you to record payment for an unpaid expense. This is a specialized endpoint that specifically handles the payment workflow, updating the expense status and recording payment details.
This endpoint is designed for expenses that are currently unpaid. If an expense is already paid, the request will fail with an appropriate error message.
If the expense is already marked as paid, you’ll receive a 400 error. Use the Update Expense endpoint if you need to change payment details for an already-paid expense.
Payment dates must be valid dates in the correct format. The system may also validate that payment dates are reasonable (not too far in the past or future).
This endpoint is ideal for integrating with banking APIs that provide transaction data:
JavaScript
Copy
// Process bank transactions and mark corresponding expenses as paidbankTransactions.forEach(async (transaction) => { const expense = findMatchingExpense(transaction); if (expense) { await markExpensePaid(expense.id, transaction.date, getPaymentType(transaction.type)); }});