This monorepo contains two packages for synchronizing your Stripe account with a Postgres database:
@supabase/stripe-sync-engine: A TypeScript library for syncing Stripe data to Postgres, designed for integration into your own Node.js backend or serverless environment.stripe-sync-fastify: A Fastify-based server and Docker image that exposes a/webhooksendpoint for Stripe, providing a ready-to-run service for real-time Stripe-to-Postgres sync.
Sometimes you want to analyze your billing data using SQL. Even more importantly, you want to join your billing data to your product/business data.
This project synchronizes your Stripe account to a Postgres database. It can be a new database, or an existing Postgres database.
- Creates a new schema
stripein a Postgres database, with tables & columns matching Stripe. - Exposes a
/webhooksendpoint that listens to any Stripe webhooks (via the Fastify app). - Inserts/updates/deletes changes into the tables whenever there is a change to Stripe.
Each package has its own README with installation, configuration, and usage instructions.
To deploy the sync-engine to a Supabase edge function, follow this guide.
-
balance.available -
charge.captured🟢 -
charge.expired🟢 -
charge.failed🟢 -
charge.pending🟢 -
charge.refunded🟢 -
charge.refund.updated🟡 - For updates on all refunds, listen torefund.updatedinstead -
charge.succeeded🟢 -
charge.updated🟢 -
charge.dispute.closed🟢 -
charge.dispute.created🟢 -
charge.dispute.funds_reinstated🟢 -
charge.dispute.funds_withdrawn🟢 -
charge.dispute.updated🟢 -
checkout.session.async_payment_failed -
checkout.session.async_payment_succeeded -
checkout.session.completed -
credit_note.created🟢 -
credit_note.updated🟢 -
credit_note.voided🟢 -
customer.created🟢 -
customer.deleted🟢 -
customer.source.created -
customer.source.updated -
customer.subscription.created🟢 -
customer.subscription.deleted🟢 -
customer.subscription.paused🟢 -
customer.subscription.pending_update_applied🟢 -
customer.subscription.pending_update_expired🟢 -
customer.subscription.resumed🟢 -
customer.subscription.trial_will_end🟢 -
customer.subscription.updated🟢 -
customer.tax_id.created🟢 -
customer.tax_id.deleted🟢 -
customer.tax_id.updated🟢 -
customer.updated🟢 -
invoice.created🟢 -
invoice.deleted🟢 -
invoice.finalized🟢 -
invoice.finalization_failed🟢 -
invoice.marked_uncollectible🟢 -
invoice.paid🟢 -
invoice.payment_action_required🟢 -
invoice.payment_failed🟢 -
invoice.payment_succeeded🟢 -
invoice.sent🟢 -
invoice.upcoming🔴 - Event has no id and cannot be processed -
invoice.updated🟢 -
invoice.overdue🟢 -
invoice.overpaid🟢 -
invoice.will_be_due🟢 -
invoice.voided🟢 -
issuing_authorization.request -
issuing_card.created -
issuing_cardholder.created -
payment_intent.amount_capturable_updated🟢 -
payment_intent.canceled🟢 -
payment_intent.created🟢 -
payment_intent.partially_refunded🟢 -
payment_intent.payment_failed🟢 -
payment_intent.processing🟢 -
payment_intent.requires_action🟢 -
payment_intent.succeeded🟢 -
payment_method.attached🟢 -
payment_method.automatically_updated🟢 -
payment_method.detached🟢 -
payment_method.updated🟢 -
plan.created🟢 -
plan.deleted🟢 -
plan.updated🟢 -
price.created🟢 -
price.deleted🟢 -
price.updated🟢 -
product.created🟢 -
product.deleted🟢 -
product.updated🟢 -
radar.early_fraud_warning.created🟢 -
radar.early_fraud_warning.updated🟢 -
refund.created🟢 -
refund.failed🟢 -
refund.updated🟢 -
review.opened🟢 -
review.closed🟢 -
setup_intent.canceled🟢 -
setup_intent.created🟢 -
setup_intent.requires_action🟢 -
setup_intent.setup_failed🟢 -
setup_intent.succeeded🟢 -
subscription_schedule.aborted🟢 -
subscription_schedule.canceled🟢 -
subscription_schedule.completed🟢 -
subscription_schedule.created🟢 -
subscription_schedule.expiring🟢 -
subscription_schedule.released🟢 -
subscription_schedule.updated🟢

