> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mantrixflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stripe to PostgreSQL

> Build a Stripe pipeline with discovery, a stable SQL model, and PostgreSQL Upsert delivery.

This example delivers the Stripe `account` stream into
`analytics.stripe_account`. The same workflow applies to the other supported
streams.

## 1. Create the connections

1. Create a **Stripe Source** connection with a secret or restricted read key.
2. Test and save the connection.
3. Create a **PostgreSQL Destination** connection.
4. Test and save the destination.

## 2. Discover the Stripe catalog

1. Create a pipeline with the Stripe source.
2. Open **Source** and click **Discover catalog**.
3. Enable `account`.
4. Preview the stream, review its typed fields, and click **Save stream settings**.

For broader coverage, select additional streams after preparing one model and
destination table for each delivered output. Valid empty streams are successful
and do not require fabricated sample records.

## 3. Prepare the destination

Open **Destinations**, add the PostgreSQL connection, and save it. After the SQL
revision is published, open this destination's **Published output targets**,
enter `analytics.stripe_account`, use the stable account identifier as its
Upsert key, and use the explicit table setup action when needed.

The final table must exist before the run starts.

## 4. Add and publish a stable model

Open **Transformations**, select the PostgreSQL destination, create a
transformation using `stripe.account` as input, and use:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
  id,
  object,
  created,
  created_at,
  metadata,
  source_stream,
  stripe_account_id
FROM {{ source('raw', 'stripe__account') }}
```

Prefer explicit columns over `SELECT *`; Stripe responses can include optional
fields that are not part of your destination contract.

## 5. Validate and run

1. Set the final table to `analytics.stripe_account`.
2. Set the Upsert key.
3. **Save draft**, **Validate draft**, and **Preview output**.
4. **Publish revision**.
5. Validate the pipeline from **Overview**.
6. Click **Run all**.
7. Confirm success, rows written, revision, and target in **Runs**.

## 6. Expand to more streams

Repeat the destination/model setup for every additional stream you intend to
deliver. Streams with a `created` cursor can use Incremental sync after a
successful first run. Cursorless streams remain Full Table.

See [Stripe source](/connections/sources/finance/stripe) for the complete
34-stream inventory and current limitations.
