Download the PHP package gabrielecorio/fiscozen-wrapper without Composer

On this page you can find all versions of the php package gabrielecorio/fiscozen-wrapper. 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 fiscozen-wrapper

fiscozen-wrapper

An unofficial PHP wrapper for the Fiscozen web application API.

Disclaimer: This is an unofficial, reverse-engineered client. It is not affiliated with, endorsed by, or supported by Fiscozen. Use at your own risk. The underlying API may change at any time without notice.


Requirements

Installation

Authentication flow

Fiscozen uses a two-factor authentication flow:

  1. Submit credentials → the API sends an OTP to your registered phone number.
  2. Submit the OTP → session cookies are persisted to disk for reuse.

The wrapper exposes two approaches depending on your use case.

Two-step (web application)

Credentials and OTP arrive in separate HTTP requests, so each step is called independently. Session cookies are written to disk between the two calls.

Single-step (CLI / scripts)

Provide an OTP callback that blocks until the user types the code. The library handles the full flow synchronously. If a valid session already exists on disk it is reused and the callback is never called.

Checking and destroying a session

Available API methods

The read-only endpoints are grouped by domain. They reuse the authenticated session and CSRF handling provided by AuthManager.

Domain Method Returns Description
User getUserMe() array Authenticated user's profile data
Invoices invoices()->list(...) PaginatedResponse Paginated invoice list
Invoices invoices()->getFormatInfo(...) array Invoice format information for a date
Counterparts counterparts()->list(...) array Counterpart list
Payments payments()->listMethods(...) PaginatedResponse Paginated payment method list
Dashboard dashboard()->getRealtimeYearStats(...) array Real-time fiscal-year statistics
Dashboard dashboard()->getFulfillmentForecast(...) array Fiscal-year fulfillment forecast
Dashboard dashboard()->getTasks() array Dashboard tasks

Only GET endpoints observed in captured application traffic are included. No write endpoint is exposed.

Invoices

Counterparts

The optional choices and counterpartType filters are strings because the captured traffic does not establish a stable set of allowed enum values.

Payment methods

Dashboard

Pagination

Paginated methods return a PaginatedResponse with the fields observed in the API response:

Pagination parameters must be greater than or equal to 1. Unknown filters are deliberately not accepted.

Local read-only scripts

Each script performs a single action and prints JSON to standard output; none of them save API responses automatically. Log in once with login.php, then run any read script against the session it created:

The read scripts never trigger a login themselves — if no valid session is found they print an error asking you to run login.php first, keeping each script to one action.

API responses can contain personal or fiscal data. Review terminal and process access before running these commands, and do not redirect output to a file unless that file is protected and excluded from version control.

Environment variables

All scripts in examples/ read their configuration from the environment instead of hardcoded values:

Variable Required Description
FISCOZEN_EMAIL Yes Account email used to log in
FISCOZEN_PASSWORD Yes Account password used to log in
FISCOZEN_SESSION_DIR No Directory for the session cookie file. Defaults to examples/../sessions

To avoid placing credentials in shell history, enter them interactively:

Session cookies are stored in the git-ignored sessions/ directory by default.

User profile

Session persistence

Each user's session is stored in a single JSON file named after the SHA-256 hash of their email address. The directory is created automatically if it does not exist.

You can override the directory:

Exceptions

Class Extends When thrown
AuthenticationException RuntimeException Login or OTP verification fails
ApiException RuntimeException Any non-200 API response; exposes getHttpStatusCode()
OtpRequiredException RuntimeException OTP step is required; exposes getPhoneNumber()

Full example

The examples/ directory contains one script per action, each reading its configuration from the environment variables described above:

Running tests

Project structure

License

This project is released under the MIT License.


All versions of fiscozen-wrapper with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
guzzlehttp/guzzle Version ^7.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 gabrielecorio/fiscozen-wrapper contains the following files

Loading the files please wait ...