Skip to content

Flutterwave Setup & Integration Guide

The flutterwave provider integrates Flutterwave API v3 Standard Checkout, Subscriptions, Saved Cards, and Chargeback Tracking across African and international markets (NGN, GHS, KES, UGX, TZS, RWF, XOF, XAF, ZAR, USD, EUR, GBP).


Kirak connects to Flutterwave directly via async REST API calls with httpx. No external Flutterwave SDK or additional pip package is required.

Terminal window
pip install "kirak"

In the Flutterwave Dashboard:

  1. Navigate to Settings $\rightarrow$ API keys.
  2. Copy your Secret key (FLWSECK_TEST-... in test mode, FLWSECK-... in live mode).

In Settings $\rightarrow$ Webhooks:

  1. Set the URL to: https://your-domain.com/payments/webhook/flutterwave.
  2. Enter a Secret hash (a long random secret string of your choosing).
  3. Enable webhook retries (Flutterwave turns this off by default).
  4. Select the v3 webhook format.
  5. (Optional) Contact Flutterwave support (hi@flutterwavego.com) to enable refund and chargeback webhooks for your merchant account.
{
"payments": {
"default_provider": "flutterwave",
"providers": {
"flutterwave": {
"type": "flutterwave",
"environment": "test",
"country": "NG",
"success_url": "https://your-domain.com/payment/success"
}
}
}
}
Setting Type Required Description
country string Yes (for off-session) Two-letter ISO country code of your merchant account (e.g. "NG", "KE")
environment string No "test" (default) or "live"
success_url string No Buyer return URL after checkout
Terminal window
KIRAK_PAYMENT_FLUTTERWAVE_SECRET_KEY=FLWSECK_TEST-...
KIRAK_PAYMENT_FLUTTERWAVE_SECRET_HASH=your_secret_hash_from_step2

Amounts are passed in minor units (e.g. kobo for NGN; 250,000 kobo = NGN 2,500.00):

result = await kirak.payments.initiate_payment({
"provider": "flutterwave",
"user_id": "usr_700",
"amount": 250000, # ₦2,500.00
"currency": "NGN",
"name": "Standard Access",
"type": "one_time",
"payment_email": "buyer@example.com",
})
checkout_url = result["data"]["url"]

Subscriptions link to a Flutterwave Payment Plan ID:

result = await kirak.payments.initiate_payment({
"provider": "flutterwave",
"user_id": "usr_700",
"amount": 0, # Set by Flutterwave Plan
"currency": "NGN",
"name": "Pro Monthly Plan",
"type": "subscription",
"subscription_plan_id": "12345", # Flutterwave Plan ID
"payment_email": "buyer@example.com",
})

[!WARNING] Cancellation Behavior: Flutterwave only supports immediate cancellation. Calling cancel_subscription with at_period_end: True returns 501 NOT_SUPPORTED.

  • Save card during one-time payment: pass save_payment_method: True with consent.
  • Headless off-session charge:
    result = await kirak.payments.charge_off_session({
    "provider": "flutterwave",
    "user_id": "usr_700",
    "amount": 100000, # ₦1,000.00
    "currency": "NGN",
    "name": "Metered Storage",
    "idempotency_key": "flw-overage-usr700-oct",
    })
    Note: Because 3-D Secure is mandatory across most African issuing banks, off-session charges typically return status="REQUIRES_ACTION" with action_url for the user to complete 2FA authentication.

Normalized event Gateway Events Description
payment_completed charge.completed Payment completed and verified
payment_failed charge.completed (status="failed") Payment failed
subscription_cancelled subscription.cancelled Subscription cancelled
refund_completed refund.completed Refund settled
dispute_created chargeback.initiated Chargeback opened
dispute_updated chargeback.accepted, chargeback.declined, chargeback.lost Chargeback updated
payment_method_saved charge.completed (with card token) Reusable token stored