Official Python SDK for the Felloh payment API
Project description
Felloh Python SDK
Official Python SDK for the Felloh payment API.
Installation
pip install felloh
Quick Start
import asyncio
from felloh import FellohClient
from felloh.types import FellohConfig
client = FellohClient(FellohConfig(
public_key="your_public_key",
private_key="your_private_key",
))
async def main():
# List bookings
bookings = await client.bookings.list({"organisation": "org-id"})
print(bookings["data"])
# Create a booking
booking = await client.bookings.create({
"organisation": "org-id",
"booking_reference": "REF-001",
"customer_name": "Jane Smith",
"email": "jane@example.com",
})
print(booking["data"]["id"])
await client.close()
asyncio.run(main())
Context Manager
async with FellohClient(FellohConfig(
public_key="your_public_key",
private_key="your_private_key",
)) as client:
bookings = await client.bookings.list({"organisation": "org-id"})
Pagination
Iterate through all results automatically:
from felloh import to_array
# Async iteration
async for booking in client.bookings.list_all({"organisation": "org-id"}):
print(booking["id"])
# Or collect all into a list
all_bookings = await to_array(client.bookings.list_all({"organisation": "org-id"}))
Resources
| Resource | Methods |
|---|---|
organisations |
list |
bookings |
list, list_all, get, create, update, delete, update_reference |
booking_components |
create, delete |
transactions |
list, list_all, get, refund, complete, reverse, reassign |
customers |
list, list_all, create |
payment_links |
list, list_all, get, create, delete, assign |
ecommerce |
list, list_all, get, create, delete, assign |
refunds |
list, list_all, authorise, decline |
charges |
list, list_all |
chargebacks |
list, list_all |
credit_notes |
list, list_all, get, create, assign |
suppliers |
list, list_all, create |
beneficiaries |
list, list_all, create, activate |
disbursements |
list, list_all, get |
ledger |
list, list_all |
batches |
list, list_all, get |
api_keys |
list, create, delete |
audit |
list, list_all |
aisp |
accounts, transactions, statistics |
scheduled_payments |
list, list_all, available_tokens, create_payment, approval_link, delete |
enums |
list |
Error Handling
from felloh import (
FellohError,
FellohAuthenticationError,
FellohNotFoundError,
FellohValidationError,
FellohRateLimitError,
FellohServerError,
FellohNetworkError,
)
try:
await client.bookings.get("nonexistent-id")
except FellohNotFoundError as e:
print(f"Not found: {e}")
except FellohAuthenticationError:
print("Invalid credentials")
except FellohError as e:
print(f"API error {e.status_code}: {e}")
Webhook Verification
from felloh import verify_webhook_signature, assert_webhook_signature
# Returns True/False
is_valid = verify_webhook_signature(
payload=request_body,
signature=request.headers["X-Signature"],
secret="your_webhook_secret",
)
# Or raise FellohWebhookSignatureError
assert_webhook_signature(
payload=request_body,
signature=request.headers["X-Signature"],
secret="your_webhook_secret",
)
Configuration
FellohConfig(
public_key="pk_...",
private_key="sk_...",
base_url="https://api.felloh.com", # default
timeout=30.0, # seconds, default
max_retries=2, # default
token_refresh_buffer=60, # seconds before expiry, default
logger=lambda entry: print(entry), # optional request logger
)
Development
pip install -e ".[dev]"
pytest # unit + resource tests
pytest -m integration # integration tests (requires env vars)
Integration tests require:
FELLOH_PUBLIC_KEYFELLOH_PRIVATE_KEYFELLOH_ORGANISATION_ID
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file felloh-0.1.0.tar.gz.
File metadata
- Download URL: felloh-0.1.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1f77ec937bfc6b3cf57fb4dcecb527de9699683a70dfc9e10e3d86fcb6154f0
|
|
| MD5 |
1b0b4a899e1e7dc979b860edf025c4ad
|
|
| BLAKE2b-256 |
22b5a6f1b16ef1c8b0cc36449885767203dd2549d5e84e3edccea610059143c8
|
Provenance
The following attestation bundles were made for felloh-0.1.0.tar.gz:
Publisher:
publish.yml on felloh-org/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
felloh-0.1.0.tar.gz -
Subject digest:
a1f77ec937bfc6b3cf57fb4dcecb527de9699683a70dfc9e10e3d86fcb6154f0 - Sigstore transparency entry: 1204055125
- Sigstore integration time:
-
Permalink:
felloh-org/python-sdk@3d5c96c529db543b647872ea5f357eaea8ee31cb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/felloh-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3d5c96c529db543b647872ea5f357eaea8ee31cb -
Trigger Event:
release
-
Statement type:
File details
Details for the file felloh-0.1.0-py3-none-any.whl.
File metadata
- Download URL: felloh-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28cd067a8467bde9445af2aa8316fb5413f75d709bcdbd5ba14f2e5d493d5d55
|
|
| MD5 |
92437a5aca4599d2e2c5b8f9f5deb939
|
|
| BLAKE2b-256 |
44e768b6fef38c4a15d6b5adbe4a048cf2ba293b90b5f09197e34f7ca0035fcc
|
Provenance
The following attestation bundles were made for felloh-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on felloh-org/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
felloh-0.1.0-py3-none-any.whl -
Subject digest:
28cd067a8467bde9445af2aa8316fb5413f75d709bcdbd5ba14f2e5d493d5d55 - Sigstore transparency entry: 1204055168
- Sigstore integration time:
-
Permalink:
felloh-org/python-sdk@3d5c96c529db543b647872ea5f357eaea8ee31cb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/felloh-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3d5c96c529db543b647872ea5f357eaea8ee31cb -
Trigger Event:
release
-
Statement type: