Skip to content

Event schema

An Agent Payment Event (APE) is the single format HalvorAI uses for every rail. You map your rail’s payload into it, sign it, and send it. For how the pieces fit, see events.

FieldRequiredPurpose
ape_versionYesThe schema version, currently 0.1.
idYesAn evt_ id. Also the idempotency key.
typeYespayment.requested, payment.authorized, payment.settled, payment.failed, payment.refunded or payment.disputed.
occurred_atYesWhen it happened, UTC, RFC 3339 with milliseconds.
environmentYestest or live.
sourceYesWhich producer signed this event.
agentYesThe agent that acted.
ownerYesThe party the agent acts for.
paymentYesThe rail, amount and status.
payeeYesWho was paid.
instructionNoA hash of the instruction, and an optional redacted summary. Instruction text is never sent.
instrumentNoThe card, token or wallet used.
evidenceNoNetwork proofs carried verbatim. See evidence.
relatedNoLinks to earlier events, such as the authorization a settlement follows.
labelsNoFree-form key and value tags.
  • Money is an integer. Minor units with an ISO 4217 currency, or atomic units with a CAIP-2 asset. Amounts travel as decimal strings. Never floats.
  • Rails are card, stripe, x402, mpp, stablecoin and bank_transfer, each with its own allowed rail_ref keys.
  • Signing. The event is signed as a detached EdDSA JWS over its RFC 8785 canonical form, and sent as { event, sig }.
  • No card numbers. An event with a card number is rejected with pan_detected.

The JSON Schema and worked examples are published with the project under schema/:

  • ape-v0.1.schema.json is the JSON Schema (draft 2020-12).
  • examples/ holds a Stripe Issuing authorization carrying an AP2 mandate, a failed Stripe payment, and a settled x402 payment.

You can check an event without sending it: POST /v1/events/validate, or halvor validate in the CLI.

Minor versions only add optional fields. Until 1.0 a minor version may still break compatibility, and the changelog will say so.