Contents

Cookbook

Short patterns you can lift whole: each recipe is a page of prose around a runnable snippet, exercised in CI exactly as shown.

  • A promo with an expiry

    Grant marketing credit that spends first and claws itself back when the deadline passes.

  • An entitlement-gated feature

    Sell a SKU once, gate access on read.entitled, and revoke it when the money comes back.

  • A marketplace fee split

    One sale, several sellers: the fee off the top, shares in basis points, no unclaimed remainder.

  • Scheduled top-ups

    A recurring allowance from any timer, made safe by minting the idempotency key from the period.