Retention
Ask why customers cancel and make an offer, let them pause or switch plans, invite them back, and remind them before renewals.
What it does
Retention keeps web subscribers longer. It works on the customer’s subscription page (the manage link) with no code, and through the API for apps with their own screens. Set it up in the dashboard under Sell → Retention, or with POST /v1/retention.
| Feature | What happens |
|---|---|
| Cancel flow | The customer says why they're canceling, then sees your offer: a discount for some renewals, or a pause. If they say no, it cancels at the end of their period. |
| Pausing | No charges and no access while paused. It starts again on its own. |
| Plan switching | Customers move between the plans you pick. Upgrades start now; downgrades at the next renewal. |
| Win-back | Days after a subscription ends, Munim emails a discount to come back. The link opens a checkout with it. |
| Reminders | Emails before an annual renewal and before a free trial ends. |
| Cancel reasons | Why customers cancel, and how often each offer kept them. |
Settings
curl https://billing-sandbox-api.munimtech.com/v1/retention \
-H "Authorization: Bearer $MUNIM_BILLING_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"cancel_flow": { "offer": { "type": "discount", "percent_off": 30, "periods": 3 } },
"plan_switching": { "price_ids": ["pri_monthly", "pri_yearly"] },
"winback": { "enabled": true, "days_after": 14, "percent_off": 25, "periods": 3 }
}'await munim.retention.update({
cancel_flow: { offer: { type: 'discount', percent_off: 30, periods: 3 } },
plan_switching: { price_ids: ['pri_monthly', 'pri_yearly'] },
winback: { enabled: true, days_after: 14, percent_off: 25, periods: 3 },
})Send any part; the rest stays. These are the defaults:
cancel_flow.ask_reasonboolean- Ask why before canceling. Default true.
cancel_flow.offerobject | null- { type: "discount", percent_off: 1–90, periods: 1–24 } or { type: "pause", months: 1–3 }. Default none.
cancel_flow.product_offersarray- A different offer (or
nullfor none) for one product: [{ product_id, offer }]. pause.customer_can_pauseboolean- Customers can pause from their page. Default true.
pause.max_monthsinteger- Longest pause a customer can pick, 1–3. Default 3.
plan_switching.price_idsstring[]- Prices customers can switch to. They only see other prices of the product they have. Default none.
winbackobject- enabled (default false), days_after 1–180 (14), percent_off 1–90 (25), periods 1–24 (3).
reminders.renewalobject- enabled (default false), days_before 3, 7, 14 or 30 (7), plans yearly or all (yearly).
reminders.trialobject- enabled (default false), days_before 1, 2, 3, 5 or 7 (3).
The cancel flow
On the manage page, Cancel asks for a reason (the six in reasons, plus an optional comment), then shows your offer. A discount comes off the next renewals; it doesn’t change what they already paid. A pause starts when the time they paid for ends. Each answer is saved, as saved or canceled.
An offer only shows when it can apply: not to a subscription that already has a discount, is paused, or is set to cancel.
With your own cancel screen, ask Munim for the offer, then apply it or cancel with the reason:
// 1. When the customer taps Cancel, ask Munim what to offer
const { offer, reasons } = await munim.subscriptions.retentionOffer('sub_…')
// 2a. They took it
await munim.subscriptions.acceptRetentionOffer('sub_…', { reason: 'too_expensive' })
// 2b. They didn't: cancel at period end, with their reason
await munim.subscriptions.cancel('sub_…', { reason: 'too_expensive', comment: 'Too much for me' })| Processor | A discount | A pause |
|---|---|---|
| Card (Stripe) | A coupon on the subscription | Collection paused; invoices while paused are voided |
| PayPal | This subscription's price lowered, then put back | The subscription suspended, then activated |
| Venmo | Munim charges less at renewal | Munim stops charging |
Pause and resume
await munim.subscriptions.pause('sub_…', { months: 2 }) // from the end of the paid period
await munim.subscriptions.pause('sub_…', { when: 'now', resumes_at: '2027-03-01' })
await munim.subscriptions.resume('sub_…')A pause lasts 1–12 months through the API (customers pick up to pause.max_months). While it runs, status is paused and entitlements are off. pause on the subscription shows starts_at and resumes_at. Resuming early starts a new period, charged that day. Resuming before the pause starts just drops it.
Switch plans
const sub = await munim.subscriptions.change('sub_…', { price_id: 'pri_yearly' })
// sub.pending_change: { price_id, effective_at, approve_url } until it takes effect| Processor | Upgrade | Downgrade |
|---|---|---|
| Card (Stripe) | Now. The difference for the rest of the period is charged at once, as a normal payment. | At the next renewal. |
| PayPal | At the next billing date, after the customer approves it on PayPal (pending_change.approve_url). | The same. |
| Venmo | At the next renewal. | At the next renewal. |
Pass when: "now" or "period_end" to choose. A switch waiting to happen shows in pending_change; changing to the current price drops it. Only prices of the same product, in the same currency, can be picked.
Win-back offers
With win-back on, Munim emails the customer days_after days after their subscription ends, unless they’re already back. The link opens a checkout for the same price with percent_off off the first periods payments, and works for 30 days. Customers can unsubscribe in one click, and then get no more offers from you. Replies go to your support email. A win-back checkout never repeats a free trial, and Munim’s fee is on the list price, not the discounted one.
GET /v1/winback_offers lists what was sent, with sent, redeemed and unsubscribed totals for the last 90 days.
Reminder emails
Reminders start off. Turn them on under reminders and Munim emails customers before a renewal (yearly plans only, unless you pick all) and before a free trial ends, with the date, the amount and a link to their subscription page. Each period gets one reminder. Emails come from “your name via Munim”, and replies go to you.
Cancel reasons
const summary = await munim.retention.feedback({ days: 30 })
// summary.totals: { responses, saved, canceled, save_rate }
// summary.reasons: [{ reason: 'too_expensive', label, count, saved, canceled }, …]GET /v1/retention/feedback?days=90 gives counts per reason, how often each kind of offer was shown and kept the customer, a daily series, and the latest answers with comments. Filter with project_id.
Events
| Event | When |
|---|---|
subscription.paused | A pause started. |
subscription.resumed | A pause ended. |
subscription.updated | A pause was scheduled or dropped, a plan switch was asked for or landed, or a discount was applied. |
subscription.retention_offer_accepted | The customer took the offer. The subscription, plus retention_offer and feedback_id. |
subscription.cancellation_feedback | A reason was answered: saved or canceled. |
winback.sent | A win-back offer was emailed. |