Linking SamCart as a source
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.

Contents
The SamCart connector syncs orders, charges, subscriptions, and refunds from your SamCart account into PostHog.
Adding a data source
Go to the sources tab of the data pipeline section in PostHog.
Click + New source and then click Link next to SamCart.
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.
Back in PostHog, paste your API key into the API key field and click Next.
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_sourceutm_mediumutm_campaignutm_contentlead_source
These values come from SamCart's enhanced attribution when available, falling back to legacy attribution when the enhanced value is empty.





