Skip to main content

Python SDK for Lenco API - Payments, Transfers, Collections

Project description

lenco-python

Python SDK for Lenco API - Payments, Transfers, Collections

Installation

pip install lenco-python
# or
poetry add lenco-python

Quick Start

from lenco import Lenco

client = Lenco(
    api_key="your-api-key",
    environment="production"  # or "sandbox"
)

# Get accounts
accounts = client.accounts.list()

# Transfer to bank account
transfer = client.transfers.to_bank_account(
    account_id="your-account-uuid",
    account_number="0123456789",
    bank_id="bank-uuid",
    amount=10000,
    reference="payment-001",
    narration="Payment for services"
)

# Collect via mobile money
collection = client.collections.from_mobile_money(
    amount=5000,
    reference="order-123",
    phone="0971234567",
    operator="airtel",
    country="zm"
)

Async Support

import asyncio
from lenco import AsyncLenco

async def main():
    client = AsyncLenco(api_key="your-api-key")
    
    # Concurrent requests
    accounts, banks = await asyncio.gather(
        client.accounts.list(),
        client.banks.list(country="ng")
    )
    
    print(f"Found {len(accounts)} accounts")
    print(f"Found {len(banks)} banks")

asyncio.run(main())

Features

  • Full type hints support
  • Sync and async clients
  • Accounts, Banks, Transfers, Collections, Settlements, Transactions APIs
  • Webhook signature verification
  • Automatic retries with exponential backoff
  • Pydantic models for request/response validation

Documentation

Full API documentation available at docs.lenco.co

Author

Alexander Asomba (@alexasomba) · 𝕏 @alexasomba

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lenco_python-2.0.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lenco_python-2.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file lenco_python-2.0.0.tar.gz.

File metadata

  • Download URL: lenco_python-2.0.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lenco_python-2.0.0.tar.gz
Algorithm Hash digest
SHA256 47380ea7fec8f43956227b1a090c369ad0273642c8f4c84e3b4e928812059831
MD5 aecddbe85f35c556e2d85b946e54df28
BLAKE2b-256 2d956ba5e1b19e87dec5a3b4321f973ccaa01a8f001e8564ff8dafc7a7bf8114

See more details on using hashes here.

File details

Details for the file lenco_python-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: lenco_python-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lenco_python-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 661ae8ddc05d790ead70a493521adbe45f7953626b61e6d5294aea96b552bf14
MD5 15508ebb6dacda7b4ffe9ab7a2e743d3
BLAKE2b-256 5f66cbfa386dfb2d41ff1261054d7c47b37e1b07bb531eaf9052ccc5d83e2bc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page