> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simpuru.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Settle a disputed escrow from evidence

> Called by the protection watcher. The verdict rests on three facts the seller can't change after the lock:
the escrow's `input_hash` commits to this listing; `result_hash` = `sha256(lockTx + ";" + output)`;
`sha256(output)` = the listing's `contentHash`. Seller wins only if all three hold. Each escrow is paid once.



## OpenAPI

````yaml https://api.simpuru.xyz/openapi.json post /disputes/resolve
openapi: 3.1.0
info:
  title: Simpuru API
  version: 0.1.0
  summary: Buyer protection for AI agents paying with x402 on Cardano (preprod).
  description: >-
    Sellers list design prompts; each listing commits to the SHA-256 of its
    content.

    Buyers (people or agents) pay over **x402** on Cardano preprod, either
    **instant** (pay the seller)

    or **protected** (lock into our `vested_pay` escrow, released only if
    delivery checks out).


    Consumers: the web app (`apps/web`), the buyer agent and protection watcher
    (`apps/agent`), the MCP

    server (`apps/mcp`, hosted at `/mcp`), and the arbiter service
    (`apps/arbiter`, internal).


    Every on-chain claim can be checked on
    `https://preprod.cardanoscan.io/transaction/<hash>`.
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://api.simpuru.xyz
    description: Production (Cardano preprod)
  - url: http://localhost:4021
    description: Local `bun run dev` in apps/api
security: []
tags:
  - name: Account
    description: >-
      Sign in with a Cardano wallet (CIP-30 `signData`), then use the session as
      `Authorization: Bearer <token>`. Every account has a Simpuru wallet: a
      preprod wallet the platform holds for the owner, funded with tADA, that
      web purchases and the owner's agents spend from.
  - name: Catalogue
    description: Free listing data.
  - name: Paid content
    description: 'The x402 paywall: instant or escrow-protected.'
  - name: Purchases
    description: Purchase timelines, derived from chain by the seller agent.
  - name: MCP
    description: Model Context Protocol endpoint for agents (Claude Code, Cursor, ...).
  - name: Arbiter (internal)
    description: Dispute settlement service, `apps/arbiter`, port 4023. Not public.
  - name: System
    description: Health.
paths:
  /disputes/resolve:
    servers:
      - url: http://localhost:4023
        description: Arbiter service (internal)
    post:
      tags:
        - Arbiter (internal)
      summary: Settle a disputed escrow from evidence
      description: >-
        Called by the protection watcher. The verdict rests on three facts the
        seller can't change after the lock:

        the escrow's `input_hash` commits to this listing; `result_hash` =
        `sha256(lockTx + ";" + output)`;

        `sha256(output)` = the listing's `contentHash`. Seller wins only if all
        three hold. Each escrow is paid once.
      operationId: resolveDispute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ref:
                  type: string
                  pattern: ^[0-9a-f]{64}#[0-9]+$
                  description: Disputed escrow UTxO `txHash#index`.
                listing:
                  type: object
                  properties:
                    id:
                      type: string
                    contentHash:
                      type: string
                      pattern: ^[0-9a-f]{64}$
                      description: Lowercase hex SHA-256.
                  required:
                    - id
                    - contentHash
                output:
                  type: string
                  description: The delivered content, as received.
              required:
                - ref
                - listing
                - output
      responses:
        '200':
          description: Verdict and payout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolveResult'
        '400':
          description: Malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or wrong bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - arbiterToken: []
components:
  schemas:
    ResolveResult:
      type: object
      properties:
        status:
          type: string
          enum:
            - paid
            - signed
            - no_verdict
          description: '`signed` = decided, waiting for the dispute window (`opensAt`).'
        verdict:
          type: object
          properties:
            winner:
              type:
                - string
                - 'null'
              enum:
                - buyer
                - seller
                - null
            reason:
              type: string
            evidenceDeadline:
              type: string
            checks:
              type: object
              properties:
                escrowIsForListing:
                  type: boolean
                outputIsWhatSellerPosted:
                  type: boolean
                outputMatchesListing:
                  type: boolean
        payout:
          type: object
          properties:
            buyerLovelace:
              type: string
              pattern: ^[0-9]+$
              description: Amount in lovelace (1 tADA = 1,000,000).
            sellerLovelace:
              type: string
              pattern: ^[0-9]+$
              description: Amount in lovelace (1 tADA = 1,000,000).
        tx:
          type: string
          pattern: ^[0-9a-f]{64}$
          description: Cardano transaction hash.
        opensAt:
          type: string
          format: date-time
      required:
        - status
        - verdict
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    arbiterToken:
      type: http
      scheme: bearer
      description: '`ARBITER_TOKEN` shared with the watcher (24+ chars).'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.