ksef library

Classes

KsefAnnotations
FA(3) specific: Mandatory annotations (Adnotacje section) These are Polish VAT-law specific flags, no EN 16931 equivalent
KsefClient
KsefInvoice
Field naming loosely follows EN 16931 Business Terms (BT) where applicable. Reference: https://docs.peppol.eu/poacc/billing/3.0/bis/ Note: FA(3) does not fully comply with EN 16931 — Poland-specific fields are documented inline where no BT equivalent exists. Maps to FA(3): root Faktura element
KsefInvoiceLine
BT-126..BT-161: Single invoice line item Maps to FA(3): Fa/FaWiersz
KsefInvoiceRequest
invoice request info returned by KSeF after sending invoice
KsefInvoiceStatus
invoice status returned after invoice is processed by KSeF for code accepted, ksefNumber is set to valid KSeF invoice number for the new invoice. for code duplicate, ksefNumber is set to the invoice that this request was a duplicate of. for other statuses ksefNumber is empty and errorInfo contains human readable issue description.
KsefInvoiceTotals
Calculated invoice totals
KsefParty
BT-27..BT-44: Seller or Buyer party data Maps to FA(3): Podmiot1 (seller) or Podmiot2 (buyer)
KsefPayment
BT-81+BT-84: Payment details Maps to FA(3): Fa/Platnosc
KsefPublicKey
KsefSession
KsefTokenTest
Result of token test
KsefVatTotal
Totals for a specific VAT rate FA(3) specific — grouped by Polish VAT rate

Enums

KsefEnvironment
KsefInvoiceStatusCode
KsefInvoiceType
BT-3: Invoice type
KsefPaymentMethod
BT-81: Payment method FA(3) specific: Fa/Platnosc/FormaPlatnosci
KsefTaxIdType
type of tax identification number, used in party data
KsefVatRate
FA(3) specific: VAT rates supported by Polish law

Extensions

KsefInvoiceXml on KsefInvoice

Functions

calcTotals(List<KsefInvoiceLine> lines) KsefInvoiceTotals
Calculates invoice totals from line items. Amounts are rounded to 2 decimal places per Polish VAT law requirements.

Exceptions / Errors

KsefException
Exception thrown by KSeF API, may include network exceptions