Build it on Stripe webhooks rather than polling. Listen for subscription and invoice events, record each event ID so nothing is applied twice, and write status, plan and MRR to the CRM record. A sync that handles failed payments, upgrades and cancellations takes 2–4 weeks and costs $3,000–$6,000 at Smplfy’s rates.
How do I build a Stripe subscription billing sync that handles failed payments, upgrades and cancellations in my CRM?
Which Stripe events map to which CRM updates
Every billing change in Stripe produces an event. The sync’s job is to turn a small set of those events into field updates on the right CRM record. Stripe’s billing documentation lists the full set of subscription events; these are the ones that matter for a CRM.
| Business event | Stripe event | What the CRM should do |
|---|---|---|
| New subscriber | customer.subscription.created |
Set plan, status active or trialing, start date, MRR |
| Successful renewal | invoice.paid |
Update last paid date and lifetime revenue; clear any dunning flag |
| Failed payment | invoice.payment_failed |
Set status past_due, record attempt count, open a task for the account owner |
| Card needs authentication | invoice.payment_action_required |
Flag the record and trigger a customer email with the payment link |
| Upgrade or downgrade | customer.subscription.updated |
Change plan and MRR; log old and new values for expansion reporting |
| Cancellation scheduled | customer.subscription.updated with cancel_at_period_end |
Set churn-risk flag and the end date; do not mark churned yet |
| Cancellation effective | customer.subscription.deleted |
Set status canceled, churn date, MRR to zero |
Note the two-step cancellation. Most customers cancel at the end of the period, so the record should show scheduled to cancel for weeks before it shows churned. Collapsing those into one event is the most common reporting error we see.
How the sync works, step by step
- A small webhook endpoint receives the event and verifies the
Stripe-Signatureheader. Unsigned or invalid requests are rejected. - The endpoint stores the raw event and its ID in a table, returns a 200 within a few seconds, and does nothing else. Slow endpoints cause Stripe to retry.
- A worker picks up the stored event, checks whether that event ID was already processed, and skips it if so.
- The worker fetches the current subscription from the Stripe API instead of trusting the event body, because events can arrive out of order.
- It finds the CRM record by the Stripe customer ID stored on the company or contact, and writes the mapped fields.
- On failure it retries with backoff; after a set number of attempts it moves the event to an error queue and alerts a person.
Worked example: Stripe to HubSpot
A customer on a $99 monthly plan upgrades to $199. Stripe sends customer.subscription.updated and, because of proration, an invoice for the difference. The worker fetches the subscription, sees the new price, sets the HubSpot company property plan to the new tier, changes mrr from 99 to 199, and writes a timeline note with both values.
Next month the card is declined. invoice.payment_failed arrives, the company’s billing_status becomes past_due, and the account owner gets a HubSpot task. Stripe’s own retry schedule keeps trying the card; when a retry succeeds, invoice.paid clears the flag and closes the task automatically.
What breaks that most teams do not plan for
- Out-of-order events. An
updatedevent can land beforecreated. Fetching current state from Stripe fixes this. - Duplicate deliveries. Stripe can send the same event more than once. Without an event-ID check, revenue gets counted twice.
- Missing CRM records. A customer who signed up through checkout may have no CRM contact yet. The sync needs a rule: create one, or hold the event until a match exists.
- Downtime. Stripe retries failed deliveries for up to three days in live mode. Longer outages need a nightly reconciliation job that compares Stripe and the CRM.
- Rate limits. HubSpot and Salesforce cap API calls per interval. A bulk price change can fire hundreds of events at once; the worker must queue and throttle.
- Field changes upstream. Someone renames a CRM property or adds a new Stripe price. Map prices through a lookup table, not hard-coded IDs, and alert on unknown values.
- Multiple subscriptions per customer. Decide up front whether MRR rolls up to the company or lives on a separate subscription object.
Your options compared
| Option | Upfront cost | Monthly cost | Who maintains it | What breaks first |
|---|---|---|---|---|
| Zapier or Make recipe | $0–$1,000 of your time | $20–$100 in task fees | You | Duplicates and out-of-order events; no reconciliation |
| Marketplace connector (CRM’s Stripe app) | Low | Often included or per-seat | The vendor | Fixed field mapping; cancellations and dunning often not modeled the way you report |
| Custom integration in code | $3,000–$6,000 (Smplfy) | $10–$50 hosting | Your developer or us | Usually nothing for months; new pricing models need mapping updates |
| Full billing-ops platform | $10,000+ per year | Subscription fee | The vendor | Cost, and a second source of truth to keep aligned |
Zapier, Make and platform prices are general market ranges; check each vendor’s current plans.
What a custom build costs and how long it takes
Using Smplfy’s figure of $85 an hour, a typical breakdown looks like this. The low end is one CRM, one subscription per customer and clean customer IDs; the high end adds backfilling historical data, multiple subscriptions per account and a reconciliation report.
| Work | Hours | Cost at $85/hr |
|---|---|---|
| Event mapping and field design | 6–10 | $510–$850 |
| Webhook endpoint, queue, idempotency | 10–16 | $850–$1,360 |
| CRM writes, matching and rate-limit handling | 12–20 | $1,020–$1,700 |
| Nightly reconciliation and alerts | 6–14 | $510–$1,190 |
| Backfill, testing in Stripe test mode, runbook | 6–10 | $510–$850 |
| Total | 40–70 | $3,400–$5,950 |
Calendar time is two to four weeks, mostly waiting on access and on agreement about what counts as churn. We built a Stripe-to-Salesforce and Google Sheets finance sync on this pattern that has run for two years with minimal maintenance.
When to build, buy or wait
- Use a marketplace connector if you have one plan per customer, few failed payments, and you only need billing status visible to sales.
- Use Zapier or Make if you have under 100 subscribers and someone checks the CRM against Stripe monthly.
- Build custom when finance reports MRR or churn from the CRM, when sales or success acts on failed payments, or when a duplicate or missed event costs real money.
- Do nothing yet if Stripe’s own dashboard and dunning emails already cover it and nobody works from billing data in the CRM. Do not hire anyone for that.
Frequently asked questions
Should I poll the Stripe API or use webhooks for a CRM sync?
Use webhooks for real-time updates and add a nightly reconciliation job that polls as a safety net. Webhooks alone can miss events during long outages, and polling alone is slow and burns API calls. The combination is what keeps the CRM accurate for months without attention.
How do I stop duplicate updates when Stripe sends the same webhook twice?
Store every Stripe event ID in a table and skip any ID already processed. Also make each CRM write idempotent, meaning it sets a value rather than adding to one. That way a repeated event changes nothing.
How should failed payments show up in HubSpot or Salesforce?
Set a billing status such as past_due on the company or account, record the attempt count, and create a task for the owner. When a Stripe retry succeeds, the invoice.paid event should clear the status and close the task automatically.
How do I track upgrades and downgrades for expansion revenue?
On each customer.subscription.updated event, compare the old and new price and write both to a log or timeline note on the CRM record. Store MRR as a field that the sync overwrites, and keep the change history separately so reports can show expansion and contraction.
How much does a custom Stripe-to-CRM subscription sync cost?
At Smplfy’s $85 an hour, a sync covering new subscriptions, failed payments, plan changes and cancellations is typically 40–70 hours, or $3,400–$5,950. Backfilling history, multiple subscriptions per customer and a reconciliation report move it toward the top. Hosting usually runs $10–$50 a month.
Related answers
Want a scoped estimate for your Stripe and CRM setup?
We’ll send a free written scope or take a 20-minute call. Have ready which CRM you use, roughly how many active subscriptions you have, and what your team updates by hand today. Start a conversation.