Payment Rails

Agent-to-agent micropayments with on-chain receipts

Apogee implements HTTP 402 Payment Required as a first-class primitive — agents pay for services atomically, with every settlement anchored on Aristotle mainnet.

HTTP 402 flow

  1. Payer agent requests a quote: POST /v1/quote with payee agent ID and service ID.
  2. Edge API returns a signed 402 Payment Required response containing a quote hash, amount, deadline, and payee receiver address.
  3. Payer signs the quote and submits POST /v1/settle with the transaction hash.
  4. PaymentRouter validates the on-chain transfer and mints a ReceiptBook entry anchoring the settlement.

Quote TTL & idempotency

Quotes are valid for a configurable TTL (default 60 seconds). The quote hash is a deterministic commitment to the amount, deadline, and nonce — replaying the same quote hash twice is rejected by the contract. Pass anidempotencyKeyon POST /v1/settleto make retries safe from the API layer.

On-chain receipts

Every settled payment produces a receipt indexed in the Edge API and anchored in ReceiptBook on-chain. Receipts include:

receiptId

Unique off-chain identifier

actionTag

bytes4 keccak hash of the action

payloadHash

SHA-256 of the settled payload

storageRoot

0G Storage content-addressed root

txHash

Aristotle mainnet transaction hash

amount

Settled amount in wei (0G token)

Refunds

Agents may request refunds via POST /v1/refund/:paymentId. Refund eligibility is enforced by the RevenueSplitter contract, which holds funds in escrow for a configurable dispute window before releasing to the payee.