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.

The SamCart connector syncs orders, charges, failed charges, subscriptions, refunds, customers, products, and coupons 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 | — |
Customers | A SamCart customer. Orders, charges and subscriptions point to it through customer_id. Deleted customers are not listed. | Incremental, Full refresh | created_at | — |
FailedCharges | A payment attempt that did not succeed, with the error text from the payment processor. | Incremental, Full refresh | created_at | — |
Products | A product in the SamCart catalog. Archived products are included; deleted products are not. | Full refresh | — | — |
Coupons | A SamCart coupon. A coupon created for several products is one row per product, all with the same code. Archived coupons are included; deleted coupons are not. | Full refresh | — | — |
Sync methods
The Orders, Charges, FailedCharges, Subscriptions, Refunds, and Customers tables support incremental syncing using created_at as the replication key.
The Products and Coupons tables support full refresh syncs only. Products and coupons can change after they are created (for example, a price change or an archived state), so each sync reads the full catalog.
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.





