Record payment

Record a payment received on one invoice, on a bank account, with date and method.

POST https://cotlet.dev/api/v1/alegra/invoices/{invoice_id}/payments

write Confirm

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

Parameters: record_payment
NameTypeDescription
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.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/alegra/invoices/1042/payments \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":1130.5,"date":"2026-10-20","bank_account_id":"2","payment_method":"transfer"}'
Python
result = client.call("alegra", "record_payment", {"invoice_id":"1042","amount":1130.5,"date":"2026-10-20","bank_account_id":"2","payment_method":"transfer"})
Node.js
const result = await cotlet.call('alegra', 'record_payment', {"invoice_id":"1042","amount":1130.5,"date":"2026-10-20","bank_account_id":"2","payment_method":"transfer"});
CLI
cotlet call alegra record_payment --data '{"invoice_id":"1042","amount":1130.5,"date":"2026-10-20","bank_account_id":"2","payment_method":"transfer"}'

Example response

JSON

{
  "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
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.