EflClient overview
Purpose
EflClient is the main entry point for most integrations.
It orchestrates calls to the underlying API clients and exposes high-level methods that match common ecommerce scenarios, such as:
- Starting a leasing process for an order.
- Calculating basic offers for a basket of assets.
- Submitting customer data and statements.
- Initialising identity verification and checking its status.
- Sending leads and contact forms.
Internally it uses the low-level clients from the Api namespace and converts between models defined in the Model namespace.
Construction
You typically construct EflClient once and reuse it:
use GuzzleHttp\Client as GuzzleClient;
use Imoli\EflLeasingSdk\Config;
use Imoli\EflLeasingSdk\EflClient;
use Imoli\EflLeasingSdk\Http\Adapter\GuzzleHttpAdapter;
$config = Config::sandbox(
apiKey: 'your-sandbox-api-key',
baseUrl: 'https://leasingonlineapi-sandbox.efl.com.pl'
);
$guzzle = new GuzzleClient([
'timeout' => 30,
'connect_timeout' => 10,
]);
$httpClient = new GuzzleHttpAdapter($guzzle);
$client = new EflClient($config, $httpClient);
Class definition
- Namespace:
Imoli\EflLeasingSdk - Class:
final class EflClient - Constructor:
public function __construct(Config $config, HttpClientInterface $httpClient, ?RequestLoggerInterface $logger = null)
- Internal composition:
- Creates an
EflHttpClientusing the providedConfig,HttpClientInterfaceand optionalRequestLoggerInterface. - Instantiates and holds:
- Creates an
Most applications should depend only on EflClient and the model classes described in the models overview, without instantiating low-level API clients directly.
Typical usage pattern
A typical flow using EflClient looks like this:
- Obtain an authentication token.
- Start a leasing process.
- Calculate offers for a basket.
- Submit customer data and statements.
- Perform identity verification and pay‑by‑link steps.
- Optionally send leads or restore processes.
The high-level methods are designed to be used from controller or service code in your application, keeping the SDK concerns isolated from the rest of your domain logic.
Detailed method reference
Each high-level operation exposed by EflClient has its own dedicated page in this section.
Refer to the individual method pages (for example getAuthToken, startProcess, calculateBasicOffer) for exact signatures, input models and return types.