> ## Documentation Index
> Fetch the complete documentation index at: https://open-fi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Cases

> Three canonical flows showing how OpenFi's pillars combine in practice.

<Info>
  Endpoint names below reflect current API scope. Steps involving the Data Oracle or Programmatic Escrow are marked **(V2)** since they are roadmap items, not live in the current API.
</Info>

## 1. Agentic Commerce & Autonomous Supply Chains

**Pillars used:** Identity & Anti-Bot Verification + Direct Debits (agentic) + Programmatic Escrow (V2)

An autonomous procurement agent sources physical goods from an on-chain factory bot.

<Steps>
  <Step title="Verify the counterparty">
    Before paying, the agent checks the factory bot's [Verifiable Credential](/api-reference/identity/overview) to confirm it's backed by a real, KYC'd commercial entity, not a spoofed wallet.
  </Step>

  <Step title="Lease a session key">
    The buyer's treasury issues a session key scoped to a mandate (e.g. "up to \$2,000/day for procurement").
  </Step>

  <Step title="Fund escrow, just-in-time">
    **(V2)** Rather than pre-funding, a debit pull routes cleared funds directly into a Programmatic Milestone Escrow.
  </Step>

  <Step title="Release on milestones">
    **(V2)** Funds release in tranches as delivery milestones are cryptographically attested (e.g. proof of material acquisition, then proof of delivery). Failed milestones trigger an automatic rollback to the payer.
  </Step>
</Steps>

## 2. Treasury Auto-Rebalancing

**Pillars used:** Direct Debits (agentic) + Data Oracles (V2) + Atomic Clearing

A treasury smart contract automatically rebalances between a bank account and multi-chain stablecoin yield positions.

<Steps>
  <Step title="Establish the mandate">
    `POST /v1/mandates` sets the ceiling and cadence the treasury bot may rebalance within.
  </Step>

  <Step title="Read on-chain posture">
    **(V2)** A Data Oracle call normalizes the enterprise's DeFi yield and staked balances into a single feed.
  </Step>

  <Step title="Verify off-chain posture">
    **(V2)** A ZK-TLS oracle call attests to the bank ledger balance without exposing raw statement data on-chain.
  </Step>

  <Step title="Pull within limits">
    `POST /v1/session-keys` then `POST /v1/debit-pulls` execute the rebalance, enforced against the on-chain [Allowance State Machine](/essentials/allowance-state-machine) rather than a static approval.
  </Step>
</Steps>

## 3. Corporate Invoicing & Automated Payables

**Pillars used:** Direct Debits + Atomic Clearing

A consultancy owes a Web3 infrastructure firm €25,000 for services rendered, invoiced in EURC.

<Steps>
  <Step title="Approve the invoice">
    The payer approves inside their existing accounting dashboard.
  </Step>

  <Step title="Pull trigger">
    OpenFi calls `POST /v1/payments` with `source: bank_account`, `destination: wallet`, initiating a bank pull (e.g. SEPA Instant) via the relevant Open Banking rail.
  </Step>

  <Step title="Atomic clearing">
    The instant the fiat clears into OpenFi's settlement account, stablecoin is minted and routed to the destination wallet in the same atomic operation. See [Atomic Clearing & Escrows](/essentials/atomic-clearing).
  </Step>

  <Step title="Reconciliation">
    The payment's `reference` field carries the invoice ID back to both parties' systems, closing the loop without manual bookkeeping.
  </Step>
</Steps>
