Iplicit API
This module provides an authenticated client for the Iplicit cloud accounting API, allowing other Drupal modules to read and write Iplicit data. It handles session management, token caching, and error reporting, making it easier to integrate Iplicit with your Drupal site.
Iplicit API connects your Drupal site to Iplicit, a cloud accounting system, by providing a ready-made authenticated client for its REST API. Other modules can then read and write contacts, customer accounts, products, prices, sale orders, invoices and payments without writing the login, session and error-handling code first.
It is a generic API client, not a finished integration: one settings page and a set of services, with no content types, no fields and nothing syncing on its own. Pushing Commerce orders into Iplicit belongs in a separate module that depends on this one.
Features
- Session handling. Iplicit issues a session token that expires after about thirty minutes and expects a
Domainheader on every request. The client does both, caches the token and reuses it, and logs in again if one is rejected. - Secrets stay out of configuration. The API key comes from the Key module and only its ID is stored, so
drush config:exportnever writes the secret toconfig/sync. - Full endpoint coverage. 28 resource classes and 183 methods, generated from Iplicit's OpenAPI specification so names, path parameters and pagination match the real API.
- Plain arrays. Methods take and return decoded arrays, so a field Iplicit adds to a response is readable straight away.
- Typed exceptions. Everything thrown implements
IplicitExceptionInterface, with narrower classes for configuration, authentication and request failures. - Logging with redaction. Failures go to the
iplicit_apichannel with the method, URI, status and error body. The session token, API key andAuthorizationheader never reach the log.
Post-installation
- Create a key at Configuration › System › Keys holding the API key. Use the Environment variable or File provider so the secret never enters the database.
- Go to Configuration › Web services › Iplicit API (
/admin/config/services/iplicit) and fill in the base URI, domain, username and the key. - Press Save and test connection. It reports the domain, the API version and when the token expires.
Additional requirements
- Drupal 10.3 or later, or Drupal 11.
- PHP 8.2 or later.
- Key 1.19 or later, which Composer installs for you.
- An Iplicit account with API access.
For developers
The resource classes are not registered as services, because most sites use a handful of the 28. Register the ones you need in your own module. Autowiring makes it one line, since a resource's only dependency is the client:
services: _defaults: autowire: true Drupal\iplicit_api\Resource\SaleInvoiceResource: ~
Then inject it by type and call it. For an endpoint with no resource wired up, call $client->requestJson() directly: it is still authenticated and still maps errors.
The module's README.md covers wiring, pagination, error handling and the background-calling rule in full. For endpoints and what the fields mean, see the Iplicit API documentation.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.