Install from a source checkout
If you have access to the Ledger source repository, install the package from its folder:ledger_test_ accesses Sandbox and ledger_live_ accesses Live. Use the same client methods for either environment and keep the keys in separate server-side variables. See Sandbox and live environments.
snake_case names and arguments. The client sends Ledger’s documented JSON field names, including request_id for usage tracking. Each method returns the parsed JSON response as a dictionary.
Handle an API error
LedgerAPIError exposes status, code, and the parsed response body. Connection failures raise LedgerConnectionError. For plan upgrades, reuse one idempotency_key for retries of the same intended upgrade.
The API reference provides cURL, Python, and TypeScript examples for the exact body and responses of each endpoint.