Download the PHP package intermedia/ksef-api-v2 without Composer

On this page you can find all versions of the php package intermedia/ksef-api-v2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ksef-api-v2

intermedia/ksef-api-v2

Developer-friendly & type-safe Php SDK specifically catered to leverage intermedia/ksef-api-v2 API.

Summary

KSeF API TR: Wersja API: 2.0.0 (build 2.0.0-tr-20251229.1+4e064b0f8497598eeb393ab74ab9a5ada61f64a5)
Klucze publiczne Ministerstwa Finansów (dla danego środowiska): Pobierz klucze
Historia zmian: Changelog
Rozszerzona dokumentacja API: ksef-docs

Adres serwera API:

Table of Contents

SDK Installation

The SDK relies on Composer to manage its dependencies.

To install the SDK and add it as a dependency to an existing composer.json file:

SDK Example Usage

Example

AuthTokenRequest XML generation with XAdES signature example

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
bearer http HTTP Bearer

To authenticate with the API the bearer parameter must be set when initializing the SDK. For example:

Available Resources and Operations

Available methods ### [Auth](docs/sdks/auth/README.md) * [getCurrentSessions](docs/sdks/auth/README.md#getcurrentsessions) - Pobranie listy aktywnych sesji * [revokeCurrentSession](docs/sdks/auth/README.md#revokecurrentsession) - Unieważnienie aktualnej sesji uwierzytelnienia * [revokeSession](docs/sdks/auth/README.md#revokesession) - Unieważnienie sesji uwierzytelnienia * [challenge](docs/sdks/auth/README.md#challenge) - Inicjalizacja uwierzytelnienia * [withXades](docs/sdks/auth/README.md#withxades) - Uwierzytelnienie z wykorzystaniem podpisu XAdES * [withKsefToken](docs/sdks/auth/README.md#withkseftoken) - Uwierzytelnienie z wykorzystaniem tokena KSeF * [getStatus](docs/sdks/auth/README.md#getstatus) - Pobranie statusu uwierzytelniania * [redeemToken](docs/sdks/auth/README.md#redeemtoken) - Pobranie tokenów dostępowych * [refreshToken](docs/sdks/auth/README.md#refreshtoken) - Odświeżenie tokena dostępowego ### [Certificates](docs/sdks/certificates/README.md) * [getLimits](docs/sdks/certificates/README.md#getlimits) - Pobranie danych o limitach certyfikatów * [getEnrollmentData](docs/sdks/certificates/README.md#getenrollmentdata) - Pobranie danych do wniosku certyfikacyjnego * [processEnrollment](docs/sdks/certificates/README.md#processenrollment) - Wysyłka wniosku certyfikacyjnego * [getEnrollmentStatus](docs/sdks/certificates/README.md#getenrollmentstatus) - Pobranie statusu przetwarzania wniosku certyfikacyjnego * [retrieve](docs/sdks/certificates/README.md#retrieve) - Pobranie certyfikatu lub listy certyfikatów * [revoke](docs/sdks/certificates/README.md#revoke) - Unieważnienie certyfikatu * [getList](docs/sdks/certificates/README.md#getlist) - Pobranie listy metadanych certyfikatów ### [Invoices](docs/sdks/invoices/README.md) * [getByKsefNumber](docs/sdks/invoices/README.md#getbyksefnumber) - Pobranie faktury po numerze KSeF * [getList](docs/sdks/invoices/README.md#getlist) - Pobranie listy metadanych faktur * [export](docs/sdks/invoices/README.md#export) - Eksport paczki faktur * [getExportStatus](docs/sdks/invoices/README.md#getexportstatus) - Pobranie statusu eksportu paczki faktur ### [Limits](docs/sdks/limits/README.md) * [getContext](docs/sdks/limits/README.md#getcontext) - Pobranie limitów dla bieżącego kontekstu * [getSubject](docs/sdks/limits/README.md#getsubject) - Pobranie limitów dla bieżącego podmiotu * [getApiRate](docs/sdks/limits/README.md#getapirate) - Pobranie aktualnie obowiązujących limitów API ### [Peppol](docs/sdks/peppol/README.md) * [listProviders](docs/sdks/peppol/README.md#listproviders) - Pobranie listy dostawców usług Peppol ### [Permissions](docs/sdks/permissions/README.md) * [grantToPersons](docs/sdks/permissions/README.md#granttopersons) - Nadanie osobom fizycznym uprawnień do pracy w KSeF * [grantToEntities](docs/sdks/permissions/README.md#granttoentities) - Nadanie podmiotom uprawnień do obsługi faktur * [grantAuthorizations](docs/sdks/permissions/README.md#grantauthorizations) - Nadanie uprawnień podmiotowych * [grantIndirectly](docs/sdks/permissions/README.md#grantindirectly) - Nadanie uprawnień w sposób pośredni * [grantToSubunits](docs/sdks/permissions/README.md#granttosubunits) - Nadanie uprawnień administratora podmiotu podrzędnego * [grantRights](docs/sdks/permissions/README.md#grantrights) - Nadanie uprawnień administratora podmiotu unijnego * [grantToEuEntities](docs/sdks/permissions/README.md#granttoeuentities) - Nadanie uprawnień reprezentanta podmiotu unijnego * [revoke](docs/sdks/permissions/README.md#revoke) - Odebranie uprawnień * [revokeAuthorizations](docs/sdks/permissions/README.md#revokeauthorizations) - Odebranie uprawnień podmiotowych * [getOperationStatus](docs/sdks/permissions/README.md#getoperationstatus) - Pobranie statusu operacji * [checkAttachmentStatus](docs/sdks/permissions/README.md#checkattachmentstatus) - Sprawdzenie statusu zgody na wystawianie faktur z załącznikiem * [getPersonalGrants](docs/sdks/permissions/README.md#getpersonalgrants) - Pobranie listy własnych uprawnień * [getPersonGrants](docs/sdks/permissions/README.md#getpersongrants) - Pobranie listy uprawnień do pracy w KSeF nadanych osobom fizycznym lub podmiotom * [getSubunitsGrants](docs/sdks/permissions/README.md#getsubunitsgrants) - Pobranie listy uprawnień administratorów jednostek i podmiotów podrzędnych * [getEntityRoles](docs/sdks/permissions/README.md#getentityroles) - Pobranie listy ról podmiotu * [getSubordinateEntitiesRoles](docs/sdks/permissions/README.md#getsubordinateentitiesroles) - Pobranie listy podmiotów podrzędnych * [getAuthorizationsGrants](docs/sdks/permissions/README.md#getauthorizationsgrants) - Pobranie listy uprawnień podmiotowych do obsługi faktur * [getEuEntityGrants](docs/sdks/permissions/README.md#geteuentitygrants) - Pobranie listy uprawnień administratorów lub reprezentantów podmiotów unijnych uprawnionych do samofakturowania ### [Security](docs/sdks/security/README.md) * [getPublicKeyCertificates](docs/sdks/security/README.md#getpublickeycertificates) - Pobranie certyfikatów ### [Sessions](docs/sdks/sessions/README.md) * [getList](docs/sdks/sessions/README.md#getlist) - Pobranie listy sesji * [getStatus](docs/sdks/sessions/README.md#getstatus) - Pobranie statusu sesji * [getUpo](docs/sdks/sessions/README.md#getupo) - Pobranie UPO dla sesji * [openOnline](docs/sdks/sessions/README.md#openonline) - Otwarcie sesji interaktywnej * [closeOnline](docs/sdks/sessions/README.md#closeonline) - Zamknięcie sesji interaktywnej * [openBatch](docs/sdks/sessions/README.md#openbatch) - Otwarcie sesji wsadowej * [closeBatch](docs/sdks/sessions/README.md#closebatch) - Zamknięcie sesji wsadowej #### [Sessions.Invoices](docs/sdks/sessionsinvoices/README.md) * [getList](docs/sdks/sessionsinvoices/README.md#getlist) - Pobranie faktur sesji * [getStatus](docs/sdks/sessionsinvoices/README.md#getstatus) - Pobranie statusu faktury z sesji * [getFailed](docs/sdks/sessionsinvoices/README.md#getfailed) - Pobranie niepoprawnie przetworzonych faktur sesji * [getInvoiceUpoByKsefNumber](docs/sdks/sessionsinvoices/README.md#getinvoiceupobyksefnumber) - Pobranie UPO faktury z sesji na podstawie numeru KSeF * [getUpo](docs/sdks/sessionsinvoices/README.md#getupo) - Pobranie UPO faktury z sesji na podstawie numeru referencyjnego faktury * [sendOnline](docs/sdks/sessionsinvoices/README.md#sendonline) - Wysłanie faktury ### [Tokens](docs/sdks/tokens/README.md) * [generate](docs/sdks/tokens/README.md#generate) - Wygenerowanie nowego tokena * [getList](docs/sdks/tokens/README.md#getlist) - Pobranie listy wygenerowanych tokenów * [getStatus](docs/sdks/tokens/README.md#getstatus) - Pobranie statusu tokena * [revoke](docs/sdks/tokens/README.md#revoke) - Unieważnienie tokena

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.

By default an API error will raise a Errors\APIException exception, which has the following properties:

Property Type Description
$message string The error message
$statusCode int The HTTP status code
$rawResponse ?\Psr\Http\Message\ResponseInterface The raw HTTP response
$body string The response content

When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the getCurrentSessions method throws the following exceptions:

Error Type Status Code Content Type
Errors\ExceptionResponse 400 application/json
Errors\TooManyRequestsResponseException 429 application/json
Errors\APIException 4XX, 5XX */*

Example

Server Selection

Select Server by Index

You can override the default server globally using the setServerIndex(int $serverIdx) builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Description
0 https://api-demo.ksef.mf.gov.pl/v2 Środowisko DEMO
1 https://ksef-demo.mf.gov.pl/api/v2 [deprecated] Środowisko DEMO

Example

Override Server URL Per-Client

The default server can also be overridden globally using the setServerUrl(string $serverUrl) builder method when initializing the SDK client instance. For example:

Development

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.

SDK Created by Speakeasy


All versions of ksef-api-v2 with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
galbar/jsonpath Version >=3.0
guzzlehttp/guzzle Version ^7.0
speakeasy/serializer Version ^4.0.3
brick/date-time Version >=0.7.0
phpdocumentor/type-resolver Version >=1.8
brick/math Version >=0.12.1
ext-dom Version *
ext-openssl Version *
phpseclib/phpseclib Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package intermedia/ksef-api-v2 contains the following files

Loading the files please wait ...