Paddle Customers SQL Template

SQL table creation template for syncing Paddle customer data to your PostgreSQL database.

Updated: 14 Feb 2026

Paddle Customers SQL Template

Create a database table to store Paddle customer data including names, email addresses, and account status.

What Data is Synced?

The Paddle Customers sync captures essential customer information from your Paddle account:

  • Customer ID: Unique Paddle customer identifier (e.g., ctm_abc123)
  • Name: Customer display name
  • Email: Customer email address
  • Status: Account status (active, archived)
  • Complete Data: Full Paddle customer object stored as JSONB
  • Livemode: Whether this is production or sandbox data
  • Timestamps: Created, updated, and sync tracking timestamps

SQL Table Template

Table Schema Explanation

Here's what each column in the table represents:

ColumnTypeDescription
idTEXTPaddle customer ID (e.g., ctm_abc123). Primary key.
nameTEXTCustomer display name. Can be null.
emailTEXTCustomer email address. Can be null.
statusTEXTCustomer status: active or archived.
dataJSONBComplete Paddle customer object stored as JSON.
livemodeBOOLEANWhether this is production data (true) or sandbox (false).
created_atTIMESTAMPTZTimestamp when customer was created in Paddle.
updated_atTIMESTAMPTZTimestamp when customer was last updated in Paddle.
synced_atTIMESTAMPTZTimestamp when CLS last synced this customer record. Auto-updated.

Paddle uses a simple id TEXT PRIMARY KEY — no composite keys needed since Paddle customer IDs are globally unique.

Sync Mode

This template uses full sync only. Each sync fetches all customer records from your Paddle account.

Usage Examples

After syncing, you can query your customer data using standard SQL:

-- Get all active customers
SELECT id, name, email
FROM paddle_customers
WHERE status = 'active';

-- Find customers by email domain
SELECT id, name, email
FROM paddle_customers
WHERE email LIKE '%@example.com';

-- Get recently created customers
SELECT id, name, email, created_at
FROM paddle_customers
WHERE created_at > NOW() - INTERVAL '30 days'
ORDER BY created_at DESC;

-- Count customers by status
SELECT status, COUNT(*) as count
FROM paddle_customers
GROUP BY status;

-- Query custom fields from the data column
SELECT id, name, data->>'locale' AS locale
FROM paddle_customers
WHERE status = 'active';

Common Customizations

The template includes performance indexes for email, status, livemode, and created_at columns. You can add additional customizations:

Add Index for Name Searches

CREATE INDEX idx_paddle_customers_name
ON paddle_customers(name);

Add Compound Index for Email and Status

CREATE INDEX idx_paddle_customers_email_status
ON paddle_customers(email, status);