# Codeless Sync (/docs/guides/integrations/codeless-sync) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Copy Stripe, QuickBooks, Xero, or Paddle billing data into Prisma Postgres tables and keep them up to date on a schedule Location: Guides > Integrations > Codeless Sync ## Introduction [#introduction] In this guide you connect [Codeless Sync](https://codelesssync.com) to a Prisma Postgres database, copy your Stripe customers into a `stripe_customers` table, and count the rows with `psql`. Once the billing data is in your own database, you can query it with any Postgres client, and join it with your app's tables when both live in the same database. QuickBooks, Xero, and Paddle follow the same steps. Paddle uses its own API key in step 3, while QuickBooks and Xero connect with OAuth instead. ## Prerequisites [#prerequisites] - A [Prisma Data Platform](https://console.prisma.io/?utm_source=docs\&utm_medium=content\&utm_content=guides) account - A [Codeless Sync](https://codelesssync.com) account. The free plan covers manual syncs of up to 1,000 rows a month, which is enough for this guide. - A [Stripe](https://dashboard.stripe.com) account. Test mode data works. - [`psql`](https://www.postgresql.org/download/) installed, to check the rows in step 6 ## 1. Create a Prisma Postgres database [#1-create-a-prisma-postgres-database] Create a database to hold the billing tables. If you already use Prisma Postgres for an app that manages its schema with Prisma ORM migrations, create a separate database, because Codeless Sync creates its tables outside your migrations. 1. Sign in to the [Prisma Console](https://console.prisma.io/?utm_source=docs\&utm_medium=content\&utm_content=guides) and create a new database. 2. Give it a name and choose a region. You can't change the region afterwards. ## 2. Copy the pooled connection string [#2-copy-the-pooled-connection-string] Open the database in the Console, click **Connect to your database**, and then click **Generate new connection string**. Copy the pooled connection string. It uses the `pooled.db.prisma.io` host: ```bash postgres://USER:PASSWORD@pooled.db.prisma.io:5432/postgres?sslmode=require ``` The pooled string is the one Prisma [recommends for application traffic](https://www.prisma.io/docs/postgres/database/connection-pooling), including background workers such as a scheduled sync. Keep the direct string (`db.prisma.io`) for `psql`, migrations, and `pg_dump`, which you use in step 6. Each time you generate a string, Prisma creates a new credential and keeps the old ones working. Generate one just for Codeless Sync, so you can delete it later without breaking your other apps. ## 3. Create a restricted Stripe key [#3-create-a-restricted-stripe-key] Codeless Sync only reads from Stripe, so give it a key that can only read. In the Stripe Dashboard, go to **Developers** > **API keys** and create a restricted key with **Read** access to **Customers**. Restricted keys start with `rk_test_` or `rk_live_`. ## 4. Connect Prisma Postgres to Codeless Sync [#4-connect-prisma-postgres-to-codeless-sync] Create a sync configuration that points at your database: 1. In Codeless Sync, start a new sync configuration and choose **Stripe** with the **Customers** data type. 2. On the database step, name the project, choose **Prisma Postgres** as the platform, paste the pooled connection string, and click **Test & Continue**. 3. Paste the restricted Stripe key and click **Connect**. 4. Click **Auto-create Table**. Codeless Sync creates a `stripe_customers` table in your Prisma Postgres database. 5. Name the configuration and click **Create Sync Configuration**. ![The Codeless Sync database step with Prisma Postgres selected as the platform](https://www.prisma.io/img/guides/codeless-sync/database-step.png) If you see `Database authentication failed - check username and password`, part of the password was not copied. Generate a new connection string in the Console and paste it again. ## 5. Run the first sync [#5-run-the-first-sync] Open the configuration and click **Sync Now**. The run page shows the rows processed as each batch is written. ![A completed Codeless Sync run showing 117 rows processed](https://www.prisma.io/img/guides/codeless-sync/first-sync.png) ## 6. Check the rows in Prisma Postgres [#6-check-the-rows-in-prisma-postgres] Connect with `psql` using the direct connection string from the Console, then count the rows: ```bash psql "postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require" ``` ```sql SELECT count(*) FROM stripe_customers; ``` ```text no-copy count ------- 117 (1 row) ``` The count matches the rows processed on the run page, 117 in this test account. To browse the table without `psql`, see [Viewing data](https://www.prisma.io/docs/guides/postgres/viewing-data). ## 7. Put the sync on a schedule [#7-put-the-sync-on-a-schedule] A manual sync is enough to try it out. To keep the table current, open the configuration and add a schedule. Schedules need a paid Codeless Sync plan and run daily, weekly, or monthly, plus every 12 hours on the Business plan. ## How many operations a sync uses [#how-many-operations-a-sync-uses] Prisma Postgres bills [per operation](https://www.prisma.io/docs/postgres/faq), and each SQL statement counts as one operation. Codeless Sync writes one multi-row `INSERT ... ON CONFLICT DO UPDATE` statement per page of records, and most data types use pages of 100 rows. A sync therefore costs about one operation per 100 rows, plus a small fixed overhead for setup queries such as checking the table exists. If a whole batch fails, Codeless Sync retries its records one at a time, so that batch costs one operation per record. On a new database, the 117-row sync in this guide showed 13 operations in the Console that day. Two of them were the batched writes. The rest came from the connection test, creating the table, the schema checks, and the `psql` count in step 6. To see your own count, open the database's dashboard in the Console and hover over the daily bars in the usage chart. ## Common gotchas [#common-gotchas] - **Free plan out of operations**: when a Free plan database uses all of its operations, Prisma Postgres stops accepting reads and writes until the next month or until you upgrade, so syncs fail too. Paid plans charge for extra operations instead. See the [Prisma Postgres FAQ](https://www.prisma.io/docs/postgres/faq). - **No read-only credentials**: a Prisma Postgres credential has full access to its database. Codeless Sync creates and writes tables with `stripe_`, `quickbooks_`, `xero_`, and `paddle_` prefixes, but you can't limit the credential to them, which is another reason to give billing data its own database. ## Use with your agent [#use-with-your-agent] The steps in Codeless Sync and the Stripe Dashboard happen in a browser. Once the first sync has run, a coding agent can take over the query side. Copy the prompt below and hand it over: ```text My Prisma Postgres database has a stripe_customers table that Codeless Sync keeps up to date, following https://www.prisma.io/docs/guides/integrations/codeless-sync.md. 1. Ask me for the direct connection string (db.prisma.io) and store it as BILLING_DATABASE_URL in .env. Do not commit it. 2. Run `psql "$BILLING_DATABASE_URL" -c "SELECT count(*) FROM stripe_customers;"` and show me the count. 3. Run a query with psql that lists the 10 most recently created customers (the `created` column), and show me the result. ``` Run [`npx prisma@latest init`](https://www.prisma.io/docs/cli/init) once to install the [Prisma ORM skills](https://www.prisma.io/docs/ai/tools/skills) for your coding agent. Prompts that map to this guide: - "Show me how many Stripe customers signed up each month from the stripe_customers table." - "List the Stripe customers created in the last 30 days from stripe_customers, newest first." ## Next steps [#next-steps] - [Add Prisma ORM to an existing PostgreSQL database](https://www.prisma.io/docs/prisma-orm/add-to-existing-project/postgresql) to query the synced tables with typed queries. - [Connection pooling](https://www.prisma.io/docs/postgres/database/connection-pooling) for the limits on pooled and direct connections. - [Codeless Sync documentation](https://codelesssync.com/docs/guides/database-setup) for the other providers and data types. ## Related pages - [AI SDK (with Next.js)](https://www.prisma.io/docs/guides/integrations/ai-sdk): Build a chat application with AI SDK, Prisma ORM, and Next.js that stores chat sessions and messages in Prisma Postgres. - [Datadog](https://www.prisma.io/docs/guides/integrations/datadog): Learn how to configure Datadog tracing for a Prisma ORM project. Capture spans for every query using the @prisma/instrumentation package, dd-trace, and view them in Datadog - [Embedded Prisma Studio (with Next.js)](https://www.prisma.io/docs/guides/integrations/embed-studio): Learn how to embed Prisma Studio directly in your Next.js application for database management - [GitHub Actions](https://www.prisma.io/docs/guides/integrations/github-actions): Provision a Prisma Postgres database for every pull request with GitHub Actions and the Prisma CLI, apply your migrations and seed data to it, and delete it when the pull request closes. - [Permit.io](https://www.prisma.io/docs/guides/integrations/permit-io): Learn how to implement access control with Prisma ORM with Permit.io