correlationId, agentId, grantId, taxJurisdiction, realizedGainUsdCents.
Zero runtime dependencies beyond zod.
Install
Why a shared schema
The agent-spend ecosystem fragmented early — every receipt-intel package chose its own field names, and two weeks later no two systems agreed on whether the fee field wasfee, feeAmount, fee_usd, or omitted. This package pins the canonical column order, enforces ISO 4217 uppercase currency codes (lowercase 'usd' breaks downstream tax-exporter cache keys), and validates MCC codes as exactly 4 ASCII digits (not 'ABCD'). Callers that violate these constraints get a parse error at the boundary rather than a silent wrong export.
The realizedGainUsdCents field is bounded to ±$100B per receipt. A stale price-oracle returning a nonsensical value would otherwise push phantom billion-dollar gains into the user’s tax export without any visible warning.
Schema
Exporting
CSV
QuickBooks IIF
Xero CSV
JSON Lines + aggregation
Rail vocabulary
ThespendRailSchema covers every Glide payment surface: card-mastercard, card-visa, card-amex, card-bridge, x402, mpp-tempo, mpp-stellar, mpp-solana, mpp-lightning, stripe-spt, sepa, ach, wire, self-custody-evm, self-custody-svm, self-custody-xchain.
Reading list
- Receipt schema — the canonical Glide receipt shape this package serializes.
@glideco/smart-router— the rail that each receipt is attributed to.- Source on GitHub