KSeFGPT
Get started for free
Invoices

How to issue a self-billing invoice in KSeFGPT

As the buyer, issue an invoice on the seller's behalf, mark it as self-billing and submit it to KSeF. Before you start, you need an agreement with the seller and the appropriate KSeF permissions.

Module
Invoices
Reading time
7 min
Difficulty
Published
August 12, 2026
Author
Rafał Zeidler
Format
Written guide

Written procedure

What you will do

As the buyer of goods or services, you will issue an invoice in the name and on behalf of the seller. The seller remains in the Seller section, your company is the buyer, and KSeFGPT records the self-billing marker P_17 = 1.

After checking the details, you will submit the document to KSeF and wait for its final status. Selecting this mode in the form does not replace the agreement with the seller, the agreed invoice approval procedure or the required KSeF permissions.

Requirements

Before you start

Self-billing means that the buyer issues an invoice on the seller's behalf. The legal requirements, agreement and permission rules are explained in Self-billing in KSeF: what it is and how to streamline mass invoice import.

ItemDescription
Agreement with the sellerBefore the first invoice is issued, the buyer and seller must enter into an agreement authorizing the buyer to issue invoices in the name and on behalf of the seller.
Invoice approvalThe agreement must specify the procedure by which the seller approves individual invoices. Follow the method and deadlines agreed by the parties.
KSeF permissionsThe person or entity submitting the document must have a KSeF permission that allows invoices to be issued on the seller's behalf. Connecting your own company to KSeF does not grant this right.
Access in KSeFGPTAn active Invoices module and access to Issue. An organization member needs the invoices:read and invoices:send permissions.
Company in KSeFGPTSelect the company that is the buyer. To submit the invoice, it must have the appropriate KSeF token or certificate configured.
Seller detailsPrepare the supplier's name, NIP, address and, where applicable, bank account details. This is the seller on whose behalf you are issuing the document.
Invoice detailsPrepare the invoice number and dates, place of issue, line items, quantities, prices, VAT rates, amounts and payment terms.
Starting pointAfter signing in, select the company that is the buyer and open Invoices → Issue.
Time requiredAbout 5–10 minutes once the details and permissions are ready.
Effect of submissionOnce KSeF accepts the document, it receives a KSeF number. Do not submit the invoice until the party roles and seller details are correct.
01Step

Start issuing a new invoice

In the company selector, choose the entity that purchased the goods or services and will issue the document as the buyer. Then open Invoices → Issue and select the Invoice card with the description Issue a new invoice.

KSeFGPT opens an editable document. The selected company's details initially appear in Seller. In the next step, you will change the mode and arrange the parties for self-billing.

02Step

Select Buyer (self-billing)

Under Issue as, select Buyer (self-billing). KSeFGPT enables the self-billing marker for the document and displays Swap seller and buyer below the parties.

Immediately after you select the mode, the active company may still be shown as the seller. Do not continue entering data until you have checked and corrected the party arrangement in the next step.

03Step

Put the seller and buyer in the correct sections

If your company's details are in Seller, select Swap seller and buyer. Then enter the supplier on whose behalf you are issuing the invoice in Seller and leave your own company in Buyer.

Check both names and NIPs carefully. The seller is the supplier of the goods or services and the taxpayer on whose behalf the invoice is issued. The buyer is the company selected in KSeFGPT that issues the document under self-billing.

If the invoice includes a bank account for payment, enter the seller's account. Do not automatically use the account of your own company, which is the buyer.

04Step

Complete the invoice details and line items

Enter the invoice number, issue date, sale date or billing period, and place of issue. Add at least one line item with the name of the goods or services, quantity, unit, price and correct VAT rate.

Complete the payment due date and method and any other fields required for the transaction. The net, VAT and gross amounts must match the settlement agreed with the seller and the approval procedure set out in the self-billing agreement.

The bar above the document lists missing fields and XML errors. Continue only when the error list is empty and both parties remain in the correct sections.

05Step

Check the self-billing marker

In Edit, make sure Buyer (self-billing) is still selected under Issue as. You can also open XML and search for P_17.

For an invoice issued in this mode, the XML should contain <P_17>1</P_17>. A value of 2 means that the document is not marked as self-billing. Return to Edit and select the correct option again.

06Step

Submit the invoice to KSeF

Return to Edit and check the selected authorization method. Select I take full responsibility for the correctness of data sent to KSeF, then select Submit to KSeF.

Invoice sent to KSeF appears first. This is a pending state, not final confirmation that the invoice has been issued. KSeFGPT continues to refresh the session status.

If KSeF rejects the document because you lack permission to act on the seller's behalf, do not change the seller to your own company. Grant the correct KSeF permission first, then submit the corrected document again.

Final state

Check the result

The operation is complete when Invoice accepted by KSeF appears. Check the reference number, final status description and the KSeF number assigned to the document.

On the accepted invoice, the supplier should be the seller, your company should be the buyer, and the self-billing marker should be P_17 = 1. Retain the document and UPO and carry out the approval procedure agreed with the seller.

Diagnostics

If something does not work

Compare the symptom with the table below.

SymptomLikely causeWhat to do
Buyer (self-billing) is not visibleYou are not in the editable form for a new invoice.Open Invoices → Issue → Invoice. The option is under Issue as, above Seller and Buyer.
Your company is still the sellerSelf-billing was enabled, but the parties were not swapped.Select Swap seller and buyer, then enter the supplier in Seller and your own company in Buyer.
The XML contains <P_17>2</P_17>Seller mode is selected or the mode change was not retained.Return to Edit, select Buyer (self-billing), wait for the XML to be regenerated and check P_17 again.
Submit to KSeF is disabledA required field, at least one line item, valid XML or the responsibility confirmation is missing.Complete the items listed in the validation bar, correct the XML errors and select the responsibility confirmation.
A KSeF connection error appearsThe selected company has no active token or certificate, or its credentials have expired.Configure the connection in Settings and check that the authorization method includes the permission required to issue an invoice on the seller's behalf.
The final status is Invoice rejected by KSeFKSeF returned a document or permission error, possibly because you cannot issue invoices on behalf of the specified seller.Read the error code and description. Check the KSeF authorization, seller's NIP, party roles and P_17; correct the stated cause before retrying.

What next

Send the invoice for approval using the procedure set out in your agreement with the seller and retain evidence that the procedure was followed in your document workflow.

Download the UPO and check the document in the invoice list. For every subsequent invoice, verify the seller, buyer, P_17 marker and current permissions again; do not assume that the previous configuration is still valid.

For a broader explanation of the agreement, document approval, permissions and mass invoice import, see Self-billing in KSeF.

Issue a self-billing invoice

Sign in, select the company that is the buyer and prepare the document on the seller's behalf.

Sign in to KSeFGPT

Related instructions