DocsQueries & lists · FQL
On this page

Summarize transactions

Filter transaction history and calculate aggregates.

Before you begin: Read account data.

Transactions

Use $transactions for the current user's site transactions. This is useful for dashboards, portfolios, and transaction history pages without writing a custom endpoint for every theme.

index.html

Transaction rows include requested payment values and actual paid values:

FieldMeaning
requestedAmountAmount the site asked the user to pay in the platform currency.
requestedCurrencyPlatform currency for the requested amount, such as USD or NGN.
paidAmountAmount the user actually paid after any method conversion.
paidCurrencyCurrency or crypto asset the user paid with, such as USD, BTC, or ETH.
statusPayment status, such as pending, failed, or successful.
kindTransaction direction, such as deposit.
tagTheme-provided label for what the payment is for.

Transaction rows expose the stored status. Completed payments currently appear as successful in FQL transaction filters and rows. FRL payment events expose the same completion event as payment confirmed with $payment.status == "confirmed" so rule code reads like an event, while $payment.rawStatus keeps the stored transaction value available.

Transaction selectors in state use special keys such as $list, $where, $order, $limit, and $page. This keeps selector metadata separate from normal transaction fields.

Aggregates

FQL can ask Frontbacked for counts and sums for $transactions and post sources. Frontbacked returns only the computed value.

index.html

For sums, the field to sum is a normal path segment after $sum:

text

Parentheses run registered page functions. They do not select aggregate fields.

text

In that expression, Frontbacked sums requestedAmount, then the browser passes the returned value into formatMoney.

Do not use $sum(requestedAmount). Function arguments are supported, but aggregate fields are selected as path segments after $sum.

Older themes may still use $counts, but new FQL should use $count.

When summing paidAmount, filter to one currency or billing method so you do not add mixed units together:

text

In raw FQL attributes, dynamic roots can be written with or without quotes when the whole quoted value is a FQL special root/path:

index.html

Both forms above resolve $now to the page's current-time snapshot. In {STATE} selectors, $now may be written bare in JS-style state declarations or as "$now" in JSON-compatible state. Use the transaction field name expiresOn, not expires.

Continue with Query a list.