EFL
Low-level clients

CalculationApiClient

Low-level client for /Calculation endpoints used to calculate and accept offers.

CalculationApiClient provides raw access to calculation-related endpoints under /Calculation. It is a final class that depends on EflHttpClient, which performs authenticated HTTP requests.

Class definition

  • Namespace: Imoli\EflLeasingSdk\Api
  • Constructor: accepts a single EflHttpClient $http dependency.

In typical code you call these endpoints indirectly via EflClient.

Methods

calculateBasicOffer

Low-level wrapper over POST /lon/api/v1/Calculation/CalculateBasicOffer.

public function calculateBasicOffer(
    AssetToCalculation $basket,
    string $bearerToken
): HttpResponse

Auth: Bearer token.

Parameters

NameTypeRequiredDescription
basketAssetToCalculationYesBasket of assets to be used for the calculation.
bearerTokenstringYesBearer token for the authenticated request.

The request body is built from AssetToCalculation::toRequestPayload(), and the transactionId query parameter is taken from that payload.

Return value


getBaseData

Low-level wrapper over GET /lon/api/v1/Calculation/GetBaseData.

public function getBaseData(string $transactionId, string $bearerToken): HttpResponse

Auth: Bearer token.

Parameters

NameTypeRequiredDescription
transactionIdstringYesIdentifier of the transaction.
bearerTokenstringYesBearer token.

Return value


acceptCalculation

Low-level wrapper over POST /lon/api/v1/Calculation/AcceptCalculation.

public function acceptCalculation(
    string $transactionId,
    int $calculationId,
    int $calculationVariantId,
    ?bool $basketCalculation,
    string $bearerToken
): HttpResponse

Auth: Bearer token.

Parameters

NameTypeRequiredDescription
transactionIdstringYesIdentifier of the transaction.
calculationIdintYesIdentifier of the calculation to be accepted.
calculationVariantIdintYesIdentifier of the calculation variant to be accepted.
basketCalculationbool|nullNoWhether basket calculation is used; sent as "true" / "false".
bearerTokenstringYesBearer token.

The request body is a JSON object with calculationId and calculationVariantId.

Return value

  • Type: HttpResponse – response without a strongly-typed model; use status and body for diagnostics.