Create invoice

Issue an invoice for a client with products or free lines.

POST https://cotlet.dev/api/v1/fakturownia/clients/{client_id}/invoices

write Confirm

Saves an invoice with the next number in your series. Lines use product_id and quantity, or name, tax, quantity and total_price_gross. Without department_id it uses your default company data. If automatic KSeF sending is on for this account, saving also sends the invoice to KSeF, which is legally binding. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: create_invoice
NameTypeDescription
client_id integer required integer Client ID from list_clients or create_client.
positions array required array Lines: {product_id, quantity}, or {name, tax, quantity, total_price_gross}.
kind string string vat, proforma, advance, final, estimate, bill or receipt. Default: vat.
payment_to_kind integer integer Days until due. Use payment_to for a fixed date.
payment_to string string YYYY-MM-DD due date.
issue_date string string YYYY-MM-DD. Default: today.
sell_date string string YYYY-MM-DD or YYYY-MM. Default: issue date.
department_id integer integer Company or department that issues the invoice.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/fakturownia/clients/4817/invoices \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"vat","payment_to_kind":14,"positions":[{"product_id":2203,"quantity":2}]}'
Python
result = client.call("fakturownia", "create_invoice", {"client_id":4817,"kind":"vat","payment_to_kind":14,"positions":[{"product_id":2203,"quantity":2}]})
Node.js
const result = await cotlet.call('fakturownia', 'create_invoice', {"client_id":4817,"kind":"vat","payment_to_kind":14,"positions":[{"product_id":2203,"quantity":2}]});
CLI
cotlet call fakturownia create_invoice --data '{"client_id":4817,"kind":"vat","payment_to_kind":14,"positions":[{"product_id":2203,"quantity":2}]}'

Example response

JSON

{
  "id": 5120,
  "number": "14/10/2026/1",
  "kind": "vat",
  "status": "issued",
  "client_id": 4817,
  "price_net": "1000.00",
  "price_tax": "230.00",
  "price_gross": "1230.00",
  "currency": "PLN",
  "payment_to": "2026-10-28",
  "gov_status": null
}

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.