Product Model
Structure
Section titled “Structure”Application (e.g. Acme) │ └── Product (e.g. tobby.pro.monthly) │ ├── Price (LemonSqueezy variant) — $9.99/month └── Price (Apple IAP product) — $9.99/monthEach application defines its own product catalog. A product has a SKU and one or more prices, each corresponding to a payment gateway variant.
Product
Section titled “Product”| Column | Type | Description |
|---|---|---|
| id | text PK | |
| app_id | text FK | Parent application |
| sku | text | Product identifier, unique per application |
| name | text | Display name |
| type | text | subscription, one_time, or credits |
| is_active | boolean | Product availability |
| created_at | timestamptz | |
| updated_at | timestamptz |
Unique constraint: (app_id, sku)
| Column | Type | Description |
|---|---|---|
| id | text PK | |
| product_id | text FK | Parent product |
| gateway | text | lemonsqueezy or apple_iap |
| gateway_product_id | text | Gateway-specific variant or product ID |
| amount | integer | Price in cents |
| currency | text | ISO 4217 (default: USD) |
| billing_period | text? | month, year (subscriptions only) |
| is_active | boolean |
Example
Section titled “Example”-- Acme Pro MonthlyINSERT INTO product (id, app_id, sku, name, type) VALUES ('prod_1', 'tobby', 'tobby.pro.monthly', 'Acme Pro', 'subscription');
-- LS priceINSERT INTO price (product_id, gateway, gateway_product_id, amount, billing_period)VALUES ('prod_1', 'lemonsqueezy', 'ls_variant_xxx', 999, 'month');
-- Apple IAP priceINSERT INTO price (product_id, gateway, gateway_product_id, amount, billing_period)VALUES ('prod_1', 'apple_iap', 'com.tobby.pro.monthly', 999, 'month');