Deni (Debt / IOU)
Record who owes what, for users and for guests with only a phone or email. Includes hosted pay and acknowledgement pages, reminders and disputes.
https://api.paysasa.com/api/v1Authx-api-keyFormatJSONDeni records IOUs for registered users and guests (phone/email). Each record gets a public_token for hosted pay and acknowledgment pages. Wallet settlement uses p2p_transfer fees; M-PESA uses checkout metadata deni_public_checkout. Reminder channels (SMS/email) debit the creditor wallet per send; quote fees with GET /deni/reminder-fees.
const res = await fetch("https://api.paysasa.com/api/v1/deni", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer YOUR_API_KEY" },
body: JSON.stringify({
creditor_wallet_id: "wallet_creditor_id",
debtor_phone: "2547XXXXXXXX",
debtor_email: "[email protected]",
debtor_name: "Jane Doe",
principal_amount: 50000,
currency: "KES",
description: "Goods on credit",
due_at: new Date(Date.now() + 7 * 86400000).toISOString(),
reminder_channels: ["sms", "email"],
allow_partial_payment: true,
}),
});
const { deni } = await res.json();
// deni.public_token → share /pay/deni/{token}Creditor adjusts remaining balance; debtor is notified.
Body: { "channels": ["sms","email"] }
Authenticated debtor wallet + PIN (P2P fees).
Public (no API key)#
GET /deni/token/:token/public
POST /deni/token/:token/checkout — M-PESA checkout
POST /deni/token/:token/pay — wallet (session)
POST /deni/token/:token/acknowledge — acknowledge or decline
POST /deni/token/:token/dispute — guest dispute