On this page
Store prices and references
Define money values and references in record schemas.
Before you begin: Validate objects and arrays.
Money Fields
Use type: "money" for balances and recorded monetary amounts. A theme declares the amount rules; the site admin chooses the currency in fb-admin.
Rule input (JSON)
Use a complete version 2 rule file. Select a post with “postType” and “action”, or an “endpoint” by name. Saved data, jobs, payments and email need the local server. Dedupe replay protection also needs a site.
Check complete rules or run schemas, permissions, hooks and calculations against the input above. Add excerpts to a complete rule before running.
On a single-currency theme, forms only need an amount. On a multi-currency theme, submit an amount and one of the currencies enabled for that site:
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
Frontbacked rejects currencies that are not enabled for the site. If no supported-currency list has been saved yet, only the site's base currency is accepted. min and max apply to the ordinary amount a person sees, not to minor units.
FRL can read a money value with money.getAmount(value), money.getCurrency(value), and money.format(value). Money arithmetic is exact, and weighted allocation returns an array of money values. Balance changes stay concise and atomic:
Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →
In FQL, theme developers can define .moneyAmount(), .moneyCurrency(), or .moneyFormat() and use the platform money helper inside those functions:
Use money fields for stored prices and recorded amounts, including principal, balances, credits, debits, and ledger entries. A small plan catalog may use decimal amount text in page settings when it follows one site currency. Read it through $page, validate its amount and terms in a guarded endpoint, and construct { amount: value, currency: $currency.value } for checkout. Save a snapshot with the payment so later catalog edits cannot change a purchase. Page editor labels do not validate settings.
Monetary Fields
Use type: "money" for product prices and every other monetary value. Payment creation is handled by a guarded FRL endpoint.
Rule input (JSON)
Use a complete version 2 rule file. Select a post with “postType” and “action”, or an “endpoint” by name. Saved data, jobs, payments and email need the local server. Dedupe replay protection also needs a site.
Check complete rules or run schemas, permissions, hooks and calculations against the input above. Add excerpts to a complete rule before running.
The frontend submits an exact money value:
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
Use separate money fields when a value has a minimum and maximum, for example minInvestment and maxInvestment. A payment endpoint validates the chosen amount and calls payment.create({ amount, metadata }).
Post References
Use type: "post" when a field should store the generated ID of another post. The referenced post type is declared with postType.
Rule input (JSON)
Use a complete version 2 rule file. Select a post with “postType” and “action”, or an “endpoint” by name. Saved data, jobs, payments and email need the local server. Dedupe replay protection also needs a site.
Check complete rules or run schemas, permissions, hooks and calculations against the input above. Add excerpts to a complete rule before running.
The saved value is the referenced post's stable generated ID, such as the value available in FQL as $.id. It is not a slug, because slugs are optional theme fields and may change. During writes, Frontbacked verifies that the referenced post exists on the same site and has the declared postType. Set exists: false only when a theme intentionally wants to accept an ID-shaped value without an existence check.
Post references are indexed like string fields for filtering and ordering:
Add this configuration inside your page’s {STATE} declaration. Inspect state shows its configuration; live queries and saved data run against your local site. Try a complete FQL page →
The typed field suffix also works when a selector needs to be explicit: { "category@post": selectedCategoryId }. The shorter { category: selectedCategoryId } is also valid.
Continue with Validate file fields.