Getting started
Prerequisites
Before you start, make sure you have:
- PHP >= 8.1 (recommended 8.2 or newer) with
ext-jsonenabled. - Composer for dependency management.
- Access to the EFL Leasing Online sandbox (API key and partner ID).
You will also need an HTTP client implementation. The SDK ships with adapters for:
- Guzzle (
GuzzleHttp\Client) - Symfony HttpClient (
Symfony\Component\HttpClient\HttpClient)
You can also provide your own implementation of HttpClientInterface.
1. Install the SDK
Install the SDK in your project as described in the Installation guide.
Once installed, the SDK is available under the Imoli\EflLeasingSdk namespace.
2. Create configuration
Use the Config value object to describe environment and authentication.
For sandbox usage:
use Imoli\EflLeasingSdk\Config;
$config = Config::sandbox(
apiKey: 'your-sandbox-api-key',
baseUrl: 'https://leasingonlineapi-sandbox.efl.com.pl'
);
For production you will use Config::production() with a different base URL and API key, as described in the Configuration section.
3. Configure HTTP client
You must provide an implementation of HttpClientInterface. The recommended way is to use one of the adapters:
use GuzzleHttp\Client as GuzzleClient;
use Imoli\EflLeasingSdk\Http\Adapter\GuzzleHttpAdapter;
$guzzle = new GuzzleClient([
'timeout' => 30,
'connect_timeout' => 10,
]);
$httpClient = new GuzzleHttpAdapter($guzzle);
or with Symfony HttpClient:
use Imoli\EflLeasingSdk\Http\Adapter\SymfonyHttpAdapter;
use Symfony\Component\HttpClient\HttpClient;
$symfonyClient = HttpClient::create();
$httpClient = new SymfonyHttpAdapter($symfonyClient);
You can also implement HttpClientInterface yourself if you want to integrate with a different HTTP stack.
4. Create the main client
Instantiate EflClient with the configuration and HTTP client:
use Imoli\EflLeasingSdk\EflClient;
$client = new EflClient($config, $httpClient);
This client exposes high-level methods for typical ecommerce flows, such as:
- Authentication and process initialisation.
- Offer calculation.
- Customer data submission and statements.
- Identity verification and pay‑by‑link.
5. Make your first call
As a first step, you typically obtain an authentication token and initialise a process. The exact methods may evolve with the SDK, but the general pattern is:
// Pseudocode – check the API section for exact method names and signatures.
// Bearer token returned by getAuthToken(), used in subsequent calls
$token = $client->getAuthToken($partnerId);
$process = $client->startProcess(
positiveReturnUrl: 'https://example.com/efl/success',
negativeReturnUrl: 'https://example.com/efl/failure',
token: $token
);
Then you can calculate offers, submit customer data and perform verification flows. See the Quickstart and Guides sections for complete examples.
Where to go next
- Installation – more details about environment, requirements and installing optional dependencies.
- Quickstart – an end‑to‑end minimal integration example with a typical backend flow.
- API overview – overview of available API clients, models and error handling.