Download the PHP package ledgercore/sdk without Composer

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

ledgercore/sdk (PHP)

Español · English below

SDK oficial de PHP para la API de LedgerCore (ledger de doble partida como servicio). PHP 8.1+, cURL nativo, cero dependencias obligatorias en runtime (el transporte es una interfaz: puedes enchufar tu propio cliente PSR-18).

Instalación

Quickstart (5 líneas)

Autenticación

Le pasas tu API key (lk_sandbox_... / lk_live_...) y el SDK gestiona todo lo demás: la intercambia por un JWT EdDSA de 15 minutos (POST /v1/auth/token), lo cachea, lo renueva solo cuando quedan <60 s de validez y reintenta una única vez con token fresco si la API responde 401.

Dinero

Los montos son siempre strings de unidades menores (int64), nunca floats:

fromDecimal lanza si el decimal tiene más cifras que el exponente: el dinero no se redondea en silencio.

Idempotencia

transactions->create acepta idempotency_key de primera clase; si no lo pasas, el SDK genera un UUID v4. Repetir la misma key devuelve la transacción original (nunca se duplica dinero).

Webhooks

Verifica el header X-LedgerCore-Signature (t=<unix>,v1=<hmac-sha256 hex>) en tiempo constante (hash_equals), con ventana anti-replay de 5 minutos. El header puede traer múltiples v1 (rotación de secreto: 24 h de gracia hasta previous_secret_expires_at, que devuelve rotateSecret); la verificación acepta si CUALQUIERA coincide. Usa siempre el cuerpo crudo (file_get_contents('php://input')), no JSON re-serializado. La superficie completa: $lc->webhooks->create/list/listAll/get/update/rotateSecret/deliveries/deliveriesAll/retryDelivery.

Paginación

Todas las colecciones responden ['data' => [...], 'next_cursor' => ?string] (default 50 por página, máx 200; next_cursor es null en la última página; cursor malformado → 400 invalid_cursor):

Errores

Toda respuesta no-2xx lanza LedgerCore\Exception\LedgerCoreException con status, errorCode y requestId (de error.request_id, siempre presente). Catálogo estable en LedgerCore\ErrorCode (ErrorCode::ALL): validation_failed, invalid_cursor, unauthorized, forbidden, not_found, conflict, idempotency_conflict, unbalanced_transaction, insufficient_funds, rate_limited, service_unavailable, internal. Credenciales rechazadas → AuthenticationException; red caída → ConnectionException.

Superficie completa

ledgers create/list/listAll/get · accounts create/list/listAll/get/balances · transactions create/list/listAll/get/post/reverse · statements->get · trialBalance->get($ledgerId, $asOf = null) · providerPositions->get · webhooks->*

Desarrollo


English

Official PHP SDK for the LedgerCore API (double-entry ledger as a service). PHP 8.1+, native cURL, zero mandatory runtime dependencies (the transport is an interface — plug in your own PSR-18 client if you prefer).

Full surface: ledgers, accounts, transactions (create/list/get/post/reverse), statements->get, trialBalance->get, providerPositions->get, webhooks (subscriptions CRUD, deliveries, signature verification).


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-curl Version *
ext-json Version *
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 ledgercore/sdk contains the following files

Loading the files please wait ...