Przejdź do głównej zawartości

Command Reference

Ta treść nie jest jeszcze dostępna w Twoim języku.

Global options must be placed before the command group:

Terminal window
ksef2 [GLOBAL OPTIONS] COMMAND [ARGS]...
OptionPurpose
--env, -eKSeF environment: production, demo, or test.
--output, -oOutput mode: text or json.
--jsonShortcut for --output json.
--verbose, -vShow tracebacks for CLI errors.
--configLocal config file path.
--no-configIgnore local config profiles.
--profileUse a named profile for this invocation.
--nipTaxpayer or context NIP.
--token, --ksef-tokenKSeF token authentication secret.
--context-typeToken-auth context type.
--test-certUse an SDK-generated TEST certificate.
--cert, --keyPEM XAdES certificate and private key.
--key-passwordPassword for encrypted PEM private key.
--p12, --p12-passwordPKCS#12/PFX XAdES archive and password.
--auth-poll-intervalAuthentication polling interval.
--auth-max-poll-attemptsAuthentication polling attempts.

Root commands:

CommandPurpose
tuiOpen the interactive terminal console. Requires the tui extra.
GroupPurpose
authAuthenticate and refresh access tokens.
invoicesSend, confirm, query, download, export, and fetch invoices.
onlineOpen, resume, inspect, and close online invoice sessions.
batchSubmit and inspect batch invoice sessions.
tokensGenerate, list, inspect, and revoke KSeF tokens.
sessionsInspect authentication and historical invoice sessions.
certificatesManage MCU certificate enrollment and lifecycle.
permissionsGrant, query, and revoke permissions.
limitsRead and manage effective KSeF limits.
peppolQuery public PEPPOL providers.
encryptionRead public KSeF encryption certificates.
testdataManage TEST-environment test data.
configInspect and create the local CLI config file.
profileCreate, inspect, and select local CLI profiles.
CommandPurpose
auth loginAuthenticate with the configured method and print tokens.
auth refreshExchange a refresh token for a new access token.
CommandPurpose
config pathShow the local config path used by this invocation.
config showShow local config values.
config initCreate an empty local config file.
CommandPurpose
profile create NAMECreate or replace a profile and select it by default.
profile listList configured profiles.
profile currentShow the active profile.
profile show [NAME]Show one profile, or the active profile when omitted.
profile use NAMESelect the active profile.
CommandPurpose
invoices sendSend invoice XML files or directories through the high-level online/batch workflow.
invoices statusCheck a saved high-level workflow receipt.
invoices upoDownload UPO XML files from a saved high-level workflow receipt.
invoices metadataQuery invoice metadata.
invoices downloadDownload processed invoice XML by KSeF number.
invoices exportSchedule an invoice export and save the handle.
invoices export-statusFetch invoice export status.
invoices export-fetchFetch and decrypt an export package using a saved handle.
invoices export-downloadSchedule, wait for, and download an export package.

Common high-level invoice options:

OptionPurpose
invoices send PATH...PATH may be XML files or directories. Directories include direct child *.xml files.
--recursiveInclude nested *.xml files for directory input.
--mode online / --mode batchSelect online mode or one batch submission. Defaults to online.
--waitWait for final processing status.
--upo-dir DIRWrite UPO XML files. Requires --wait on invoices send.
--receipt FILEWrite one receipt file.
--receipt-dir DIRWrite receipt files for multiple online invoices, or one batch receipt.
invoices status --receipt FILECheck or wait for the workflow represented by a receipt.
invoices upo --receipt FILE --out FILEDownload one online invoice UPO.
invoices upo --receipt FILE --upo-dir DIRDownload online or batch UPO files into a directory.
CommandPurpose
online openOpen an online session and optionally save state.
online sendSend one or more invoice XML files.
online statusFetch status for a resumed online session.
online listList invoices submitted in an online session.
online invoice-statusFetch or wait for one invoice status.
online upoDownload invoice UPO by reference or KSeF number.
online closeClose a resumed online session.
CommandPurpose
batch submitPrepare, upload, close, and optionally wait for a batch session.
batch statusFetch or wait for batch session status.
batch listList invoices submitted in a batch session.
batch upoDownload a collective UPO page.
CommandPurpose
sessions auth-listList authentication sessions.
sessions auth-closeClose an authentication session.
sessions auth-terminate-currentTerminate the current authentication session.
sessions invoice-listList historical invoice sessions.
CommandPurpose
tokens generateGenerate a KSeF token.
tokens listList KSeF tokens.
tokens statusFetch token status.
tokens revokeRevoke a token.
CommandPurpose
certificates limitsShow certificate limits.
certificates enrollment-dataFetch certificate enrollment data.
certificates enrollSubmit a certificate enrollment request.
certificates enrollment-statusCheck enrollment status.
certificates listList certificates.
certificates retrieveRetrieve a certificate.
certificates revokeRevoke a certificate.
CommandPurpose
permissions attachment-statusCheck attachment permission status.
permissions operation-statusCheck permission operation status.
permissions entity-rolesList entity roles.
permissions grant-personGrant permissions to a person.
permissions grant-entityGrant permissions to an entity.
permissions grant-authorizationGrant authorization permissions.
permissions grant-indirectGrant indirect permissions.
permissions grant-subunitGrant subunit administrator permissions.
permissions grant-eu-entityGrant EU entity representative permissions.
permissions grant-eu-adminGrant EU entity administrator permissions.
permissions queryQuery permissions by type.
permissions revoke-commonRevoke a common permission.
permissions revoke-authorizationRevoke an authorization permission.
CommandPurpose
limits getRead effective limits.
limits setSet effective limits in TEST workflows.
limits resetReset effective limits in TEST workflows.
limits production-rate-limitsSet TEST API rate limits to production-like values.
CommandPurpose
peppol providersQuery public PEPPOL providers.
encryption certificatesRead public KSeF encryption certificates.
testdata sandboxCreate a temporary TEST subject with credentials and cleanup on exit.
testdata create-subjectCreate a TEST subject.
testdata delete-subjectDelete a TEST subject.
testdata create-personCreate a TEST person.
testdata delete-personDelete a TEST person.
testdata enable-attachmentsEnable TEST attachments.
testdata revoke-attachmentsRevoke TEST attachments.
testdata block-contextBlock a TEST context.
testdata unblock-contextUnblock a TEST context.
testdata grant-permissionsGrant TEST permissions.
testdata revoke-permissionsRevoke TEST permissions.