[Cotlet](https://cotlet.dev/index.md) · [Integrations](https://cotlet.dev/integrations.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Use cases](https://cotlet.dev/use-cases.md) · [Security](https://cotlet.dev/security.md) · [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md) · [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [Contact](https://cotlet.dev/contact.md) · [Pricing](https://cotlet.dev/pricing.md) · [Sign up](https://cotlet.dev/signup)

# Issue an iFirma invoice and send it to KSeF

> Issue a domestic iFirma invoice from a deal, send it to KSeF and email it to the buyer. Your agent shows the invoice and asks OK before each step.

Source: https://cotlet.dev/integrations/ifirma-api-mcp-server/issue-invoice-and-send-to-ksef

A client confirms the job, and the invoice is still a form: pick the contractor, add lines, issue it, then send it to KSeF and to the buyer as separate steps.

Cotlet does it in your own iFirma account with list\_contractors, issue\_invoice, send\_invoice\_to\_ksef and send\_invoice\_email, called by your AI agent, an n8n workflow or a script.

[Sign up free](https://cotlet.dev/app/signup?app=ifirma) [All iFirma tools](https://cotlet.dev/integrations/ifirma-api-mcp-server.md)

Hosted · nothing to install or maintain

## Can iFirma do this on its own?

iFirma has a documented API that issues a domestic invoice with POST fakturakraj.json, sends it by email and sends it to KSeF (checked 14 Oct 2026). It has no official MCP server. The gap is the setup: you activate API access, generate the invoice key, sign each request and write the code that finds the contractor and checks the totals.

## How you do it in iFirma today

1. Go to "Sprzedaż ➡ Faktury" and open the invoice form; pick the contractor, add lines with quantity, unit, price and VAT rate, and set the payment date.
2. Click "Wystaw" to save and issue the invoice, or "Zapisz szkic" to keep a draft without a number that you can edit later.
3. Open the issued invoice from "Sprzedaż ➡ Faktury ➡ lista faktur" and click "Wyślij do KSeF" at the bottom of the form.
4. The status changes to "Przekazana do wysyłki" and then "Zaakceptowany" next to the invoice number, together with the KSeF number.
5. What repeats: the contractor, lines and dates are entered again for every invoice, and the KSeF step is easy to forget.

## How to issue an iFirma invoice and send it to KSeF

Prompt

```
Issue a domestic VAT invoice in iFirma for Blue Fern Studio: 2 x Website retainer, net 500.00 each, 23% VAT, due in 14 days. Find the contractor by NIP first. Show me the invoice before you issue it, then send it to KSeF and by email.
```

1. 01  
### Find the contractor first  
list\_contractors searches by NIP, then by name, because iFirma keeps one record per buyer. A near match with a different spelling is shown to you instead of creating a duplicate.
2. 02  
### Check the totals before issuing  
The agent states contractor, lines, net, VAT, gross and due date from your prompt. A line with no VAT rate or unit is reported back, not guessed.
3. 03  
### Issue the invoice  
issue\_invoice takes the next number in the default series. By default it waits for your OK, because an issued invoice cannot be changed freely once it reaches KSeF.
4. 04  
### Send to KSeF, then read the status  
send\_invoice\_to\_ksef sends the invoice you just issued. The agent then reads it with get\_invoice and reports "Zaakceptowany" with the KSeF number, or the rejection.
5. 05  
### Email the buyer last  
send\_invoice\_email goes out after the KSeF step, so the buyer receives an invoice that already has its KSeF number. It also waits for your OK.

### What you get back

Example data

```
Issued invoice 41/2026 for Blue Fern Studio
2 x Website retainer: net 1,000.00, VAT 230.00, gross 1,230.00 PLN
Due 2026-10-28
KSeF: sent, status Przekazana do wysyłki
Emailed to billing@bluefern.example
```

### Other ways to ask

- Issue the same invoice for every client on my retainer list on the first of the month and show me the totals first.
- Save a draft invoice for Blue Fern Studio from this quote, do not issue or send it.
- Issue the invoice but do not send it to KSeF; I will send it myself after the review.

## What iFirma allows, and what to know first

- iFirma saves a draft with "Zapisz szkic" without a number, and drafts show in the invoice list and can be edited later.
- Once an invoice is sent to KSeF, iFirma does not allow editing or deleting it.
- The issue date cannot be later than the sending date, otherwise the Ministry of Finance rejects the invoice.
- Only invoices issued through the invoice form can be sent to KSeF, and IOSS sales are not sent.
- The same seller NIP, invoice number and document type already in KSeF is rejected as a duplicate, and so is a wrong buyer NIP.

issue\_invoice, send\_invoice\_to\_ksef and send\_invoice\_email ask for your OK by default. To run it daily without you, switch confirmation off for those tools in your dashboard.

Sources: [iFirma Help: Wysyłka faktur do KSeF w IFIRMA](https://pomoc.ifirma.pl/pomoc-artykul/wysylka-faktur-do-ksef-w-ifirma/) · [iFirma Help: Automatyczna wysyłka faktur do KSeF](https://pomoc.ifirma.pl/pomoc-artykul/automatyczna-wysylka-faktur-do-ksef/) · [iFirma API: faktura krajowa](https://api.ifirma.pl/wystawianie-faktury-sprzedaz%cc%87y-krajowej-towarow-i-uslug/) · [iFirma API: wysyłanie faktury do KSeF](https://api.ifirma.pl/wysylanie-faktury-do-ksef/)

## Call issue\_invoice from a script

curl

```
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}]}'
```

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
}
```

MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is ifirma\_write → issue\_invoice. Example data.

[Schedule it in n8n, Make, Zapier or cron](https://cotlet.dev/integrations/ifirma-api-mcp-server.md#automations)

## iFirma tools this automation uses

__Cotlet iFirma tools used to issue an iFirma invoice and send it to KSeF__
| Tool | Parameters |
| ----------------------- | -------------------------------------------------------------------------------------------------- |
| list\_contractors | name, nip, page |
| issue\_invoice | contractor\_id, lines, calculate\_from, issue\_date, sale\_date, due\_date, payment\_method, notes |
| send\_invoice\_to\_ksef | invoice\_id |
| send\_invoice\_email | invoice\_id, recipient\_email, message, include\_transfer\_details |

[All 14 iFirma tools with descriptions](https://cotlet.dev/integrations/ifirma-api-mcp-server.md#tools)

## Frequently asked questions

### Can my agent turn on automatic KSeF sending?

It does not need to. In the app, "KSeF ➡ Konfiguracja KSeF" sets automatic or on-request sending, and the default is manual. With manual sending, send\_invoice\_to\_ksef sends one invoice after your OK.

### Is it safe to connect iFirma to Cotlet?

Yes. You sign in to iFirma yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get iFirma once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.

## More iFirma automations

- [Book iFirma purchase invoices from KSeF as costs](https://cotlet.dev/integrations/ifirma-api-mcp-server/book-ksef-purchase-invoices.md)
- [Chase unpaid iFirma invoices with payment reminders](https://cotlet.dev/integrations/ifirma-api-mcp-server/chase-unpaid-invoices.md)
- [iFirma API and MCP server: every tool](https://cotlet.dev/integrations/ifirma-api-mcp-server.md)
- [All use cases](https://cotlet.dev/use-cases.md)

## Give your agent access to iFirma.

Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with iFirma.

[Sign up free](https://cotlet.dev/app/signup?app=ifirma)

---

Give your AI agents your signed-in browser.

**Product:** [Integrations](https://cotlet.dev/integrations.md) · [Use cases](https://cotlet.dev/use-cases.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Pricing](https://cotlet.dev/pricing.md) · [Security](https://cotlet.dev/security.md)

**Resources:** [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [GitHub](https://github.com/cotletdev/cotlet)

**Solutions:** [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md)

**Company:** [About](https://cotlet.dev/about.md) · [AI info: company facts](https://cotlet.dev/ai-info.md) · [Contact](https://cotlet.dev/contact.md)

**Legal:** [Terms of service](https://cotlet.dev/terms) · [Privacy policy](https://cotlet.dev/privacy) · [Refund policy](https://cotlet.dev/refunds) · [Acceptable use](https://cotlet.dev/acceptable-use) · [Cookie policy](https://cotlet.dev/cookies) · [DPA](https://cotlet.dev/dpa) · [Subprocessors](https://cotlet.dev/subprocessors)

**Elsewhere:** [Status page](https://status.cotlet.dev) · [Cotlet on GitHub](https://github.com/cotletdev) · [Cotlet on X](https://x.com/cotletdev) · [Cotlet on LinkedIn](https://www.linkedin.com/company/cotletdev) · [Cotlet on Product Hunt](https://www.producthunt.com/products/cotlet) · [Cotlet on Crunchbase](https://www.crunchbase.com/organization/cotlet) · [Cotlet on SaaSHub](https://www.saashub.com/cotlet)

Cotlet is an independent service. It is not affiliated with, endorsed by or sponsored by any of the products listed on this site. Product names are trademarks of their respective owners.

## For AI agents: sign your user up

Is your user asking you to sign them up for Cotlet? You can do it for them, no account or key needed.

1. Read the fields and their allowed values: GET https://cotlet.dev/api/v1/access-requests
2. Ask the user for each value: email, apps, what you will do with them. If they leave the password to you, generate a strong one and show it to them.
3. Show the user what you will send, then POST it as JSON to https://cotlet.dev/api/v1/access-requests.

One call creates the account and sends the access request; we email the user when access is granted.
