Issue invoice
Issue a domestic invoice for a contractor with one or more lines.
POST https://cotlet.dev/api/v1/ifirma/contractors/{contractor_id}/invoices
write Confirm
Issues the invoice with the next number in the series, the same as "Wystaw". Lines need name, quantity, unit, unit price and VAT rate; a line that is not exempt may also need a PKWiU code. The invoice is not sent to KSeF or to the buyer until you call send_invoice_to_ksef or send_invoice_email. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| contractor_id string required | string | Contractor ID from list_contractors or create_contractor. |
| lines array required | array | Lines: {name, quantity, unit, unit_price, vat_rate}. vat_rate is 23, 8, 5, 0 or exempt. |
| calculate_from string | string | net or gross: which price you give. Default: net. |
| issue_date string | string | YYYY-MM-DD. Default: today. |
| sale_date string | string | YYYY-MM-DD. Default: issue date. |
| due_date string | string | YYYY-MM-DD. |
| payment_method string | string | transfer, cash or card. |
| notes string | string | Remarks printed on the invoice, up to 1000 characters. |
Request
curl -X POST https://cotlet.dev/api/v1/ifirma/contractors/c_4817/invoices \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"calculate_from":"net","issue_date":"2026-10-14","sale_date":"2026-10-14","due_date":"2026-10-28","payment_method":"transfer","lines":[{"name":"Website retainer","quantity":2,"unit":"month","unit_price":500,"vat_rate":23}]}' result = client.call("ifirma", "issue_invoice", {"contractor_id":"c_4817","calculate_from":"net","issue_date":"2026-10-14","sale_date":"2026-10-14","due_date":"2026-10-28","payment_method":"transfer","lines":[{"name":"Website retainer","quantity":2,"unit":"month","unit_price":500,"vat_rate":23}]}) const result = await cotlet.call('ifirma', 'issue_invoice', {"contractor_id":"c_4817","calculate_from":"net","issue_date":"2026-10-14","sale_date":"2026-10-14","due_date":"2026-10-28","payment_method":"transfer","lines":[{"name":"Website retainer","quantity":2,"unit":"month","unit_price":500,"vat_rate":23}]}); cotlet call ifirma issue_invoice --data '{"contractor_id":"c_4817","calculate_from":"net","issue_date":"2026-10-14","sale_date":"2026-10-14","due_date":"2026-10-28","payment_method":"transfer","lines":[{"name":"Website retainer","quantity":2,"unit":"month","unit_price":500,"vat_rate":23}]}' Example response
{
"id": 7020118,
"number": "41/2026",
"draft": false,
"buyer": "Blue Fern Studio",
"net": 1000,
"vat": 230,
"gross": 1230,
"currency": "PLN",
"issue_date": "2026-10-14",
"due_date": "2026-10-28",
"ksef_status": null
}