Download the PHP package chuckbe/clearfacts-laravel-sdk without Composer

On this page you can find all versions of the php package chuckbe/clearfacts-laravel-sdk. 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 clearfacts-laravel-sdk

Clearfacts Laravel SDK

A Laravel SDK for the Clearfacts pre-accounting platform API. Built on Saloon PHP with a fluent, resource-based interface for the Clearfacts GraphQL API.

Requirements

Installation

Publish the configuration file:

Configuration

Add the following to your .env file:

See config/clearfacts.php for all available options (timeouts, retry behaviour, scopes).

Authentication (Multi-Tenant / SaaS)

Clearfacts uses OpenID Connect (Authorization Code Flow). This SDK does not handle the OIDC flow itself. Instead, use Laravel Socialite with a Clearfacts provider (or a generic OIDC Socialite driver) to obtain access tokens per tenant.

The OIDC discovery endpoint is at https://login.clearfacts.be/.well-known/openid-configuration (or https://<accountant-slug>.clearfacts.be for accountant-specific endpoints).

The configured scopes are: openid, email, profile, accountant, statistics, read_administrations, associate_read, associate_actions, journal_read, contact_read, upload_document, archive_read, archive_actions.

Once you have an access token for a tenant, set it before making API calls:

Usage

The SDK provides a fluent, resource-based API:

Administrations

Documents

Invoice types: PURCHASE, SALE, VARIOUS

Archive types: VARIOUS, PERMANENT

Supported upload formats: PDF, JPEG images, XML (Billing3/UBL.BE/E-FFF)

Customers (Business Partners)

Journals

Archive Categories

Accountant

Associates

Statistics

App Info

API Reference

Available Resources

Resource Method Description
administration list() List all administrations
administration get(companyNumber) Get a single administration
document get(id) Get a document by ID
document upload(vatNumber, fileName, invoiceType, fileContent) Upload invoice to inbox
document uploadArchive(vatNumber, fileName, type, category, fileContent) Upload file to archive
customer list(companyNumber, ?offset) List customers/business partners (paginated)
journal list(companyNumber) List journals for an administration
archiveCategory list(vatNumber) Get archive categories (various + permanent)
accountant get() Get the linked accountant
associate list() List all associates
associate groups() List associate groups
associate add(firstName, lastName, email, type, active, language, sendActivationMail, ?associateGroups) Add a new associate
associate edit(id, fields) Edit an existing associate
statistic companyStatistics(type, startPeriod, endPeriod, ...) Get company statistics
appInfo update(vatnumber, ...) Update app info for an administration

Data Classes

All API responses are mapped to typed data classes in Clearfacts\Data\:

Class Fields
Administration name, companyType, companyNumber, companyNumberType, vatLiable, address, slug, accountManager, emails[], language
Accountant name, companyNumber, systemName, address, platformName, email, logo, favicon
Associate id, firstName, lastName, email, language, type, active, associateGroups[], plainPassword
AssociateGroup id, name
BusinessPartner id, companyNumber, name, address, email, phone, fax
InvoiceDocument file, date, comment, type, paymentState
File uuid, name, amountOfPages, comment, tags[]
Journal id, name, creditNote, type, default, lastDocumentNumber
CompanyStatistic companyNumber, items[]
StatisticItem period, value
AppInfo vatnumber, emailaddress, badge, icon, imageUrl, iFrameUrl
ArchiveCategories various[], permanent[]
Category id, name
Address streetAddress, extendedAddress, postalCode, locality, country
Country iso2, name
Email type, emailAddress

Enums

Enum Values
InvoiceType PURCHASE, SALE, VARIOUS
ArchiveType VARIOUS, PERMANENT
AssociateType ADMIN, ASSOCIATE, SUPPORT
Language DUTCH (nl_BE), FRENCH (fr_BE), ENGLISH (en_BE), GERMAN (de_BE)
PaymentState PAID, UNPAID

Architecture

Multi-Tenant Setup Example

In a typical multi-tenant SaaS application, you might set the token in middleware:

Development

Tests

Tests use Orchestra Testbench and Saloon's MockClient to mock HTTP responses without hitting the real API.

Official Clearfacts API Documentation

Note: The Clearfacts API does not support GraphQL introspection. The query/mutation definitions in this SDK are based on the official documentation and schema. If Clearfacts adds or changes endpoints, the request classes in src/Api/Requests/ can be updated accordingly.

License

MIT


All versions of clearfacts-laravel-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
saloonphp/saloon Version ^3.0
saloonphp/laravel-plugin 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 chuckbe/clearfacts-laravel-sdk contains the following files

Loading the files please wait ...