Bitika API

Bitcoin payments, in a few lines

Accept M-Pesa or Airtel Money and settle your users in Bitcoin over the Lightning Network, starting at KES 10. One API key, no custody.

Build the entire thing for free first. The sandbox is instant, needs no approval, and moves no money — you only talk to us when you want to go live.

collect.js
// One call. No OTP — your API key already identifies you.
const res = await fetch("https://bitikaserver.up.railway.app/api/v1/xwift/collect", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${KEY}`,          // bk_test_9f2c4a71e05b83d6
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    amount: "100",                            // KES
    phone: "254712345678",                    // no +, no leading 0
    lightningAddress: "name@blink.sv",        // where the sats land
  }),
});
// → { transaction_code: "SBX-1A2B3C4D", status: "processing" }

// Your webhook receives the result — signed, no polling:
//   transaction.updated → payment.completed

What integrating actually looks like

Three of these four steps cost you nothing and need nothing from us. Here is the whole path, up front.

01Free

Read the docs

Every endpoint, the sandbox, webhooks, errors — all public. Nothing is behind a login.

02Free

Register, get a sandbox key instantly

One form. A bk_test_ key is issued immediately — no approval from us, no card, no wait.

03Free

Build the whole integration, free

The sandbox runs the real flow end to end: real transactions, real signed webhooks, real state machine. No money moves, no SMS is sent. Force failures with a magic phone number.

04

Ask for a live key when you are ready

Verify your email and request bk_live_. We approve it, and the exact same code starts moving real money.

The sandbox is a real sandbox

A bk_test_ key runs the complete lifecycle — it writes a real transaction, walks processing → processing_payment → fulfilled, and delivers real HMAC-signed webhooks to your URL. It just never charges M-Pesa, never sends an SMS, and never moves a satoshi. The OTP is always 123456, and a phone ending 000001 or 000002 forces the failure paths.

See how the sandbox works

What you need

Five values. That is the whole request body.

  1. 1

    An API keybk_test_9f2c4a71e05b83d6

    Sent as a Bearer token. No signing, no OAuth. Issued instantly when you register.

  2. 2

    The amount, in KES"100"

    A string. Minimum 10, maximum 10,000.

  3. 3

    The payer's phone254712345678

    Canonical format: no +, no leading 0. M-Pesa or Airtel.

  4. 4

    Where the sats goname@blink.sv

    A Lightning address. Or pass a BOLT11 invoice (lnbc1...) or an LNURL instead.

  5. 5

    An Idempotency-Key4f9a1c2e-8b3d-4e7a-9c11-2b7d6e5f0a91

    A fresh UUID per payment, so a retry can never double-charge.

No OTP. No request signing. No OAuth dance.

Built for production

A sandbox that is actually a sandbox

bk_test_ keys simulate everything and move zero money. Same endpoints, same payloads, real webhooks.

Non-custodial

Sats settle straight to the user’s wallet. We never hold customer funds.

From KES 10

Micro-payments work. Max KES 10,000 per transaction. Flat 3% fee on live.

Realtime webhooks

A signed callback on every status change, no polling. Verify with your secret.

Lightning-fast

M-Pesa in, Bitcoin out over Lightning, settlement in seconds.

Scoped & rate-limited

Per-key scopes, IP allowlists, and rate limits keep integrations safe.

Instant · No approval · No card

Now grab your sandbox key

You've seen the whole API. Registering takes a minute and hands you a bk_test_ key on the spot. Go live later, when it suits you.

Create your account