Paddle Prices SQL Template
SQL table creation template for syncing Paddle pricing data to your PostgreSQL database.
Updated: 14 Feb 2026
Paddle Prices SQL Template
Create a database table to store Paddle pricing data including unit prices, billing cycles, and product associations.
What Data is Synced?
The Paddle Prices sync captures pricing information from your Paddle account:
- Price ID: Unique Paddle price identifier (e.g.,
pri_abc123) - Product ID: Associated product ID
- Status: Price status (active, archived)
- Billing Cycle: Interval and frequency for recurring prices
- Unit Price: Amount and currency code
- Complete Data: Full Paddle price object stored as JSONB
- 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 price ID (e.g., pri_abc123). Primary key. |
product_id | TEXT | Associated Paddle product ID. |
status | TEXT | Price status: active or archived. |
billing_cycle_interval | TEXT | Billing interval: day, week, month, or year. Null for one-time prices. |
billing_cycle_frequency | INTEGER | Number of intervals between billings. Null for one-time prices. |
unit_price_amount | TEXT | Price amount (stored as text for precision). |
unit_price_currency_code | TEXT | Currency code (e.g., USD, GBP). |
data | JSONB | Complete Paddle price object stored as JSON. |
livemode | BOOLEAN | Whether this is production data (true) or sandbox (false). |
created_at | TIMESTAMPTZ | Timestamp when price was created in Paddle. |
updated_at | TIMESTAMPTZ | Timestamp when price was last updated in Paddle. |
synced_at | TIMESTAMPTZ | Timestamp when CLS last synced this price record. Auto-updated. |
Sync Mode
This template uses full sync only. Each sync fetches all price records from your Paddle account.
Usage Examples
After syncing, you can query your pricing data using standard SQL:
-- Get all active prices with product info
SELECT id, product_id, unit_price_amount, unit_price_currency_code
FROM paddle_prices
WHERE status = 'active';
-- Find monthly prices
SELECT id, product_id, unit_price_amount, unit_price_currency_code
FROM paddle_prices
WHERE billing_cycle_interval = 'month'
AND billing_cycle_frequency = 1
AND status = 'active';
-- Compare prices across currencies
SELECT unit_price_currency_code, COUNT(*) as count,
MIN(unit_price_amount::NUMERIC) as min_price,
MAX(unit_price_amount::NUMERIC) as max_price
FROM paddle_prices
WHERE status = 'active'
GROUP BY unit_price_currency_code;
-- Get one-time prices (no billing cycle)
SELECT id, product_id, unit_price_amount
FROM paddle_prices
WHERE billing_cycle_interval IS NULL
AND status = 'active';
-- Find prices for a specific product
SELECT id, billing_cycle_interval, unit_price_amount, unit_price_currency_code
FROM paddle_prices
WHERE product_id = 'pro_abc123'
AND status = 'active';
Common Customizations
The template includes performance indexes for product_id, status, livemode, and created_at columns.
Add Index for Currency Lookups
CREATE INDEX idx_paddle_prices_currency
ON paddle_prices(unit_price_currency_code)
WHERE status = 'active';
Add Compound Index for Product and Status
CREATE INDEX idx_paddle_prices_product_status
ON paddle_prices(product_id, status);
Related Templates
- Products - Product catalog linked to prices
- Subscriptions - Subscriptions using these prices
- Transactions - Transaction records