Skip to content

Product Model

Application (e.g. Acme)
└── Product (e.g. tobby.pro.monthly)
├── Price (LemonSqueezy variant) — $9.99/month
└── Price (Apple IAP product) — $9.99/month

Each application defines its own product catalog. A product has a SKU and one or more prices, each corresponding to a payment gateway variant.

ColumnTypeDescription
idtext PK
app_idtext FKParent application
skutextProduct identifier, unique per application
nametextDisplay name
typetextsubscription, one_time, or credits
is_activebooleanProduct availability
created_attimestamptz
updated_attimestamptz

Unique constraint: (app_id, sku)

ColumnTypeDescription
idtext PK
product_idtext FKParent product
gatewaytextlemonsqueezy or apple_iap
gateway_product_idtextGateway-specific variant or product ID
amountintegerPrice in cents
currencytextISO 4217 (default: USD)
billing_periodtext?month, year (subscriptions only)
is_activeboolean
-- Acme Pro Monthly
INSERT INTO product (id, app_id, sku, name, type) VALUES
('prod_1', 'tobby', 'tobby.pro.monthly', 'Acme Pro', 'subscription');
-- LS price
INSERT INTO price (product_id, gateway, gateway_product_id, amount, billing_period)
VALUES ('prod_1', 'lemonsqueezy', 'ls_variant_xxx', 999, 'month');
-- Apple IAP price
INSERT INTO price (product_id, gateway, gateway_product_id, amount, billing_period)
VALUES ('prod_1', 'apple_iap', 'com.tobby.pro.monthly', 999, 'month');