KSeF token¶
The token is generated once, by hand, in the KSeF taxpayer app (Aplikacja Podatnika KSeF). Each environment has its own instance and its own tokens.
- Log in to the taxpayer app of the chosen environment (addresses below).
- Open the "Tokeny" tab and choose "Generuj token".
- Select the
InvoiceWrite(submitting) andInvoiceRead(listing and downloading) permissions. - Copy the token. The app shows it only once.
Pass the token in an environment variable:
export KSEF_TOKEN='...'
Environments¶
env |
API | Taxpayer app |
|---|---|---|
test |
https://api-test.ksef.mf.gov.pl/v2 |
https://ap-test.ksef.mf.gov.pl |
demo |
https://api-demo.ksef.mf.gov.pl/v2 |
https://ap-demo.ksef.mf.gov.pl |
prod |
https://api.ksef.mf.gov.pl/v2 |
https://ap.ksef.mf.gov.pl |
The test environment is shared by all integrators, so real invoices should not be sent there.