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.
// 1. Send the user an OTP
await fetch("https://api.bitika.xyz/api/v1/auth/sms/send", {
method: "POST",
headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ phone: "254712345678" }),
});
// 2. Charge M-Pesa → settle Bitcoin to a Lightning address
const res = await fetch("https://api.bitika.xyz/api/v1/xwift/collect", {
method: "POST",
headers: {
Authorization: `Bearer ${KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
amount: "100", // KES
phone: "254712345678",
lightningAddress: "user@walletofsatoshi.com",
verificationCode: 123456, // the OTP the user received
}),
});
// → { transaction_code, status: "processing" }