Per-Restaurant Template Wrapper — Stage 3 GTM

Inspection surface · How the per-restaurant's branding wraps the cart + checkout · 05 October 2026 (Monday, UTC)

1. The pattern, in plain words

The per-restaurant template wrapper is the missing link between the per-restaurant one-page site (Stage 1) and the TB — Order Quantity + Cart pages (the existing demo surface). When the per-restaurant is onboarded (Stage 3 of the GTM), the operator's platform reads the per-restaurant's record (logo, name, colors, menu, hours, charity default) and renders the TB — Order pages with the per-restaurant's branding. The per-restaurant's online-ordering URL is /order/<restaurant-slug>/ and the per-restaurant's branding is loaded from the operator's WordPress database.

The wrapper pattern is the same on the per-restaurant one-page site and the per-restaurant online-ordering surface: the per-restaurant's brand header (logo + name + tag + meta), the per-restaurant's brand colors (accent + dark + light), the per-restaurant's story, the per-restaurant's menu, the per-restaurant's hours, the per-restaurant's address, the per-restaurant's phone, the per-restaurant's charitable-allocation default. The Powered by Orb-Wallet footer stays consistent across both surfaces — the operator's supply-side acquisition is on the per-restaurant surfaces, the operator's brand is the trust-earning piece.

2. The data flow, named honestly

When a diner lands on the per-restaurant's online-ordering URL /order/<restaurant-slug>/:

  1. The WordPress proxy receives the request at /wp-json/orb-wallet/v1/restaurant-lookup?slug=<restaurant-slug>.
  2. The proxy reads the per-restaurant record from the WordPress database (logo, name, colors, menu, hours, charity default, Nuvei sub-merchant ID).
  3. The proxy returns the per-restaurant record as JSON.
  4. FlexiFunnels' per-restaurant template (a thin wrapper around the TB — Order pages) reads the JSON and renders the page with the per-restaurant's branding.
  5. The cart contents + the per-restaurant's Nuvei sub-merchant ID + the diner's BP balance (if any) are POSTed to /wp-json/orb-wallet/v1/diner-checkout on checkout.
  6. The proxy routes the diner's payment through Nuvei hosted-fields to the per-restaurant's Nuvei sub-merchant.
  7. Nuvei processes the card; the proxy records the result; the per-restaurant is settled (minus Nuvei's processing fee minus the operator's platform fee); the diner's BP balance is debited (if BP-amount was applied).

3. The per-restaurant record schema

The per-restaurant record is a custom post type orb_wallet_restaurant on WordPress. The schema:

post_title          = restaurant name
post_name           = restaurant slug (used in /order/<slug>/)
post_status         = publish | draft (for the publish gate)
_orb_sub_merchant_id = Nuvei sub-merchant ID (set at KYC)
_orb_logo_url        = URL to the per-restaurant's logo
_orb_brand_dark      = hex color (default #1a1a2e)
_orb_brand_light     = hex color (default #fafaf6)
_orb_brand_accent    = hex color (default #c8a96a)
_orb_tagline         = short tagline
_orb_hours           = hours text
_orb_phone           = phone number
_orb_address         = street address
_orb_capacity        = capacity (seats)
_orb_cuisine         = cuisine type
_orb_story           = story paragraph 1 + 2
_orb_menu_json       = menu items as JSON array
_orb_charity_default = default charity + percentage
_orb_reservation_url = reservation link (OpenTable, Resy, internal)
_orb_tier            = small | medium | large | enterprise
_orb_subscription_status = active | paused | cancelled

The schema is captured at KYC; the menu is captured at onboarding; the brand colors are captured at onboarding; the charity default is captured at onboarding. The per-restaurant record is the source-of-truth for the per-restaurant's surface; the FlexiFunnels page-template pattern is a thin wrapper around the TB — Order pages that reads the per-restaurant record and renders accordingly.

4. The wrapper pattern (the code)

The per-restaurant template wrapper is a small JavaScript snippet that runs on every per-restaurant online-ordering page. The snippet reads the per-restaurant's record from the WordPress REST endpoint, populates the per-restaurant's branding (logo, name, colors, story, menu, hours, charity default), and re-renders the page. ~50 lines of JavaScript, plus the WordPress REST endpoint that serves the per-restaurant record.

// Per-restaurant wrapper: read the per-restaurant record, populate the surface
const slug = window.location.pathname.split('/order/')[1].split('/')[0];
const proxy = 'https://staging.orb-community.example/wp-json/orb-wallet/v1/restaurant-lookup';
fetch(proxy + '?slug=' + slug).then(r => r.json()).then(r => {
  document.title = r.name + ' — Online Order';
  document.querySelector('.brand-logo').textContent = r.initials;
  document.querySelector('.brand-text .tag').textContent = r.tagline;
  document.documentElement.style.setProperty('--brand-dark', r.brand_dark);
  document.documentElement.style.setProperty('--brand-accent', r.brand_accent);
  // render menu items from r.menu_json
  // populate charity-allocation default from r.charity_default
});

5. The four-stage GTM, with the Brownie-Points Phase 2 layer

StageWhat the operator shipsWhat the per-restaurant getsWhat the diner gets
Stage 1 · Per-restaurant one-page site FlexiFunnels page template with the per-restaurant's branding A modern site that replaces the per-restaurant's old/dated site A clean, fast, per-restaurant-branded site with reservation + menu + order CTAs
Stage 2 · Build relationship Quarterly check-ins, per-listing updates, per-restaurant analytics review A relationship with the operator; the per-restaurant sees the audit trail; the per-restaurant is recognized for the work Better site updates; the per-restaurant's story evolves; the per-restaurant's menu refreshes
Stage 3 · Upsell to online ordering Orb-Wallet SaaS subscription + per-restaurant template wrapper (this page) An online-ordering surface under the per-restaurant's brand; pickup + delivery; the per-restaurant's charity default An online-ordering surface under the per-restaurant's brand; pickup + delivery; member-selected charity-allocation on every order
Stage 4 · Upsell to Orb-Wallet payment processing Orb-Wallet Nuvei sub-merchant creation; diner-checkout endpoint; per-restaurant settlement Per-restaurant pays the SaaS subscription via Orb-Wallet; per-restaurant's diners pay via Orb-Wallet; the per-restaurant's settlement is daily / weekly / rolling reserve Diner's payment is captured via Nuvei hosted-fields (PCI-compliant by construction); diner's card data never touches the per-restaurant's site; the per-restaurant's Nuvei sub-merchant is the merchant of record
Phase 2 · Brownie-Points integration WordPress proxy endpoint at /wp-json/orb-wallet/v1/bp-redeem; the per-member's BP balance is read, debited, applied as a discount The per-restaurant accepts Orb-Community members' BPs as a coupon at checkout; the per-restaurant is paid the gross amount minus the BP-discount; the operator absorbs the BP-discount as the per-Operation currency sponsor Orb-Community members use their earned BPs (1 BP = $1.00 USD) at the per-restaurant's online-ordering checkout as a coupon; the BP-discount is visible on the order summary; the per-restaurant's branding is preserved

6. The audit-trail surface, named honestly

The per-restaurant template wrapper inherits the audit-trail discipline from the operation's canonical standing instructions. The per-restaurant's branding is captured at onboarding; the per-restaurant's menu is captured at onboarding; the per-restaurant's charity default is captured at onboarding; the per-restaurant's Nuvei sub-merchant ID is captured at KYC; the per-restaurant's SaaS subscription is captured at subscription; the per-restaurant's per-transaction settlement is captured at settlement. Every change to the per-restaurant's record is logged in the per-restaurant's audit trail; every per-transaction is logged in the per-restaurant's per-transaction audit trail; every diner checkout is logged in the operation-wide audit trail. The audit trail is the structural protection for the per-restaurant's trust-earning with the operator.
The per-restaurant template wrapper is the load-bearing piece of Stage 3. Stage 1 (per-restaurant one-page site) is the entry point; Stage 2 (relationship) is the trust-earning piece; Stage 3 (template wrapper + SaaS subscription) is the upsell; Stage 4 (Orb-Wallet payment processing) is the final piece; Phase 2 (Brownie-Points) is the per-Operation currency layer that makes the per-restaurant the gateway into the broader Orb-Community. The wrapper pattern is the structural piece that makes Stage 3 a thin layer on top of the existing TB — Order Quantity + Cart pages, not a rebuild.
Three failure modes the wrapper pattern must defend against. (1) The per-restaurant's branding is captured correctly — wrong colors or wrong logo is a real trust-earning failure. (2) The per-restaurant's Nuvei sub-merchant ID is correct — wrong sub-merchant routes the diner's payment to the wrong restaurant. (3) The per-restaurant's charity default is honored — wrong charity allocation is a real audit-trail failure. The wrapper pattern's per-restaurant-record read at page-load is the structural protection against all three; the read fails loud (returns a 404) if the per-restaurant record is missing or malformed.