Skip to content

Invoice system

The invoice module generates sales documents directly in WooCommerce. It supports four document types, automatic numbering and PDF.

A standard VAT invoice containing:

  • seller and buyer data (including VAT IDs for both parties)
  • line items with name, quantity, net price, VAT rate, VAT amount and gross price
  • summary with VAT rate breakdown
  • invoice number, issue date and sale date
  • payment terms and payment method

A correction document for a previously issued invoice. It contains:

  • number and date of the corrected invoice
  • line items before and after correction
  • value difference
  • reason for correction

A correction invoice can be issued from the order panel or via the REST API.

A simplified sales document for individual customers (without buyer VAT ID). Contains line items with gross prices and a summary.

An external release document attached to the shipment. Contains a list of products, quantities and any order notes. Does not include prices.

Go to WooCommerce > Settings > Polski > PRO Modules > Invoices.

FieldDescription
Company nameFull name of the seller company
VAT ID (NIP)Tax identification number of the seller
AddressStreet, number, postal code, city
Bank account numberAccount number for wire transfers
Contact emailEmail address displayed on the invoice

The plugin offers several invoice numbering strategies:

StrategyFormatExample
AnnualFV/{number}/{year}FV/1/2026
MonthlyFV/{number}/{month}/{year}FV/1/04/2026
ContinuousFV/{number}FV/1
Custom patternUser-definedFV/2026/04/001

Available tokens in the custom format:

  • {numer} - sequential invoice number (reset according to strategy)
  • {rok} - four-digit year
  • {miesiac} - two-digit month
  • {dzien} - two-digit day
  • {id_zamowienia} - WooCommerce order ID

The plugin can automatically generate an invoice when the order status changes to “Completed”. Enable the Automatic invoice generation option in the module settings.

You can also configure automatic sending of the invoice PDF as an attachment to the WooCommerce “Order completed” email.

Invoice PDFs are generated using the TCPDF library. The PDF template includes:

  • company logo (optional, configurable in settings)
  • seller and buyer data
  • line items table with VAT columns
  • summary with VAT rate breakdown
  • footer with company data

The plugin uses the DejaVu Sans font, which supports Polish diacritical characters. No additional configuration is required.

Each invoice goes through a status lifecycle:

Draft (Szkic) → Issued (Wystawiona) → Sent (Wysłana) → Paid (Opłacona)
→ Cancelled (Anulowana)
StatusDescription
DraftInvoice created but not yet issued. Can be edited
IssuedInvoice issued with an assigned number. Cannot be edited
SentInvoice sent to the customer (email or KSeF)
PaidInvoice paid
CancelledInvoice cancelled. Requires issuing a correction

In the WooCommerce order admin panel, the module adds an “Invoices” meta box with the following functions:

  • Issue invoice - generates an invoice based on order data
  • Download PDF - downloads the invoice in PDF format
  • Send to customer - sends the invoice via email
  • Issue correction - creates a correction invoice
  • History - list of all documents associated with the order

Each invoice line item contains detailed VAT data:

  • unit net price
  • VAT rate (23%, 8%, 5%, 0%, exempt, not applicable, reverse charge)
  • unit VAT amount
  • net value
  • gross value

The plugin automatically recognizes the VAT rate from the WooCommerce Tax configuration. It supports multiple VAT rates on a single invoice with correct totals.

The module provides REST API endpoints for managing invoices programmatically.

GET /wp-json/polski-pro/v1/invoices

Query parameters:

ParameterTypeDescription
order_idintFilter by order ID
statusstringFilter by status (draft, issued, sent, paid, cancelled)
typestringFilter by type (invoice, correction, receipt, packing_slip)
date_fromstringDate from (YYYY-MM-DD)
date_tostringDate to (YYYY-MM-DD)
per_pageintResults per page (default 20)
pageintPage number
POST /wp-json/polski-pro/v1/invoices
{
"order_id": 123,
"type": "invoice",
"auto_number": true
}
GET /wp-json/polski-pro/v1/invoices/{id}/pdf

Returns a PDF file as application/pdf with a Content-Disposition: attachment header.

POST /wp-json/polski-pro/v1/invoices/{id}/correction
{
"reason": "Zmiana danych nabywcy",
"items": [
{
"product_id": 45,
"quantity": 1,
"net_price": 100.00,
"vat_rate": 23
}
]
}
GET /wp-json/polski-pro/v1/invoices/stats

Returns invoice statistics: total count, net/gross values, breakdown by status.

Action fired before generating an invoice.

/**
* @param int $order_id ID zamówienia
* @param string $type Typ dokumentu (invoice, correction, receipt, packing_slip)
*/
do_action('polski_pro/invoices/before_generate', int $order_id, string $type);

Example:

add_action('polski_pro/invoices/before_generate', function (int $order_id, string $type): void {
if ($type === 'invoice') {
// Logowanie generowania faktury
error_log("Generowanie faktury dla zamówienia #{$order_id}");
}
}, 10, 2);

Filters the invoice number format.

/**
* @param string $number Wygenerowany numer faktury
* @param string $type Typ dokumentu
* @param int $order_id ID zamówienia
*/
apply_filters('polski_pro/invoices/number_format', string $number, string $type, int $order_id): string;

Example:

add_filter('polski_pro/invoices/number_format', function (string $number, string $type, int $order_id): string {
if ($type === 'correction') {
return 'KOR/' . $number;
}
return $number;
}, 10, 3);

Filters the data passed to the PDF template.

/**
* @param array $data Dane faktury (seller, buyer, items, totals)
* @param int $invoice_id ID faktury
*/
apply_filters('polski_pro/invoices/pdf_content', array $data, int $invoice_id): array;

Example:

add_filter('polski_pro/invoices/pdf_content', function (array $data, int $invoice_id): array {
$data['footer_note'] = 'Dziękujemy za zakupy!';
return $data;
}, 10, 2);
  1. Check if the PHP mbstring extension is installed
  2. Make sure the wp-content/uploads/polski-pro/invoices/ directory has write permissions (755)
  3. Verify that the seller data is filled in the settings

Numbering resets according to the selected strategy - annual resets on January 1st, monthly on the 1st of each month. If you want continuous numbering, select the “Continuous” strategy.

Check the WooCommerce Tax configuration. The plugin retrieves VAT rates from WooCommerce tax settings. Make sure the rates are correctly configured for Poland.

This page is for informational purposes only and does not constitute legal advice. Consult a lawyer before implementation. Polski for WooCommerce is open source software (GPLv2) provided without warranty.