| name | register_payment |
| tier | 1 |
| task | T07 |
| description | Use when the task says the customer ALREADY HAS an unpaid invoice and asks to register/record the payment. Keywords: 'facture impayée', 'unbezahlte Rechnung', 'ubetalt faktura', 'unpaid invoice', 'fatura pendente'. The invoice ALREADY EXISTS — do NOT create a new one. If the task mentions creating products, orders, or new invoices, use order_invoice_payment instead. |
Register Payment
Exactly 3 API calls. Find invoice directly (no customer lookup), get payment type, register payment.
Call 1: Find Unpaid Invoice
Search ALL invoices directly — customerId is NOT required. On a fresh sandbox there are very few invoices.
GET /invoice?invoiceDateFrom=2020-01-01&invoiceDateTo=2030-12-31&fields=id,invoiceNumber,amount,amountOutstanding&count=50
Find the invoice where amountOutstanding > 0. On a fresh sandbox there is typically only one unpaid invoice.
Call 2: Get Payment Types
GET /invoice/paymentType?fields=id,description&count=50
Use "Betalt til bank" or "Kontant" payment type.
Call 3: Register Payment
PUT /invoice/<invoice_id>/:payment?paymentDate=2026-03-20&paymentTypeId=<type_id>&paidAmount=<amount>
Use amountOutstanding from call 1 as paidAmount. All parameters are query parameters, not JSON body.
Total: 3 calls, 0 errors.
Gotchas
- No customer lookup needed — search invoices directly
GET /invoice requires invoiceDateFrom and invoiceDateTo — use wide range
- Payment endpoint uses PUT with query params, not POST with JSON body
- Use today's date for
paymentDate
paidAmount should match amountOutstanding from the invoice (includes VAT)