How to Supplement Invoices with Additional Data Using Stripe Metadata

21 kwietnia 2026


Additional KSeF Data Through Stripe Metadata

S2K automatically retrieves data from your Stripe invoices and sends it to KSeF. Some KSeF fields, such as GTU code, PKWiU, or buyer contact details don't have a direct equivalent in Stripe, but you can set them through metadata in customer and product objects.

How Stripe Metadata Works

Metadata are key-value pairs that you can add to almost any object in Stripe: customer, product, invoice. S2K reads selected keys and passes them to corresponding fields in the KSeF structure. Keys follow the format s2k_{field}, e.g., s2k_gtu or s2k_contact_email. If a key doesn't exist in the metadata, S2K simply skips that field.


Buyer Data (Customer Metadata)

Set the following fields on the Customer object in Stripe (Customers → selected customer → Metadata).

Metadata Key KSeF Field Description
s2k_custom_client_id Podmiot2/NrKlienta Your own customer number used in contract or order
s2k_gv Podmiot2/GV true if buyer is a VAT group
s2k_jst Podmiot2/JST true if buyer is a local government unit
s2k_contact_email Podmiot2/DaneKontaktowe/Email Buyer's email on the invoice
s2k_contact_phone Podmiot2/DaneKontaktowe/Telefon Buyer's phone on the invoice

Example

  1. Go to Stripe Dashboard → Customers → select customer
  2. Scroll to Metadata section
  3. Add keys:

Product Data (Product Metadata)

Set the following fields on the Product object in Stripe (Product catalog → selected product → Metadata).

Metadata Key KSeF Field Description
s2k_gtu FaWiersz/GTU GTU code (e.g., GTU_01, GTU_12)
s2k_pkwiu FaWiersz/PKWiU Polish Classification of Products and Services symbol
s2k_gtin FaWiersz/GTIN Global Trade Item Number (EAN/barcode)
s2k_cn FaWiersz/CN Combined Nomenclature symbol (foreign trade)
s2k_pkob FaWiersz/PKOB Polish Classification of Construction Objects symbol

Example — Setting GTU Code

  1. Go to Stripe Dashboard → Product catalog → select product
  2. Click Edit
  3. Scroll to Metadata section
  4. Add key s2k_gtu with value e.g., GTU_12
  5. Save

From now on, every invoice containing this product will have the GTU code populated in KSeF.


GTU Codes — List of Values

Code Category
GTU_01 Alcoholic beverages
GTU_02 Excise goods (fuels, oils, etc.)
GTU_03 Heating oil
GTU_04 Tobacco products, dried tobacco
GTU_05 Waste — only those specified in regulations
GTU_06 Electronic equipment, parts for them
GTU_07 Motor vehicles
GTU_08 Precious and non-precious metals
GTU_09 Medicines, medical devices
GTU_10 Buildings, structures, land
GTU_11 Gas and energy services
GTU_12 Intangible services (IT, consulting, finance, etc.)
GTU_13 Transport and forwarding services