The official Python SDK for Reevit — a unified payment orchestration platform for Africa.
# Reevit Python SDK
The official Python SDK for Reevit — a unified payment orchestration platform for Africa.
## Installation
```bash
pip install reevit==0.9.1
```
## Quick Start
```python
from reevit import Reevit
client = Reevit(api_key="pfk_live_xxx", org_id="org_123")
# Create a payment
try:
payment = client.payments.create_intent({
"amount": 5000, # 50.00 GHS
"currency": "GHS",
"method": "momo",
"country": "GH",
"customer_id": "cust_123",
"metadata": {
"order_id": "12345"
}
}, idempotency_key="order_12345")
print(f"Payment created: {payment['id']}")
except Exception as e:
print(f"Error: {e}")
# List payments
payments = client.payments.list()
print(payments)
```
## Server-created checkout sessions
Create checkout sessions on your server, then pass `session["session_secret"]` to a browser SDK — `@reevit/react`, `@reevit/vue`, or `@reevit/svelte` — to render the checkout UI.
```python
session = client.checkout_sessions.create(
{
"amount": 5000,
"currency": "GHS",
"method": "mobile_money",
"country": "GH",
},
idempotency_key="order_12345",
)
```
## Idempotency
Pass `idempotency_key` to safely retry intent creation without duplicates.
```python
payment = client.payments.create_intent(
{
"amount": 5000,
"currency": "GHS",
"method": "momo",
"country": "GH",
},
idempotency_key="order_12345",
)
```
## Features
- **Payments**: Create intents, update intents, confirm, confirm intent, cancel, retry, refund, stats
- **Connections**: Manage PSP integrations, validation, labels, status, audit
- **Subscriptions**: Manage recurring billing lifecycle
- **Fraud**: Configure fraud rules
- **Customers / Payment Links / Checkout Sessions / Webhooks / Routing Rules / Invoices**: Additional backend services
`org_id` is supported directly on the client. Omitting it for authenticated requests still works for backward compatibility, but that mode is deprecated.
To fetch every connected PSP rather than one page:
```python
connections = client.connections.list_all(m …