PRC-1Recommended
Keep prices in a versioned catalogue
Keep every price in one server-side catalogue with a stable ID, and create a new price instead of changing the amount of one in use.
How to do it
The browser sends only product or price IDs, as server-side business rules requires. Store each price with its amount in minor units, currency, interval and tax behaviour. To change an amount, create a new price and archive the old one. Orders and subscriptions keep pointing at the old price, so history and invoices stay true. Move subscribers to a new price on purpose, with notice.
Examples
SQL example
CREATE TABLE prices (
id text PRIMARY KEY,
product_id text NOT NULL,
amount_minor bigint NOT NULL CHECK (amount_minor >= 0),
currency char(3) NOT NULL,
billing_interval text CHECK (billing_interval IN ('month', 'year')),
tax_behaviour text NOT NULL CHECK (tax_behaviour IN ('inclusive', 'exclusive')),
archived_at timestamptz
);
GRANT SELECT, INSERT ON prices TO app_role;
GRANT UPDATE (archived_at) ON prices TO app_role;
How to check
The app's database role cannot update the amount or currency of a price. Search the client code for amounts sent to the checkout endpoint. None are sent.
Sources
Related rules
- PAY-74 Offer pay later through a licensed lender in Payments and billing
- PAY-51 Show prices the way each market expects in Payments and billing
- PAY-66 Set a price in each currency instead of converting at checkout in Payments and billing
- USG-12 Keep every metered price above its cost in Usage-based billing
- USG-30 Name the tier model of every metered price in Usage-based billing
- ECM-46 Tell customers when a price is personalised for them in E-commerce and fulfilment
- APS-52 Work out every amount on the server in Application security
- PRC-2 Tell subscribers before a price rise in Pricing, plans and entitlements
- PRC-12 Compute tiered and volume prices in one tested function in Pricing, plans and entitlements
- PRC-13 Bill committed-use contracts against the commitment and true up at term end in Pricing, plans and entitlements
- PRC-16 Keep old prices as archived catalogue prices with an end date in Pricing, plans and entitlements
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/pricing/plans-and-prices/price-catalogue">Agent Wranglers pricing, plans and entitlements playbook</a>. In code you write, add a comment next to it with the same link.