BP-Redemption QR-Code Architecture

Per-order QR code · Single-use · HMAC-signed · 24-hour expiry · 05 October 2026 (Monday, UTC)

1. The BP-redemption verification problem, named honestly

Brownie Points (BP) are the per-Operation's universal currency at the fixed rate 1 BP = $1.00 USD (per standing instruction #30). BP-redemption at a per-business's checkout is currently specified as: the customer enters a BP-amount at checkout; the operator's orb-wallet-gateway plugin's /wp-json/orb-wallet/v1/bp-redeem endpoint reads the per-member's BP balance, debits the BP-amount, applies the BP-amount as a per-cart discount, and returns the discount to the per-business's checkout. The customer pays the gross amount minus the BP-discount at the per-business's Nuvei sub-merchant. The per-business is paid the gross amount minus the BP-discount; the operator absorbs the BP-discount as the per-Operation currency sponsor.

The verification gap: when the customer picks up the per-cart, the per-business's pickup-time staff doesn't know the customer used BPs vs. cash vs. credit. The per-business's order-management system shows "Order #12345, $45.00 paid" but the BP-portion of the transaction is invisible at the pickup moment. The per-business's staff may accidentally give the per-cart to the wrong customer. The customer may claim they didn't use BPs. The per-business's reconciliation at end-of-day has no per-transaction BP-usage breakdown to verify against.

The structural problem: BP-redemption is currently a per-checkout-time event; the per-pickup-time event is a separate verification gap. The operator's GTM accelerates when the per-business's pickup-time staff has a single source of truth for "Order #12345, $45.00 paid, customer used 10 BPs, customer's verification QR code is X." A per-order QR code is the structural piece that bridges the per-checkout-time BP-redemption event to the per-pickup-time verification event.

2. The QR code architecture, end-to-end

The per-order QR code has four pieces: generation at per-cart checkout, delivery to the customer, scanning at per-pickup-time by the per-business's staff, and the per-order audit-trail structure.

2.1 Per-order QR code generation (at per-cart checkout)

When the per-cart's checkout completes, the orb-wallet-gateway plugin's /wp-json/orb-wallet/v1/order-complete endpoint generates a per-order QR code. The QR code is a base64-encoded string of the per-order's:

POST /wp-json/orb-wallet/v1/order-complete
Content-Type: application/json
Authorization: Bearer <member_token>

{
  "order_id": "ord_2026_10_05_abc123",
  "bp_redeemed": 1000,   // 10 BPs = $10.00 = 1000 cents
  "cart_total": 4500,     // $45.00 gross
  "cart_subtotal": 3500,  // $35.00 after BP-discount
  "store_id": "store_small_grocer_xyz",
  "member_id": "member_abc456",
  "pickup_window": "2026-10-05T15:00:00Z",
  "created_at": "2026-10-05T14:35:22Z"
}

Response 200 OK:
{
  "qr_code": "base64:eyJvcmRlcl9pZCI6Im9yZF8yMDI2...",
  "qr_url": "https://staging.orb-community.example/qr/ord_2026_10_05_abc123",
  "expires_at": "2026-10-06T15:00:00Z",
  "status": "ready_for_pickup"
}

The QR code is delivered to the customer via three channels: email (full QR code as a downloadable image), SMS (short URL that resolves to the QR code), and the customer's Orb-Wallet app (the QR code is in the customer's per-order record). The QR code is unique per order; the QR code is single-use; the QR code expires 24 hours after the per-cart's pickup window.

2.2 Per-pickup-time scanning flow (at the per-business)

When the customer arrives at the per-business to pick up the per-cart, the customer presents the QR code on their phone. The per-business's pickup-time staff scans the QR code with the per-business's Orb-Wallet scanner (a small per-business-side app on the staff's phone, OR a per-business-staff Orb-Wallet dashboard on a tablet at the pickup window).

The scanner sends the QR code's contents to the orb-wallet-gateway plugin's /wp-json/orb-wallet/v1/order-verify endpoint. The endpoint validates the HMAC signature against the operator's secret; the endpoint checks the QR code's expiry against the current time; the endpoint checks the QR code's single-use status; the endpoint returns the per-order's verification record to the scanner.

POST /wp-json/orb-wallet/v1/order-verify
Content-Type: application/json
Authorization: Bearer <staff_token>

{
  "qr_code": "base64:eyJvcmRlcl9pZCI6Im9yZF8yMDI2..."
}

Response 200 OK:
{
  "order_id": "ord_2026_10_05_abc123",
  "store_name": "Local Roots Grocer",
  "member_name": "Sarah Johnson",
  "member_verified": true,
  "bp_redeemed": 10,
  "cart_total": 45.00,
  "cart_subtotal": 35.00,
  "pickup_window": "2026-10-05T15:00:00Z",
  "status": "ready_for_pickup",
  "action": "release_to_customer"
}

The per-business's pickup-time staff sees the per-order's verification record on the scanner screen. The staff confirms the customer's identity (name + ID + the customer's verification-photo from standing instruction #26's consent-and-safety surface). The staff releases the per-cart to the customer. The staff marks the per-order as "picked up" in the scanner.

2.3 Per-order audit-trail structure

The per-order's BP-redemption state is fully auditable end-to-end. The per-order's audit trail captures three events:

EventTimestampActorWhat happened
checkout_completed 2026-10-05T14:35:22Z Customer (member_abc456) Per-cart checkout completed; $45.00 paid ($35.00 via Nuvei + 10 BPs redeemed); per-order QR code generated
pickup_verified 2026-10-05T15:08:14Z Per-business staff (staff_xyz789) QR code scanned at pickup; customer identity confirmed; per-order marked as picked up
pickup_completed 2026-10-05T15:08:31Z Per-business staff (staff_xyz789) Per-cart released to customer; per-order audit trail closed

The three events form a per-order audit-trail that the per-business can reconcile at end-of-day against the per-business's POS, against the operator's per-business dashboard, and against the per-Operation's BP-issuance-and-redemption ledger. The audit trail is durable, auditable, and verifiable.

3. The orb-wallet-gateway plugin's new endpoints

The QR-code architecture adds two new endpoints to the orb-wallet-gateway plugin. Both endpoints are ~80-100 lines of PHP each.

3.1 /wp-json/orb-wallet/v1/order-complete

Called by the per-business's checkout flow at the moment of payment completion. Generates the per-order QR code + the per-order audit-trail record. The endpoint is idempotent (a second call with the same order_id returns the same QR code without re-debiting BPs).

3.2 /wp-json/orb-wallet/v1/order-verify

Called by the per-business's pickup-time staff scanner. Validates the HMAC signature + the QR code's expiry + the QR code's single-use status. Returns the per-order's verification record. Marks the QR code as "used" in the per-order audit trail. The endpoint is the structural piece for the per-pickup-time verification event.

3.3 The per-business's Orb-Wallet scanner surface

The per-business's pickup-time staff uses one of two scanner surfaces: (a) a small per-business-side app on the staff's phone, OR (b) a per-business-staff Orb-Wallet dashboard on a tablet at the pickup window. The scanner surface is the structural piece that makes the QR-code architecture operational at the per-business. The scanner surface is the per-business's pickup-time verification piece.

4. The EBT-aware split-tender extension (per-small-grocer vertical)

The per-small-grocer vertical adds a third new endpoint: /wp-json/orb-wallet/v1/ebt-split-tender. The endpoint handles the EBT / credit-card split-tender flow that connects the per-small-grocer to the named population (per standing instruction #19: stay-at-home moms, shut-ins, the unemployed, the retired).

POST /wp-json/orb-wallet/v1/ebt-split-tender
Content-Type: application/json
Authorization: Bearer <member_token>

{
  "order_id": "ord_2026_10_05_abc123",
  "ebt_amount": 2500,     // $25.00 from EBT / SNAP
  "credit_amount": 2000,  // $20.00 from credit card
  "bp_redeemed": 500      // $5.00 from Brownie Points (optional)
}

Response 200 OK:
{
  "ebt_processed": 2500,
  "credit_processed": 2000,
  "bp_redeemed": 500,
  "total_processed": 4500,
  "ebt_merchant_id": "ebt_store_xyz_1234",
  "nuvei_charge_id": "ch_abc123",
  "bp_balance_after": 50,
  "qr_code": "base64:eyJvcmRlcl9pZCI6Im9yZF8yMDI2...",
  "status": "ready_for_pickup"
}

The EBT / SNAP processing routes through the per-small-grocer's EBT merchant (Nuvei supports EBT / SNAP through merchant category code MCC 5411 for grocery). The credit portion routes through Nuvei hosted-fields. The Brownie-Points redemption routes through the BP-redemption endpoint. The three pieces combine for a single per-order audit-trail. The per-order QR code is generated after the split-tender completes.

Why the EBT piece matters. The EBT / SNAP processing is the load-bearing piece that connects the per-small-grocer to the named population. A per-small-grocer in a low-income neighborhood that accepts EBT + Brownie Points + the charity-allocation default IS the per-Operation's quality-of-life surface made concrete. The per-small-grocer is the per-Operation's Foundation standing instruction made operational. The operator's GTM accelerates when the per-small-grocer says "yes" to EBT.

5. The three failure modes the QR-code architecture defends against

Failure mode 1: The customer shares the QR code with a friend to redeem a per-cart they didn't pay for.

Defense: The QR code is bound to the per-order's HMAC signature. The QR code is single-use. Once the per-business's staff scans the QR code, the QR code is invalidated in the per-order audit trail. A second scan returns "QR code already used" + the original scan's timestamp + staff ID. The single-use piece is the load-bearing piece for the QR-code architecture. The QR code's HMAC signature prevents forgery; the single-use state prevents sharing; the 24-hour expiry prevents long-tail abuse.
Failure mode 2: The per-business's pickup-time staff gives the per-cart to the customer without scanning the QR code.

Defense: The per-business's Orb-Wallet dashboard shows a "pending pickup" badge for every per-order that's paid but not picked up. The badge stays until the per-order is marked as picked up via the scanner. The per-business's end-of-day reconciliation surfaces every per-order that's pending pickup for >24 hours after the per-cart's pickup window. The per-business's owner sees the per-order's audit trail and can follow up with the customer. The "pending pickup" badge is the structural protection for the per-business's pickup-time verification discipline.
Failure mode 3: The QR code is screenshot-and-shared via text/email to claim the per-cart fraudulently.

Defense: The QR code is bound to the customer's verified identity (per standing instruction #26's verification-photo step). The per-business's staff confirms the customer's identity at pickup (name + ID + the customer's verification-photo). The per-business's staff marks the per-order as picked up. The customer's verification-photo is the structural protection for the QR-code's "the person holding the QR code is the person who paid" piece. A screenshot of the QR code alone is not enough; the per-business's staff confirms the person is the verified customer.
The structural protection pattern, named honestly. The QR code is the single-use token that bridges the per-checkout-time BP-redemption event to the per-pickup-time verification event. The HMAC signature prevents forgery. The single-use state prevents sharing. The 24-hour expiry prevents long-tail abuse. The per-business's pickup-time staff is the human-in-the-loop verification. The per-customer's verification-photo is the identity-binding piece. The per-order audit-trail is the durable record.

6. The connection to standing instructions #19, #20, and #30

Connection to standing instruction #19 (Foundation). The operation exists to create real income opportunities for people struggling to make ends meet. The named population: stay-at-home moms, shut-ins, the unemployed, the retired. The per-small-grocer's EBT / SNAP processing + Brownie-Points integration is the structural piece that makes the per-Operation's quality-of-life surface accessible to the named population. The per-small-grocer is the per-Operation's Foundation standing instruction made operational.
Connection to standing instruction #20 (BLESS and PROTECT manifesto). The honesty gap: institutional enemies will not announce themselves. The threat model: the per-pickup-time verification event is a real opportunity for institutional or individual fraud (per-cart claim disputes, customer disputes, staff disputes). The QR-code architecture is the structural protection for the per-pickup-time verification event. The per-order audit-trail is the durable record that protects all three parties (per-business / customer / operator) from fraud.
Connection to standing instruction #30 (ORB-Share Community). Brownie Points (BP) are the operation's quality-of-life surface. The fixed-rate 1 BP = $1.00 USD discipline. The per-Operation's currency surface at the simplest possible discipline. The QR-code architecture is the structural protection for the per-pickup-time verification of BP-redemption at any Orb-Community business — small grocer, restaurant, salon, or any future vertical. The QR code is the durable record of the per-Operation's currency in physical form.