# Update Invoice Summary Calculates and returns the financial summary (totals, taxes, discounts, retention) for an invoice based on the provided invoice data without saving the invoice. The request body wrapper key must be the singular of the path type (invoice, invoice_receipt, simplified_invoice, credit_note, debit_note, receipt); any other key returns 422 "No invoice element provided" (with the expected key name). Endpoint: POST /api/v3/{invoices-type}/update_summary Version: 3.1.0 Security: apiKeyAuth ## Path parameters: - `invoices-type` (string, required) The type of the invoice document. receipts (payment receipts) is accepted here; receipts have no create, update, clone or /new (those operations use DocumentTypeInvoiceParam). Enum: "invoices", "invoice_receipts", "simplified_invoices", "credit_notes", "debit_notes", "receipts" ## Query parameters: - `api_key` (string, required) Your API Key. Example: "YOUR_API_KEY" ## Request fields (application/json): - `invoice` (object) - `invoice.date` (string) Example: "2026-04-16" - `invoice.due_date` (string) Example: "2026-05-16" - `invoice.retention` (number) Example: 100 - `invoice.global_discount` (object) - `invoice.global_discount.value_type` (string) Example: "percentage" - `invoice.global_discount.value` (number) Example: 50 - `invoice.items` (array) Invoice items. Example: [{"name":"p2","description":"","unit_price":10,"unit":"","quantity":1,"tax":{"name":"IVA23","value":23},"discount":0,"retention":0},{"name":"p1","description":"Item description","unit_price":10,"quantity":10,"tax":{"name":"IVA23","value":23},"discount":50}] - `invoice.items.name` (string) Maximum 60 characters. Longer values are rejected with 422 ("Code for the item is too long"). - `invoice.items.description` (string) Maximum 200 characters and at most 20 lines. Longer values are rejected with 422. - `invoice.items.unit_price` (number) - `invoice.items.unit` (string) - `invoice.items.quantity` (number) - `invoice.items.discount` (number) - `invoice.items.tax` (object) - `invoice.items.tax.name` (string) ## Response 200 fields (application/json): - `summary` (object) - `summary.sum` (number) Example: 19.99 - `summary.discount` (number) - `summary.before_taxes` (number) Example: 19.99 - `summary.taxes` (number) Example: 4.6 - `summary.total` (number) Example: 24.59 - `summary.currency` (object) - `summary.currency.name` (string) Example: "Euro" - `summary.currency.code` (string) Example: "EUR" - `summary.currency.symbol` (string) Example: "€" - `summary.retention` (number) - `summary.pay_progress` (number) - `summary.to_pay` (number) Example: 24.59 - `summary.total_paid` (number) - `summary.taxes_breakdown` (array) Breakdown of taxes applied. Example: [{"category":"IVA23","items_value":10,"tax_value":2.3},{"category":"IVA23","items_value":9.99,"tax_value":2.3}] - `summary.taxes_breakdown.category` (string) - `summary.taxes_breakdown.items_value` (number) - `summary.taxes_breakdown.tax_value` (number) - `summary.total_currency_rate` (number) - `summary.rate` (number) Example: 1 ## Response 401 fields (application/json): - `errors` (array) Example: [{"error":"Authentication Error"}] - `errors.error` (string) ## Response 422 fields (application/json): - `errors` (array) Lista de erros de validação devolvida ao tentar atualizar a fatura com dados em falta ou inválidos. Example: [{"error":"Date can't be blank"},{"error":"Due date can't be blank"}] - `errors.error` (string) ## Response 400 fields