Record payment
Record a payment received on one invoice, on a bank account, with date and method.
MCP tool alegra_write → record_payment
Books a payment of amount against one invoice and returns the new total paid and balance. The method is cash, check, transfer, deposit, credit-card or debit-card, and Alegra needs the date and the bank account. A payment of the full balance leaves the invoice at zero. Alegra does not delete a payment that is wrong: it is voided and can be restored, and only a payment that is not reconciled can be deleted. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| invoice_id string required | string | Invoice ID from list_invoices. |
| amount number required | number | Amount received. |
| date date required | date | Payment date, YYYY-MM-DD. |
| bank_account_id string required | string | Account ID from list_bank_accounts. |
| payment_method enum | enum | cash, check, transfer, deposit, credit-card or debit-card. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "alegra_write",
"arguments": {
"operation": "record_payment",
"arguments": {
"invoice_id": "1042",
"amount": 1130.5,
"date": "2026-10-20",
"bank_account_id": "2",
"payment_method": "transfer"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"payment_id": "311",
"invoice_id": "1042",
"number": "FV-0042",
"date": "2026-10-20",
"amount": 1130.5,
"payment_method": "transfer",
"bank_account": {
"bank_account_id": "2",
"name": "Bancolombia"
},
"total": 1130.5,
"total_paid": 1130.5,
"balance": 0
},
"isError": false
}