> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking SamCart as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/samcart > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [Adding a data source](#adding-a-data-source) - [Configuration](#configuration) - [Supported tables](#supported-tables) - [Sync methods](#sync-methods) - [Orders and UTM attribution](#orders-and-utm-attribution) ![](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` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you The SamCart connector syncs orders, charges, subscriptions, and refunds from your SamCart account into PostHog. ## Adding a data source 1. Go to the [sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section in PostHog. 2. Click **\+ New source** and then click **Link** next to SamCart. 3. Next, you need an API key from SamCart. In your SamCart dashboard, go to **Settings** > **API Keys** and create a new key. A **Read only** key is enough. Your SamCart plan must include API access. 4. Back in PostHog, paste your API key into the **API key** field and click **Next**. 5. Select the tables you want to sync and modify the method and frequency as needed. Once done, click **Import**. Once the syncs are complete, you can start using SamCart data in PostHog. ## Configuration | Option | Type | Required | | --- | --- | --- | | `API key` | password | Yes | ## Supported tables | Table | Description | Sync method | Incremental field | Primary key | | --- | --- | --- | --- | --- | | `Orders` | A SamCart order with its full line items, addresses, custom fields and checkout attribution, read from the single-order endpoint. | Incremental, Full refresh | created\_at | — | | `Charges` | A charge against a customer payment method, for a one-time purchase or a subscription rebill. | Incremental, Full refresh | created\_at | — | | `Subscriptions` | A SamCart subscription. Subscriptions set to cancel at a future date still report an active status. | Incremental, Full refresh | created\_at | — | | `Refunds` | A refund issued against a charge. | Incremental, Full refresh | created\_at | — | ## Sync methods All four tables support incremental syncing using `created_at` as the replication key. **Incremental syncs only pick up new records.** They do not capture changes to existing records – for example, a refund that changes the status of an order, charge, or subscription. To pick up these changes, run a full refresh sync. ## Orders and UTM attribution The `Orders` table includes the full `cart_items` line items, addresses, custom fields, and checkout attribution from the single-order detail endpoint. It also includes flat UTM columns for easy querying: - `utm_source` - `utm_medium` - `utm_campaign` - `utm_content` - `lead_source` These values come from SamCart's enhanced attribution when available, falling back to legacy attribution when the enhanced value is empty.