Linking PayPal 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.

PostHog Wizard hedgehog

The PayPal connector syncs data from a PayPal business account into PostHog, including transactions (with fees, refunds, and denied payments), balances, disputes, invoices, subscription plans, and catalog products.

Prerequisites

PostHog connects to PayPal with the client ID and secret of a PayPal REST app:

  1. In the PayPal developer dashboard, create a REST app for your PayPal business account.
  2. Turn on Transaction search for the app. To sync the disputes, invoices, plans, or products tables, also turn on Disputes, Invoicing, or Subscriptions. A new REST app has none of these features turned on.
  3. Copy the app's Client ID and Secret.

To import more than one PayPal account, add one source per account.

Adding a data source

  1. In PostHog, go to the sources tab of the data pipeline section.

  2. Click + New source and then click Link next to PayPal.

  3. Select your Environment – either Live (the default) or Sandbox. Make sure the credentials you provide belong to the selected environment.

  4. Paste your app's Client ID and Client secret into the corresponding fields.

  5. Click Next.

  6. 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 PayPal data in PostHog.

Available tables

TableDescriptionRequired app featureSync method
transactionsMoney movement from the Transaction Search API: payments, refunds, fees, reversals, and denied paymentsTransaction searchIncremental on transaction_initiation_date
balancesBalance held on the account, one row per currency, at the time of the syncTransaction searchFull refresh
disputesCustomer disputes, chargebacks, and claims raised against the accountDisputesIncremental on update_time
invoicesInvoices created with PayPal InvoicingInvoicingFull refresh
plansBilling plans that set the pricing and billing cycles of subscriptionsSubscriptionsFull refresh
productsCatalog products that billing plans and subscriptions referenceSubscriptionsFull refresh

The incremental transactions and disputes tables merge rows on their primary key, because both re-read rows that change after creation.

Configuration

OptionTypeRequired
EnvironmentselectYes
Client IDtextYes
Client secretpasswordYes

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
transactions

Money movement on the PayPal account from the Transaction Search API: payments, refunds, fees, reversals and denied payments. Covers up to three years of history.

Incremental, Full refreshtransaction_initiation_date—
balances

Balance held on the PayPal account, one row per currency, at the time of the sync.

Full refresh——
disputes

Customer disputes, chargebacks and claims raised against the account.

Incremental, Full refreshupdate_time—
invoices

Invoices created on the account with PayPal Invoicing.

Full refresh——
plans

Billing plans that set the pricing and billing cycles of subscriptions.

Full refresh——
products

Catalog products: the goods or services that billing plans and subscriptions reference.

Full refresh——

Sync details

  • Transaction windows – PayPal limits a transaction search to 31 days, so PostHog syncs transactions in seven-day windows. If a window matches more than 10,000 records, PostHog halves the window, down to one hour.
  • Transaction history – Transaction Search serves three years of history, so the first sync goes back up to three years.
  • Transaction lookback – Each incremental transactions sync re-reads the last 30 days. A transaction's status can change after it's created (for example, a pending eCheck clears or a payment is reversed), and new transactions can take up to three hours to become searchable. PostHog merges the restated rows on transaction_id.
  • Disputes – Disputes sync incrementally on update_time, so PostHog re-reads disputes whose status changes. PayPal only accepts a dispute update filter within the last 180 days.
  • Resuming – If a sync is interrupted, it resumes from the last saved page.

Troubleshooting

PayPal rejected your app credentials or could not issue a token

Check the client ID and secret, and that they belong to the environment you selected (Live or Sandbox).

Your PayPal app can't read this table

PayPal returned a 403 error for the table. In the PayPal developer dashboard, turn on the feature the table needs (Transaction search, Disputes, Invoicing, or Subscriptions) for the app.

RESULTSET_TOO_LARGE

The account has more than 10,000 transactions in a single hour. Transaction Search can't return them, so the transactions table can't sync for this account.

Still have questions?

Was this page useful?