Send invoice to KSeF

Send one issued invoice to the Polish KSeF e-invoicing system.

POST https://cotlet.dev/api/v1/ifirma/invoices/{invoice_id}/to-ksef

write Confirm

Does what "Wyślij do KSeF" does and returns the first status, "Przekazana do wysyłki"; the KSeF number appears once the Ministry of Finance accepts it, so read it with get_invoice. KSeF must already be connected in the account. After sending, iFirma does not allow editing or deleting the invoice, and the issue date cannot be later than the sending date. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: send_invoice_to_ksef
NameTypeDescription
invoice_id integer required integer Invoice ID from list_invoices.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/ifirma/invoices/1/to-ksef \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("ifirma", "send_invoice_to_ksef", {"invoice_id":1})
Node.js
const result = await cotlet.call('ifirma', 'send_invoice_to_ksef', {"invoice_id":1});
CLI
cotlet call ifirma send_invoice_to_ksef --data '{"invoice_id":1}'

Example response

JSON

{
  "invoice_id": 7020118,
  "ksef_status": "queued",
  "ksef_number": 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.