Escrow Safe Trade is live: protect your next high-value deal Learn more
ProductsPayment links & checkoutM-Pesa, cards, invoices, split payoutsEscrow Safe TradeMilestone and release-based escrowWallets & P2PPersonal and business walletsChama, Lengo & DeniGroup savings, goals and IOUsBusiness toolkitAccounting, payroll, POS, ticketingBulk payments & payrollPay many people in one uploadSubscriptions & billingRecurring plans and renewalsRent, loans & donationsCollections and campaignsAll products
SolutionsMerchantsBuyersChama groupsBusiness solutionsIndustries
Pricing
DevelopersDeveloper overviewQuickstart, auth and sandboxREST APIsCheckout, invoices and requestsWebhooksSigned, real-time eventsWallet-as-a-ServiceVirtual sub-accountsDocumentationGuides and API reference
Security
CompanyAbout usCareersPartnersBlogHelp centreContact us
Log in Get started Talk to sales
Accept payments

Donations

Fundraising campaigns with a public donate page that accept M-Pesa, wallet and card gifts.

Base URLhttps://api.paysasa.com/api/v1Authx-api-keyFormatJSON

First-class fundraising for verified businesses. Create campaigns with a public donate page, collect gifts over M-Pesa STK, wallet, or PayBill (DN-XXXXX), and issue sequential receipts. Requires the Donations module and donations_enabled on the business. Authenticate with a business API key, or a signed-in session plus business_id.

EndpointDescription
GET /donations/campaignsList campaigns
POST /donations/campaignsCreate draft campaign (purpose + beneficiary required)
PATCH /donations/campaigns/:idUpdate campaign; set status to active|paused|closed
GET /donations/giftsList gifts (optional campaign_id, q)
GET /donations/campaigns/:id/exportCSV export of gifts/receipts
GET /donations/public/:slugPublic campaign payload
POST /donations/public/:slugWallet pay (signed-in donor)
POST /donations/public/:slug/mpesa-checkoutCreate M-Pesa STK checkout session
Shell
const res = await fetch("https://api.paysasa.com/api/v1/donations/campaigns", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "apk_live_…",
},
body: JSON.stringify({
business_id: "biz_…",
title: "Community Fundraiser",
purpose: "School fees support",
beneficiary_name: "Acme Foundation",
amount_mode: "open",
min_amount: 10000,
}),
});
const { campaign } = await res.json();
// Public page: /donate/{campaign.slug}
// PayBill BillRef: campaign.public_reference (DN-XXXXX)

Buy Me a Coffee tips use Payment Links with link_purpose=buy_me_coffee (not this Donations API).