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

Subscriptions

Model plans with customers, products and recurring prices, then start subscriptions that raise an invoice every billing period.

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

Create billing customers, products, and prices, then start subscriptions for your business. Each billing period issues an invoice customers can pay with M-Pesa or wallet. Authenticate with a business API key, or a signed-in session plus business_id.

EndpointDescription
POST /billing/customersCreate billing customer
POST /billing/productsCreate product
POST /billing/pricesRecurring price (amount minor units, interval day|week|month|year)
POST /subscriptionsCreate subscription; returns payment_url for first invoice
POST /subscriptions/checkoutCreate a subscription and return a checkout URL
POST /subscriptions/:id/cancel|pause|resumeCancel, pause, or resume a subscription
GET /subscriptions/portalCustomer portal (subscription_id + email or phone)
Shell
const res = await fetch("https://api.paysasa.com/api/v1/subscriptions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "apk_live_…",
},
body: JSON.stringify({
business_id: "biz_…",
customer_id: "cust_…",
items: [{ price: "price_…", quantity: 1 }],
collection_method: "send_invoice",
trial_days: 0,
}),
});
const { subscription, payment_url } = await res.json();

Related webhooks include subscription.created, subscription.updated, subscription.canceled, customer.created, invoice.created, and invoice.paid. Configure endpoints under your business webhook settings.