Skip to main content
Stripe → PostgreSQL

Sync Stripe to PostgreSQL
on the schedule you set.

Pipe Stripe charges, customers, subscriptions, invoices, and events into PostgreSQL — described in plain English. Scheduled batch on the cadence you set, idempotent by Stripe ID. The Stripe connector is in preview on rsync.ai Cloud; self-hosting (ELv2) is coming soon.

TL;DR

rsync.ai's Stripe MCP connector calls the REST API (paginated with `starting_after` cursor) for Events, Charges, Customers, Subscriptions, Invoices, and PaymentIntents. It runs on the schedule you set — paging through new and changed records and upserting them by Stripe ID, so every run is fully idempotent. Stripe metadata lands in JSONB. Works with PostgreSQL 12+, RDS, Aurora, Cloud SQL, Supabase, and Neon.

  • Scheduled batch with cursor pagination — idempotent, no gaps
  • Idempotent upserts by Stripe ID — safe to re-run
  • Stripe metadata stored as JSONB with GIN index
  • PII column masking at extraction time
  • Self-host in your own VPC — coming soon (source-available, ELv2)
How it works

How to sync Stripe to PostgreSQL — 5 steps

From restricted API key to rows in PostgreSQL — under 10 minutes.

  1. 1

    Generate a Stripe restricted API key

    In the Stripe Dashboard, go to Developers → API keys → Create restricted key. Grant read-only access to: Charges, Customers, Subscriptions, Invoices, PaymentIntents, and Events. A restricted key limits the blast radius if credentials are ever leaked. Copy the `rk_live_…` key — rsync.ai never uses your secret key.

    rk_live_… (restricted, read-only)
  2. 2

    Connect your PostgreSQL database

    Provide host, port, user, password, and database name — or paste a connection string. rsync.ai supports PostgreSQL 12+, Amazon RDS for PostgreSQL, Amazon Aurora PostgreSQL, Google Cloud SQL for PostgreSQL, Azure Database for PostgreSQL, Supabase, and Neon. SSL mode `require` is the default.

    postgresql://user:pass@host:5432/db
  3. 3

    Describe the sync in plain English

    Type what you want: 'Sync Stripe charges, customers, subscriptions to PostgreSQL every 5 minutes.' rsync.ai discovers the Stripe resources you've granted access to, estimates record counts, and proposes PostgreSQL tables with the right column types — `BIGINT` for Stripe amounts (cents), `TIMESTAMPTZ` for Unix timestamps, `JSONB` for metadata and nested objects.

    No SQL · No YAML · No DAGs
  4. 4

    rsync.ai discovers resources and proposes schema

    rsync.ai calls the Stripe API list endpoints (paginated via `starting_after` cursor) to sample your data, infers column types, and generates a `CREATE TABLE` statement for each resource. Stripe metadata fields (arbitrary key-value pairs) land in a `metadata JSONB` column. Nested objects like `payment_method_details` are stored as JSONB by default, with optional column-extraction for common fields.

    Auto type inference · JSONB for metadata
  5. 5

    Approve schema and pipeline runs on schedule

    Review and approve the proposed PostgreSQL DDL. The pipeline runs on the cadence you set. rsync.ai uses scheduled batch sync with cursor pagination: on each run it pages through the Stripe REST API (via the `starting_after` cursor) to pull new and changed records. Rows are upserted by Stripe ID on every run, so retries are always idempotent.

    Scheduled batch with cursor pagination · idempotent upserts

Stripe → PostgreSQL schema mapping

Standard mapping rsync.ai proposes. Customize column names, types, JSONB extraction, and PII masking before approving.

Stripe resourcePostgreSQL tableNotes
Customercustomersemail, name, phone stored; PII columns flagged for optional masking.
Chargechargesamount in cents (BIGINT), currency, status, failure_code, payment_method_details (JSONB).
PaymentIntentpayment_intentsamount, currency, status, last_payment_error (JSONB), metadata (JSONB).
Subscriptionsubscriptionscurrent_period_start/end as TIMESTAMPTZ, items (JSONB), discount (JSONB).
Invoiceinvoicesamount_due, amount_paid, lines (JSONB), hosted_invoice_url.
Eventstripe_eventsFull event envelope stored for audit trail — type, created, data.object (JSONB).

rsync.ai vs. Fivetran, Airbyte, Zapier for Stripe → PostgreSQL

What you give up — and gain — choosing rsync.ai.

Featurersync.aiyouFivetranAirbyteZapier
Plain-English pipeline setup
Scheduled batch with cursor pagination
Scheduled Stripe → PostgreSQL sync
Source-available connector code (coming soon)
Stripe metadata stored as JSONB
Self-host in your own VPC (coming soon)
No per-MAR / per-row / per-task pricing
PII column masking at extraction time

Stripe to PostgreSQL — frequently asked

How does rsync.ai stay within Stripe API rate limits?

The Stripe REST API allows up to 100 list requests per second in live mode. rsync.ai paginates with `starting_after` cursor (up to 100 objects per page) and respects HTTP 429 responses with exponential backoff. For most use cases — a few hundred thousand Stripe objects synced every 5 minutes — you'll be well within limits. For very large accounts (millions of charges), rsync.ai schedules incremental syncs using `created` or `updated` filters to fetch only new/changed records.

How does rsync.ai guarantee idempotency when syncing Stripe data?

Every Stripe object has a globally unique string ID (e.g. `ch_3OxY…`, `cus_9MZ…`). rsync.ai uses these as the PostgreSQL primary key and performs `INSERT … ON CONFLICT (id) DO UPDATE SET …` on every sync run. This means re-running the same sync — or retrying after a failure — never creates duplicate rows. The `stripe_events` table additionally stores the full Stripe event envelope, deduped by event ID.

How fresh is the synced Stripe data?

rsync.ai runs on the schedule you set — as frequently as every minute or as slow as daily. On each run it pages through the Stripe REST API with the `starting_after` cursor and upserts by Stripe ID, so a 1–5 minute cadence keeps PostgreSQL close to real-time for state changes like a charge failing or a subscription cancelling. Every run is idempotent, so nothing is missed or duplicated.

How does rsync.ai handle Stripe metadata in PostgreSQL?

Stripe's metadata field is an arbitrary key-value map (up to 50 keys, 500 chars per value). rsync.ai stores it as a `JSONB` column on each table, enabling rich querying with PostgreSQL's `->` and `->>` operators and GIN indexes. If you have consistent metadata keys across objects (e.g. `metadata->>'internal_id'`), you can add a generated column or a partial index in the DDL approval step.

Is syncing Stripe data to PostgreSQL PCI compliant?

rsync.ai never handles raw card numbers or CVVs — Stripe tokenizes these at the source and they are never present in the API responses rsync.ai reads. The data that does flow (amounts, last-4 digits, card brand, billing address) is sensitive but not restricted card data under PCI DSS. When self-hosting ships, running rsync.ai in your own VPC will mean Stripe data never transits a third-party service. For full PCI scope assessment, consult your QSA.

Can I exclude customer PII from the PostgreSQL sync?

Yes. In the column configuration step you can mark any column as excluded (never fetched) or masked (hashed or format-preserving mask applied before the value is written to PostgreSQL). Common PII fields — `email`, `phone`, `name`, `address` on the Customer object — are automatically flagged for your review. Exclusions are applied at the API response parsing layer, so the value never enters any rsync.ai buffer.

Can I run rsync.ai on my own infrastructure?

rsync.ai Cloud is live today at app.rsync.ai — nothing to deploy. Self-hosting is coming soon: you'll run the full stack via `docker compose up` inside your own VPC — the Stripe MCP connector, the PostgreSQL writer, the control plane, and the chat UI all in your environment — so your Stripe restricted API key and PostgreSQL credentials never leave your network. License is Elastic License 2.0: free to self-host; reselling as a managed service requires a commercial license.

How does rsync.ai pricing compare to Fivetran or Zapier for Stripe → PostgreSQL?

Fivetran charges per Monthly Active Row — for a SaaS business with thousands of subscriptions and charges changing daily, costs can reach hundreds of dollars per month. Zapier's per-task pricing scales poorly for bulk historical syncs. rsync.ai Cloud is live today at app.rsync.ai with no per-row, per-task, or per-connector fees. Soon you can also self-host the source-available code and pay only for the compute you run it on; a 2-core / 4 GB VM handles most Stripe → PostgreSQL pipelines comfortably.