VetoVetoDocs
Reference

Type contract

The shared TypeScript interfaces the whole protocol agrees on — money, catalog, mandates, verdicts, sessions, and the merchant receipt.

These are the authoritative shared types. Every module imports them; they never drift. All money is an exact decimal string, never a float.

Money & catalog

interface Price { amount: string; currency: string }

interface CatalogItem {
  sku: string;
  name: string;
  description?: string;
  price: Price;
  available: boolean;
  category?: string;
  unit?: string;
  metadata?: Record<string, unknown>;
}

interface CartTotal { currency: string; subtotal: string; tax: string; total: string }

Mandates & trust

type MandateType = 'veto' | 'ap2' | 'acp' | 'none';
type TrustTier = 'premium' | 'trusted' | 'standard' | 'cautious';
type ReputationTier = 'risky' | 'standard' | 'trusted' | 'elite';

interface MandateVerification {
  type: MandateType;
  valid: boolean;
  tier: TrustTier;
  subject?: string;        // replay-binding id
  agentId?: string;
  authorizedAmount?: string;
  merchantMatch?: boolean;
  intentText?: string;
  reasonCodes: string[];
}

Verdict & session

type AcceptanceDecision = 'accept' | 'reject' | 'hold';

interface AcceptanceVerdict {
  decision: AcceptanceDecision;
  tier: TrustTier;
  reasonCodes: string[];
  signals: { name: string; severity: 'info' | 'warn' | 'block'; reason: string }[];
  capApplied?: string;
}

type SessionState =
  | 'created' | 'awaiting_payment' | 'settling'
  | 'accepted' | 'rejected' | 'held' | 'expired';

Merchant receipt

interface MerchantReceiptClaims {
  iss: 'veto-checkout';
  sub: string;
  sessionId: string;
  iat: number;
  merchantId: string;
  agentId: string;
  decision: AcceptanceDecision;
  total: CartTotal;
  reasonCodes: string[];
  mandateType: MandateType;
  mandateRef?: string;     // ← buyer mandate subject
  policyHash: string;
  inputFingerprint: string;
}

The full set — including Rail, Facilitator, SessionStore, and CheckoutConfig — is re-exported from the package barrel. Import any of them from @veto-protocol/checkout.