---
title: "Fakturownia and wFirma Integration from PLN 999 | VulCode"
description: "Invoices issued automatically in Fakturownia or wFirma from store orders, app purchases and subscriptions, with KSeF and payment status. From PLN 999, 2-3 days."
url: "https://vulcode.com/en/services/integrations/fakturownia-wfirma"
lang: "en"
---

[Home](https://vulcode.com/en) [Services](https://vulcode.com/en/services) [Integrations](https://vulcode.com/en/services/integrations) [Invoicing and ERP](https://vulcode.com/en/services/integrations/erp)

VulCode, a software house from Cracow, Poland, connects your store, app or Stripe subscriptions to Fakturownia or wFirma (Polish invoicing apps) through their APIs. The invoice is created in the program your accountant knows, from order or payment data, the program itself sends it to KSeF (Poland's national e-invoicing system), and the KSeF number and status come back to your system. The Fakturownia and wFirma integration costs from PLN 999 (about EUR 220) and usually takes 2-3 days, and the free quote comes back within an hour.

[Free quote](https://vulcode.com/en/quote) [Full pricing](https://vulcode.com/en/services/pricing)

# Fakturownia and wFirma API integration

## KSeF on the invoicing app's side or in your code

This is the first decision. With Fakturownia and wFirma the app usually wins, but not always.

### The app sends to KSeF

- Your accounting already works in Fakturownia or wFirma.

- You want one place for invoices, corrections and their KSeF statuses.

- Your system only has to supply data and receive the KSeF number.

An integration with the app's API: we create the invoice with a KSeF send request and read its status.

### Your system sends to KSeF

- Invoices are created in your system and should stay there.

- You need full control over the queue, offline modes and QR codes.

A direct KSeF API integration in your code, with no invoicing app in between.

[KSeF integration](https://vulcode.com/en/services/integrations/ksef)

## Fakturownia and wFirma from the API side

Both apps have a public API, but you talk to them differently.

|  | FakturowniaREST, JSON | wFirmaapi2.wfirma.pl |
| --- | --- | --- |
| Authentication | an API token from account settings | accessKey and secretKey from settings plus an appKey from wFirma, or OAuth |
| Data format | JSON | XML, or JSON with numbered branches |
| Several companies per account | a separate account domain | a company_id parameter in every request |
| Webhooks | Yes | Yes |
| Recurring invoices in the API | Yes | per the module documentation |
| Sending to KSeF | the gov_save_and_send parameter | handled in the app |

In wFirma the secretKey is shown only once, when created. You pass it to us straight away through a secure channel, or create a new one.

## KSeF statuses in Fakturownia

The gov_status field tells you what is happening to an invoice. Each status has its own reaction in your panel.

- 01 **processing**
  Being sent. We wait and check again.
  - data error **send_error**
  A send error. We show the gov_error_messages text so the data can be fixed.
  - KSeF error **server_error**
  An error on KSeF's side. We retry later without touching the invoice.

- 02 **ok**
  Accepted by KSeF. We store the gov_id number and the verification link for the QR code.
  - sent again **duplicate_error**
  An invoice with this number is already in KSeF. We check whether it is the same invoice sent twice.

- **status_check_error**: The status check failed, and the invoice may already be accepted. We check first, then retry if needed.
- **offline**: Issued in offline mode, waiting to reach KSeF within the legal deadline.
- **not_connected**: The account is not connected to KSeF. It needs authorisation in the app, not a code change.

## From a payment to a KSeF number

A sample flow for a subscription app. The invoicing app sits in the middle, not at the end.

**Payments****Your system****Fakturownia or wFirma****KSeF**

Payments → Your system

Payment paid

E.g. a Stripe webhook or a gateway notification

Your system → Fakturownia or wFirma

Create the invoice

Buyer data and lines from the order

Fakturownia or wFirma → KSeF

Send to KSeF

On the app's side

KSeF → Fakturownia or wFirma

KSeF number

Fakturownia or wFirma → Your system

Status and number

A webhook or a periodic check

Your system → Your system

PDF and link to the customer

The invoice in the client panel or by email

## Pitfalls we check

Each comes from the API documentation of the two apps.

- Fakturownia
  ### DEMO mode before production
  Invoices in DEMO mode go to the pre-production KSeF with demo_-prefixed statuses. That is how we test the whole path.

- ### Validation before sending
  With validation on, bad data blocks saving. With it off, errors land in gov_error_messages, which must be read.

- ### Documents outside KSeF
  Pro formas, receipts and other documents get not_applicable. We do not treat it as an error.

- ### company_id with several companies
  Without it a request can reach another of the user's companies. We set it on every call.

- ### Numbered branches in JSON
  In JSON, module branches must be numbered even when there is only one. A common reason for rejected requests.

- ### Three keys
  You create the accessKey and secretKey in settings; wFirma issues the appKey for the application. All three stay outside the code.

## An order turned into an invoice

The mapping for Fakturownia. The buyer needs the most care, as KSeF sending depends on it.

**Order in your system** **Invoice in Fakturownia**

`a business customer with a tax number`

`buyer_company: true, buyer_tax_no`

required with KSeF

`an EU company with an EU VAT number`

`buyer_tax_no_kind: "nip_ue"`

the number in EU format

`a private person`

`buyer_first_name, buyer_last_name`

buyer_company: false, no tax number

`a cart line`

`positions[].name, quantity`

name and quantity

`gross amount and rate`

`total_price_gross, tax`

the rate as a number, e.g. 23

`the KSeF number after sending`

`gov_id`

written back to the order

## Example rollout: invoicing for a SaaS subscription in Fakturownia

Step by step.

- **Sales**: A monthly plan through Stripe
- **Customers**: Polish and EU businesses, plus private individuals
- **Accounting**: The accounting office works in Fakturownia

- ### Buyer data at purchase
  The checkout asks whether the customer buys as a business and collects a Polish or EU VAT number.

- ### An invoice after every payment
  After a Stripe paid-invoice event we create a Fakturownia invoice with a KSeF send request.

- ### Statuses in the panel
  The admin panel shows each invoice's gov_status and the list of those needing a fix.

- ### The customer gets a PDF
  The customer downloads the invoice from the client panel, with the KSeF verification link on the view.

Nobody retypes invoices, and the accounting office sees them where it always has.

## Who does what

The invoicing app issues and sends, your system supplies the data, and we connect the two.

### You

- The app account and connecting it to KSeF.

- The API token or wFirma keys passed through a secure channel.

- Deciding which sales get an invoice and which a receipt.

### VulCode

- Invoices created from orders, payments and subscriptions.

- KSeF statuses and numbers flowing back to your system.

- A panel listing invoices that need fixing.

### The invoicing app

- Numbering, the invoice template and its archive.

- Sending to KSeF and offline modes on its side.

- Access for the accounting office.

## Common questions about the Fakturownia and wFirma integration

Click a question to see the answer.

**How much does the Fakturownia and wFirma integration cost?**

The Fakturownia and wFirma integration costs from PLN 999 (about EUR 220). The figure grows with the number of systems, data directions and exceptions to handle. A typical integration takes 2-3 days, and the free quote comes back within an hour. We quote it under our [API and integrations](https://vulcode.com/en/services/api-integrations) service.

**How long does it take?**

Usually 2-3 days. The exact dated schedule comes with the free quote, and if anything is going to move, you know in advance.

**Will Fakturownia send the invoice to KSeF itself?**

Yes, if the account is connected to KSeF. The integration creates the invoice with gov_save_and_send and the app handles the sending.

**How does my system know the invoice is in KSeF?**

We read gov_status and the gov_id number through the API or react to a webhook, and store the number with the order.

**Can you handle invoices for customers abroad?**

Yes. Fakturownia has separate buyer number kinds for EU and non-EU companies, which we set from the purchase data.

**Does this work with wFirma?**

Yes. The flow is the same, with different authentication (accessKey, secretKey and appKey) and data format (XML or JSON). We start by checking whether you have an application key from wFirma.

**Will the Fakturownia and wFirma integration code be mine?**

Yes. Once the work is accepted and paid in full, the economic copyright in the code passes to you. You have access to the repository from the first day, and after acceptance you get it with run instructions. Open source libraries keep their own licences.

**How do you check the Fakturownia and wFirma integration before launch?**

On a test Fakturownia or wFirma account and on a copy of your system. We run real scenarios, including errors, cancellations and returns, and only then switch the integration on in production.

**What if the Fakturownia and wFirma integration stops working?**

The integration retries failed operations by itself and logs every one, and when the problem does not go away you get a notification. We fix bugs that come from our work under warranty, and you get 90 days of support included after launch.

## Sources

Technical details come from both apps' official API documentation.

- [Fakturownia API](https://github.com/fakturownia/api)

- [Fakturownia: KSeF in the API](https://github.com/fakturownia/api/blob/master/KSeF.md)

- [wFirma: API documentation](https://doc.wfirma.pl/)

- [wFirma: KSeF integration](https://pomoc.wfirma.pl/-integracja-z-ksef)

## Related pages

Where invoice data comes from and where it goes.

- [**KSeF** When the KSeF sending should live in your code.](https://vulcode.com/en/services/integrations/ksef)

- [**Stripe** Subscriptions and payments that invoices come from.](https://vulcode.com/en/services/integrations/stripe)

- [**Invoicing and ERP** Larger systems: Subiekt, Optima, enova and Symfonia.](https://vulcode.com/en/services/integrations/erp)

- [**Process automation** Invoices and reports in flows with no manual work.](https://vulcode.com/en/services/process-automation)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
