Sync your Stripe account to you Postgres database.
APACHE-2.0 License
Continuously synchronizes a Stripe account to a Postgres database.
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 server synchronizes your Stripe account to a Postgres database. It can be a new database, or an existing Postgres database.
stripe
in a Postgres database, with tables & columns matching Stripe./webhooks
endpoint that listens to any Stripe webhooks.Not implemented
balance.available
charge.captured
π’charge.expired
π’charge.failed
π’charge.pending
π’charge.refunded
π’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
π’invoice.updated
π’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
π’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
π’mv .env.sample .env
and then rename all the variablesstripe
. eg: DATABASE_URL=postgres://postgres:postgres@hostname:5432/postgres?sslmode=disable&search_path=stripe
8080
docker run -e PORT=8080 --env-file .env supabase/stripe-sync-engine
POST /sync
body: {
"object": "product",
"created": {
"gte": 1643872333
}
}
object
all | charge | customer | dispute | invoice | payment_method | payment_intent | plan | price | product | setup_intent | subscription
created
is Stripe.RangeQueryParam. It supports gt, gte, lt, lte
daily/weekly/monthly
dataPOST /sync/daily
---
POST /sync/daily
body: {
"object": "product"
}
To backfill/update a single entity, you can use
POST /sync/single/cus_12345
The entity type is recognized automatically, based on the prefix.
POST
a CSV to an endpoint).Set up
mv .env.sample .env
and then rename all the variablesDevelop
npm run dev
to start the local servernpm run test
to run testsBuilding Docker
docker build -t stripe-sync-engine .
docker run -p 8080:8080 stripe-sync-engine
Release
Handled by GitHub actions whenever their is a commit to the main
branch with fix
or feat
in the description.
Apache 2.0
Supabase is building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products donβt exist we build them and open source them ourselves.