SANDBOX — simulated integrations, synthetic data, no real money moves · Docs describe the sandbox build
Skip to content

Pay with ARAF · API v1

Embedded Murabaha financing for your checkout

Pay with ARAF lets your customers buy now and pay over time with non-interest (Murabaha) asset financing from The Alternative Bank. You create a checkout session on your server, redirect the customer, and fulfil the order only when the Bank authorises goods release.

How it works#

  1. 1

    Create a checkout session (server-side)

    When the customer chooses “Pay with ARAF”, your server calls POST /api/v1/checkout/sessions with the cart (integer kobo), an Idempotency-Key, and approved return/cancel URLs. You receive a checkout_url and an application_reference.
  2. 2

    Redirect the customer

    Send the customer to checkout_url. The Bank’s hosted checkout handles identity, eligibility, the offer, documents and the repayment mandate. You never see BVNs, credit scores or statements.
  3. 3

    Listen for webhooks

    Your endpoint receives signed events as the application progresses — application.*, financing.*, vendor.*, goods.*. Treat them as notifications and confirm state through the API.
  4. 4

    Verify the release authorisation

    When you receive goods.release_authorized, call GET /api/v1/releases/{reference}. Only release_authorized: true with status: "AUTHORIZED" permits you to hand over the goods.
  5. 5

    Fulfil and confirm delivery

    Record dispatch or collection with POST /orders/{ref}/fulfil, then confirm delivery with POST /orders/{ref}/deliver. The Bank pays the vendor directly; see Settlements.

Release goods only on a verified release authorisation

A customer redirect, screenshot, email, financing.approved or even vendor.payment_confirmed is not proof that you may release goods. The only acceptable proof is GET /api/v1/releases/{reference} returning release_authorized: true.
  1. EligibleIndicative only
  2. SubmittedNot approved
  3. ApprovedNot paid
  4. Vendor paidNot released
  5. Release authorisedHand over goods

Quickstart#

Get a sandbox secret key (sk_test_…) from Partner portal → Integration → API keys, then create your first session. Amounts are integer kobo: ₦450,000.00 is 45000000.

curl -X POST https://pay-with-araf.onrender.com/api/v1/checkout/sessions \
  -H "Authorization: Bearer $ARAF_SECRET_KEY" \
  -H "Idempotency-Key: order-ORD-10045-attempt-1" \
  -H "Content-Type: application/json" \
  -d '{"merchant_order_reference":"ORD-10045","currency":"NGN","amount":45000000,"items":[{"sku":"PHONE-001","name":"Sandbox Smartphone X","quantity":1,"unit_amount":45000000,"category":"smartphones","vendor_reference":"VENDOR-LEKKI-ELEC"}],"customer":{"email":"customer@example.com","phone":"+2348030000001"},"return_url":"https://shop.example.com/orders/ORD-10045","cancel_url":"https://shop.example.com/cart"}'

Try it without writing code in the API explorer, and use the sandbox test identities to drive the customer journey to any outcome.

Key principles#

  • Server-side only. Secret keys never go into browsers or mobile apps. Create sessions from your backend with amounts from your own database.
  • Money is integer kobo. amount must equal the sum of unit_amount × quantity; the API recomputes it and rejects mismatches.
  • Idempotent writes. POST /checkout/sessions requires an Idempotency-Key; retries with the same key return the original response.
  • Events are at-least-once. De-duplicate by event_id and use resource_version to ignore stale updates.
  • Privacy by design. Merchants receive operational statuses only — never BVNs, credit scores, statements, salary, affordability or decline reasons.

Where to next#