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:
| Column | Type | Description |
|---|---|---|
id | TEXT | Paddle customer ID (e.g., ctm_abc123). Primary key. |
name | TEXT | Customer display name. Can be null. |
email | TEXT | Customer email address. Can be null. |
status | TEXT | Customer status: active or archived. |
data | JSONB | Complete Paddle customer object stored as JSON. |
livemode | BOOLEAN | Whether this is production data (true) or sandbox (false). |
created_at | TIMESTAMPTZ | Timestamp when customer was created in Paddle. |
updated_at | TIMESTAMPTZ | Timestamp when customer was last updated in Paddle. |
synced_at | TIMESTAMPTZ | Timestamp 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);
Related Templates
- Subscriptions - Subscription records linked to customers
- Transactions - Transaction/payment records
- Adjustments - Refunds, credits, and chargebacks