jayb.ke
Architecture REST API • Webhooks • Drop-in SDK

Jayb Developer Documentation

Jayb provides non-custodial financial infrastructure for applications operating in Africa and globally. Integrate once to accept payments across Safaricom M-Pesa, Hormuud EVC+, Telesom Zaad, Dahabshiil eDahab, Ethiopian Telebirr & CBE Birr, domestic mobile money and bank transfers in 30+ African countries, international cards, and high-value US/UK/EU domestic bank wires with zero interchange fees.

1 Integration • 30+ Countries

Accept payments across Kenya, Somalia, Somaliland, Ethiopia, Nigeria, Ghana, South Africa, US, UK, and EU.

Turnkey Recurring Billing

Automated 10-minute SMS warnings, STK push, and recovery links for missed PINs.

Automated Bank Sweeps

Real-time Pesalink sweeps into your commercial accounts at Equity Bank or KCB.

2. Authentication & API Keys

Bearer Token

Authenticate your requests by including your secret API key in the standard HTTP Authorization header:

Authorization: Bearer YOUR_JAYB_API_KEY
Security Notice:

Your secret API key carries full administrative authority to create sessions and initiate payouts. Never expose your secret API key in client-side code or public repositories.

3. Supported Payment Rails & Adapters

Auto-routed by Currency
Safaricom M-Pesa (Kenya) KES

Instant STK Push prompt to customer mobile handset; C2B Paybill & Buy Goods direct pay.

Channel: mpesa
Hormuud EVC+ & Zaad (Somalia) USD

Direct USSD push prompts for Hormuud EVC Plus, Telesom Zaad, and Golis Sahal wallets.

Channel: waafi
Dahabshiil eDahab (Somaliland) USD / SLSH

Instant digital invoice generation and push notifications to Dahabshiil wallet subscribers.

Channel: edahab
Telebirr & CBE Birr (Ethiopia) ETB / USD

Ethio Telecom Telebirr in-app mobile checkout, CBE Birr, and Awash Bank direct settlement.

Channel: telebirr
Pan-African Rails (30+ Countries) NGN / GHS / ZAR...

MTN MoMo, Airtel Money, Vodafone Cash, Capitec Pay, Fawry, and local bank transfers across Nigeria, Ghana, South Africa, Uganda, Rwanda, and Egypt.

Channel: pan_african
Visa / Mastercard / Amex Global

Tokenized credit and debit cards across 150+ countries with automatic 3D-Secure authentication.

Channel: card

4. High-Value Global Bank Wires

Collect $1,000 to $500,000 without card processing interchange fees.

Zero Card Interchange
Country / Corridor Network / Rail Bank Name Currency Settlement Speed
Pesalink & Local Bank
Fedwire & ACH
SEPA & SEPA Instant
Faster Payments
UAE FTS
EFT & Wire
Global SWIFT Wire

5. Drop-in Widget SDK (widget.js)

Fastest Embed

The Jayb Widget opens an interactive, mobile-responsive checkout modal. It handles mobile money number input, fee calculation, STK status polling, and card authorization.

<!-- 1. Include SDK in your HTML -->
<script src="https://jayb.page.ke/widget.js"></script>

<!-- 2. Launch when user clicks your Checkout button -->
<script>
  async function pay() {
    // Call your backend to generate a session
    const res = await fetch("/api/my-checkout-session", { method: "POST" });
    const { sessionToken } = await res.json();

    // Launch Jayb modal
    JaybPay.open({
      sessionToken: sessionToken,
      host: "https://jayb.page.ke",
      onSuccess: (data) => {
        console.log("Payment successful! Ref: " + data.reference);
        window.location.href = "/receipt?id=" + data.reference;
      },
      onCancel: () => {
        console.log("Checkout modal dismissed.");
      }
    });
  }
</script>

6. Checkout Sessions API

POST /api/v1/checkout/sessions

Create a checkout session from your backend. A session calculates fee additions (if enabled), records metadata, and returns a session_token for the widget or a hosted_checkout_url.

Parameter Type Requirement Description
amount number required The amount to charge in base currency units (e.g. 5000 for KES).
currency string required ISO currency code: KES, USD, EUR, GBP, ETB.
cover_fees boolean optional Whether the customer or donor absorbs the gateway processing fee. Defaults to false.
payer_phone string optional Pre-fills the mobile money phone number for STK prompts.
metadata object optional Arbitrary key-value pairs returned in webhooks and reports.
Request Payload (JSON)
{
  "amount": 5000,
  "currency": "KES",
  "cover_fees": true,
  "payer_name": "Amina Warsame",
  "payer_phone": "+254712345678",
  "recurring": false,
  "metadata": {
    "invoice_id": "INV-2026-901"
  }
}
Response Payload (HTTP 201 Created)
{
  "session_token": "chk_live_a1b2c3d4e5f6...",
  "reference": "CHK-890123-X9Y2",
  "status": "pending",
  "amount": 5000.0,
  "fee_covered_amount": 250.0,
  "total_charged_amount": 5250.0,
  "currency": "KES",
  "hosted_checkout_url": "https://jayb.page.ke/checkout/chk_live_a1b2c3d4e5f6...",
  "embed_url": "https://jayb.page.ke/embed/checkout?token=chk_live_a1b2c3d4e5f6..."
}

7. Recurring Subscriptions & Pre-Notification Flow

Automated Orchestration

Unlike cards that charge in the background, African mobile money (M-Pesa, EVC+, Zaad) requires the user to enter their PIN on their phone screen. If an unexpected STK prompt appears, users reject or cancel it. Jayb solves this with an end-to-end automated subscriber communication loop:

The Jayb Recurring Loop:
  1. T-10 Minutes (Friendly SMS Notice): Jayb sends an SMS: "Hello Amina! Your monthly contribution of 2,500 KES is scheduled today. You will receive a prompt on your phone in 10 minutes. Please enter your PIN."
  2. T-0 Minutes (Push STK Prompt): Automated STK PIN prompt is dispatched to the subscriber's phone screen.
  3. T+5 Minutes (Telco Status Verification): Status is verified with Safaricom/Hormuud gateway.
  4. On Non-Completion (Recovery Link + Retries): If the user cancelled or missed the prompt, Jayb sends a reminder SMS with a 1-click self-serve recovery link, and reprompts again after 15 minutes.
  5. On Completion: Webhook recurring.cycle.completed fires and subscriber receives a digital receipt.

8. Custom Fee Coverage Configuration

In platforms like eSadaqa, donors frequently opt to cover gateway processing fees so that 100% of their donation reaches the intended charity. Jayb allows each client application to configure fee rules directly in their Client App Portal:

1. Optional Checkbox

Rendered in modal: "Cover processing fees (+5%)". Can be defaulted to checked.

2. Mandatory Platform Fee

Fee is automatically added to every checkout total without an opt-out toggle.

3. Merchant Absorbs

Total charged equals base amount; fees are deducted upon payout settlement.

9. Webhooks & HMAC-SHA256 Signatures

Replay Protection

When an event occurs, Jayb sends a POST request to your configured webhook_url. Verify signatures using your application's webhook_secret.

Header: X-Jayb-Signature • HMAC-SHA256 of timestamp + "." + raw body
Header: X-Jayb-Timestamp • Unix epoch timestamp in seconds
Webhook Payload Sample
{
  "event": "payment.success",
  "data": {
    "reference": "CHK-890123-X9Y2",
    "amount": 5000.0,
    "fee_covered_amount": 250.0,
    "total_charged_amount": 5250.0,
    "currency": "KES",
    "channel": "mpesa",
    "payer_name": "Amina Warsame",
    "payer_phone": "+254712345678",
    "channel_reference": "QHJ891K20X",
    "metadata": {
      "invoice_id": "INV-2026-901"
    },
    "completed_at": "2026-10-10T23:30:00Z"
  }
}

10. Cross-Border Supplier Settlements (China & Dubai)

Settle freight supplier invoices or diaspora landlord payouts directly via locked FX quotes and local clearing:

# 1. Request Guaranteed Quote
curl -X POST https://jayb.page.ke/api/v1/transfers/quote \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source_currency": "KES", "destination_currency": "CNY", "source_amount": 1000000}'

# 2. Request Payout
curl -X POST https://jayb.page.ke/api/v1/transfers/request_payout \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "quote_id": "QUO-781923",
    "supplier_name": "Yiwu Cargo Express Ltd",
    "supplier_bank_account": "62220210010098231",
    "supplier_bank_name": "Industrial and Commercial Bank of China (ICBC)"
  }'

11. Sandbox Testing & Test Numbers

In sandbox mode, use the following test phone numbers to verify your app's handling of success, insufficient balance, or PIN cancellation:

Instant Success

+254711000001

Returns successful transaction and fires webhook within 1 second.

Insufficient Balance

+254711000002

Returns telco error DS_INSUFFICIENT_FUNDS.

User Cancelled PIN

+254711000003

Simulates cancelled prompt to test SMS recovery flow.