Stripe Data Pipeline syncs to Neon Postgres for webhook-free billing apps
Brief
Stripe Data Pipeline now supports real-time sync to Postgres, with Neon as a supported destination. Neon built two example apps and a debugging workflow that avoid Stripe webhooks entirely.
Sync and example apps
- Stripe Data Pipeline streams every list-endpoint object, including charges, customers, prices, invoices and subscriptions, into regular Postgres tables within seconds.
- Neon built Headshot Studio and Bouncer; both apply a 100% discount at checkout for demo purposes.
- Apps create Checkout Sessions, attach user and credit metadata, and poll Postgres until synced charges appear; prices and promotion codes are looked up by key or code rather than hardcoded IDs.
Webhook-free billing
- No Stripe webhooks: apps write to Stripe through its API and read all Stripe objects from synced stripe.* tables.
- Balances are SQL views of synced purchases minus app usage; refunds update via amount_refunded and disputed charges are excluded.
- The view prevents double-crediting because no write adds credits; failed jobs do not count as spent.
Debugging with Neon branches
- Neon branches are created in seconds, share storage with the parent and can be created from a past point in time.
- A branch includes Postgres data such as neon_auth users and synced stripe rows, Object Storage files, and copied but disabled triggers.
- The workflow is to locate a failed job, query logs, branch at the failure time, reproduce with neon dev, fix, deploy and delete the branch.
Testing and building
- On a debug branch, update stripe.charges amount_refunded or disputed to test balance behavior without Stripe.
- Builders are advised to use no webhooks, compute balances as views, look up prices and codes, declare the backend in neon.ts, provision with neon deploy and index synced Stripe tables.
Generated by AI from the original article. Check the source for full details.