Skip to main content

Installation

pip install axra

Quick start

from axra import Axra

client = Axra(api_key="sk_test_...")

# Create a payment
payment = client.payments.create(
    amount=5000,
    currency="usd",
)
print(payment.id)

Configuration

OptionTypeDefaultDescription
api_keystrrequiredYour secret API key
base_urlstrhttps://api.useaxra.comAPI base URL
api_versionstr2026-04-15Sent as Axra-Version header
max_network_retriesint2Automatic retries on 5xx
timeout_secondsfloat60.0Request timeout

Local-rail payouts

client.payouts and client.recipients send outbound local-rail payouts. Pay a saved recipient by recipient_id, or pass recipient= inline to create + screen + pay in a single call. See Local-rail payouts for corridors and recipient fields.
quote = client.payouts.quote(
    rail="LOCAL_BANK",
    country="NG",
    currency="NGN",
    src_amount="100.00",
)

payout = client.payouts.create(
    rail="LOCAL_BANK",
    quote_token=quote.quote_token,
    recipient={
        "country": "NG",
        "account_number": "0123456789",
        "account_name": "Jane Doe",
        "bank_code": "058",
        "bank_name": "Example Bank",
    },
    idempotency_key="payout-ng-2026-06-02-0001",
)
print(payout.id, payout.status)
MethodDescription
client.payouts.quote(...)Lock an FX quote (60s) for a local-rail payout
client.payouts.create(...)Confirm a payout — saved recipient_id or inline recipient
client.payouts.get(id) / client.payouts.list(...)Retrieve / list payouts
client.recipients.create(...)Save a reusable payout recipient

Webhook signature verification

from axra.webhooks import construct_event

@app.route("/webhooks", methods=["POST"])
def handle_webhook():
    signature = request.headers.get("Axra-Signature")
    event = construct_event(
        payload=request.data,
        signature_header=signature,
        secret="whsec_your_signing_secret",
    )

    if event["type"] == "payment.completed":
        # handle payment
        pass

    return "ok", 200

Full API access

The Python SDK includes a fully generated API client for all endpoints:
# Access the full generated client
response = client.http.get("/api/v1/treasury/whoami")