Skip to content
BuildBase

Pricing Page

Order, group, highlight and badge what your plans include, and show metered allowances with their overage rate.

The order of rows on a pricing page is data you set in the console, not markup you hard-code. It travels in the public plans payload, so the console preview, <PricingPage> and usePublicPlans() all receive the same order, and a change in the console reaches every one of them without a deploy.

All of it is presentation only. Entitlement is resolved by item slug, never by position, so reordering, highlighting or badging an item on a published plan creates no new plan version, triggers no Stripe sync, and cannot change what any workspace is allowed to do.

What controls the order

Four fields on a product (subscription item) and one on its category:

FieldSet onEffect
sortOrderCategory (Billing > Product categories)Order of the sections in a comparison table, lowest first
sortOrderProduct (Billing > Products)Position within its category, lowest first
highlightProductMarks a selling point. Meant to lead a plan card ahead of plain sort order
badgeProductFree-text label shown beside the item - New, Beta, Add-on. Empty means no badge
internalOnlyProductStill gates the capability, but never appears on a public pricing surface

The public items array comes back sorted by category order, then the item's own order, then name. Ties fall back to the name, so items nobody has ordered read alphabetically rather than in whatever order they were created. The console tables, the item picker in the plan version editor and the console's pricing group preview use the same comparison, so what you approve in the preview is what ships.

Plan columns are ordered separately: plans comes back in the order the pricing group version lists them. On a draft version each plan has Move up and Move down arrows that change that order; a published version keeps its order, so to reorder a live pricing page, make a new version, move the plans and publish it.

Each entry in plans is one plan version, and names its plan as plan: { _id, slug }. To mark the plan a subscriber is on, match that _id to the planVersion.plan._id their subscription answers, not the plan's name: two plans can share a name, and a rename changes it.

Tip

Space sort values 10 apart (10, 20, 30). You can then slot a new item between two existing ones without renumbering everything after it.

Arranging the page in the console

Go to Billing > Products and click Reorder. The Arrange the pricing page dialog loads every item at once, grouped the way the pricing page groups them, so what you arrange is what a buyer reads.

  • Drag a section header to move a whole section; drag a row to move an item.
  • Or use the up and down arrows on each row, which work from the keyboard and on touch screens. At the end of a section they carry the row into the next one.
  • Dropping a row into a different section moves the item to that category.
  • Save order writes only what changed. Opening the dialog and saving without moving anything writes nothing.

To set a single value instead, edit the product and use Sort order, Highlight, Badge and Internal only. Category order is the Sort order field under Billing > Product categories.

The same moves are available over the API, one request per list:

curl -X PATCH https://api.console.buildbase.app/api/subscriptions/items/reorder \
  -H "Authorization: $BUILDBASE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"_id":"665f...","sortOrder":10},{"_id":"665e...","sortOrder":20,"category":"665a..."}]}'

category is optional per entry and moves the item to that category. Every referenced category is checked before anything is written, so a reorder that moves an item into an archived category is rejected whole rather than half-applied. Naming the archived category an item is already in is no move: items keep their category when it is archived. Categories reorder the same way at PATCH /api/subscriptions/item-categories/reorder, without the category field.

The public plans response is cached for five minutes, and every item or category write clears that cache, so a new order shows on the next request. Clearing is best-effort: if it fails, the old order can last until the five minutes run out.

What internalOnly hides

An item marked Internal only, and any archived item, is dropped from the public items array. Its slug is also stripped from each plan's features, limits and quotas, so the flag is absent from the payload rather than merely unrendered. The plan still grants it: a workspace on that plan gets the capability, and your app can check it as usual.

Use it for flags that belong in a plan but not on a marketing page - a rollout switch, a support tier toggle, an internal quota.

Rendering it with PricingPage

<PricingPage> is headless. It hands you items and plans in the order above and leaves the layout to you, so the fields only show up if your render function reads them.

The SDK types do not declare sortOrder, highlight, badge or the category's sortOrder yet, although the API returns them. Widen the item type to read them:

import { PricingPage } from '@buildbase/sdk/react';

type PresentedItem = {
  slug: string;
  name: string;
  type: 'feature' | 'limit' | 'quota';
  highlight?: boolean;
  badge?: string;
  category: { name: string; slug: string };
};

function Pricing() {
  return (
    <PricingPage slug="main-pricing">
      {({ loading, items, plans }) => {
        if (loading) return <p>Loading plans...</p>;
        const rows = items as PresentedItem[];

        return (
          <div className="grid grid-cols-3 gap-4">
            {plans.map((plan) => {
              const included = rows.filter(
                (item) =>
                  plan.features[item.slug] ||
                  item.slug in plan.limits ||
                  item.slug in plan.quotas
              );
              // Highlighted items lead; the rest keep the configured order.
              const card = [
                ...included.filter((item) => item.highlight),
                ...included.filter((item) => !item.highlight),
              ].slice(0, 6);

              return (
                <div key={plan._id}>
                  <h3>{plan.name}</h3>
                  <ul>
                    {card.map((item) => (
                      <li key={item.slug}>
                        {item.name}
                        {item.badge && <span> {item.badge}</span>}
                      </li>
                    ))}
                  </ul>
                </div>
              );
            })}
          </div>
        );
      }}
    </PricingPage>
  );
}

For a comparison table, group consecutive items by category.slug. They already arrive in section order, so a single pass is enough and you never sort on the client.

The pricing page on buildbase.app reads the same payload and goes one step further: when a plan includes everything the plan below it does, its card reads "Everything in Grow, plus" (naming the plan below) and lists only what is new or larger. That check is computed per render, and a plan that drops something the cheaper one has falls back to its full list. It is a pattern for your own render function, not something <PricingPage> does for you.

Metered allowances and overage

A metered item (type: 'quota') has two halves a buyer wants to see: how much is included, and what happens past it. Both are in the payload. Resolve them for the interval and currency on screen with getQuotaDisplayWithVariant, and format them with formatQuotaWithPrice:

import {
  formatQuotaWithPrice,
  getQuotaDisplayWithVariant,
  PricingPage,
} from '@buildbase/sdk/react';

function ComparisonTable({ interval, currency }) {
  return (
    <PricingPage slug="main-pricing">
      {({ items, plans }) => (
        <table>
          <tbody>
            {items.map((item) => (
              <tr key={item.slug}>
                <td>{item.name}</td>
                {plans.map((plan) => (
                  <td key={plan._id}>
                    {item.type === 'quota'
                      ? formatQuotaWithPrice(
                          getQuotaDisplayWithVariant(
                            plan,
                            currency,
                            item.slug,
                            interval
                          ),
                          item.name.toLowerCase(),
                          { currency }
                        )
                      : item.type === 'limit'
                        ? plan.limits[item.slug]
                        : plan.features[item.slug]
                          ? 'Yes'
                          : '-'}
                  </td>
                ))}
              </tr>
            ))}
          </tbody>
        </table>
      )}
    </PricingPage>
  );
}

A few things to get right, all of which the helpers handle if you pass them the interval and currency the visitor is looking at:

  • The allowance follows the billing toggle. A plan's yearly tier can carry a larger allowance than its monthly one, so read the quota for the interval on screen rather than always monthly.
  • The overage rate comes from the currency's pricing variant. quotaOverages on the variant is what billing charges, and the public payload carries no other figure. getQuotaDisplayWithVariant reads it from there for the currency you pass.
  • The unit size belongs in the rate. A rate billed per 1,000 reads "then $2.00 / 1,000 emails", not a bare per-unit price.
  • No overage means a hard limit. When allowOverage is false the allowance is a ceiling, which is a different offer from one that costs more past the line. formatQuotaWithPrice prints it as "10000 included (hard limit)".
  • A tiered rate has no single price. A plan can price overage, or extra seats, by graduated or volume tiers instead of one amount: "$3.00 per block for the first 5, then $1.00". The interval's table arrives as tiers beside the flat amounts, and an interval that is tiered has no flat amount. formatQuotaWithPrice then reads "then from $1.00 / 1,000 emails", the lowest paid band, and formatPriceTiers gives one { range, price } row per band for a tooltip or a small table.

Prices are integers in each currency's smallest unit: cents for USD, whole yen for JPY, which has no minor unit; the payload's notes field says as much. formatQuotaWithPrice converts for you, and formatMinorAmountIntl(amount, currency, locale?) formats any other amount; never divide by 100.

Tiered overage and seats

Overage bands count billable blocks of the quota's unit size, the quantity Stripe bills; seat bands count billable seats, the members past the included seats (see Seat-based pricing). In graduated mode each band prices the units that fall in it and the bands are added up; in volume mode every unit is priced at the band the total lands in. tieredAmount is the same math the server bills with, so an estimate you show matches the invoice:

Note

getSeatPriceTiers, tieredAmount and formatPriceTiers: Requires @buildbase/sdk 1.0.0 or later.

import {
  formatMinorAmountIntl,
  formatPriceTiers,
  getSeatPriceTiers,
  tieredAmount,
} from '@buildbase/sdk/react';

function SeatEstimate({ plan, currency, interval, billableSeats }) {
  const table = getSeatPriceTiers(plan, currency, interval);
  if (!table) return null; // flat seats: getPerSeatPriceCents has the price
  const cents = tieredAmount(table.tiers, table.mode, billableSeats);
  const bands = formatPriceTiers(table.tiers, currency, '');
  return (
    <p title={bands.map((b) => `${b.range}: ${b.price}`).join('\n')}>
      {billableSeats} extra seats: {formatMinorAmountIntl(cents, currency)}
    </p>
  );
}

getPerSeatPriceCents answers null on a tiered interval, and calculateSeatOverageCents prices the table. An older server sends no tiers, and every helper renders the flat rate as before.

On the buildbase.app pricing page, a plan card draws metered allowances and hard ceilings in their own block above the feature list, and the comparison table prints the same figure from the same function, so the card and the table cannot disagree. The six-row card limit is applied to the ordered list before that split, so which rows make the card stays the admin's decision.

Next Steps