# Linking Braintree as a source - Docs

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70)

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d)

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

`npx @posthog/wizard warehouse`

[Learn more](/wizard.md)

![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)

The Braintree connector syncs your payment data into PostHog, including transactions, refunds, and disputes.

**Alpha release**

The Braintree source is currently in alpha. Customer, plan, and subscription data isn't available yet — these live in Braintree's legacy SDK API and are planned as a follow-up.

## Supported tables

| Table | Description |
| --- | --- |
| transactions | Payment transactions including amount, status, currency, order ID, merchant account, and payment method type |
| refunds | Refund records including amount, status, the refunded transaction reference, and order ID |
| disputes | Dispute records including amount disputed, status, type, case number, and received date |

All three tables support incremental syncs on the `createdAt` field.

## Adding a data source

1.  In PostHog, go to the [Data pipeline page](https://app.posthog.com/data-management/sources) and select the **Sources** tab.

2.  Click **\+ New source** and then click **Link** next to Braintree.

3.  Select your **Environment** — either **Production** or **Sandbox**. Make sure the keys you provide in the next steps match the selected environment.

4.  To find your API keys, go to the [Braintree Control Panel](https://www.braintreegateway.com/) and navigate to **Settings** > **API Keys**. If you don't have a key pair yet, generate one. Copy the **Public key** and **Private key**.

5.  Paste your **Public key** and **Private key** into the corresponding fields in PostHog.

6.  Click **Next**.

7.  On the next page, select the tables you want to sync and configure the sync method and frequency. Click **Import**.

Once the sync completes, you can start querying your Braintree data in PostHog.

## Configuration

| Option | Type | Required |
| --- | --- | --- |
| Environment | select | Yes |
| Public key | text | Yes |
| Private key | password | Yes |

## Supported tables

| Table | Description | Sync method | Incremental field | Primary key |
| --- | --- | --- | --- | --- |
| transactions | A single attempt to move money — a sale or credit processed through Braintree. | Incremental, Full refresh | createdAt | — |
| refunds | A refund returning funds from a settled transaction back to the customer. | Incremental, Full refresh | createdAt | — |
| disputes | A customer's challenge of a transaction with their bank (a chargeback) and its status. | Incremental, Full refresh | createdAt | — |

## Sync details

-   **Incremental sync** - All tables support incremental syncs using the `createdAt` field. PostHog filters server-side using a `greaterThanOrEqualTo` search filter, so only new records are fetched on each run.
-   **Partitioning** - Data is partitioned by month on the `createdAt` field.
-   **Pagination** - Uses Relay-style cursor pagination. If a sync is interrupted, it resumes from the last successfully synced page.

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better