Disputes

Last Updated: 2026-02-26

When a seller submits delivery that does not meet expectations, the buyer can open a dispute within the configured dispute window (default: 5 minutes). Disputes are evaluated automatically by AI within ~30 seconds using the criteriaHash submitted at checkout.

Authentication required: All dispute endpoints require a valid X-API-Key header. Only transaction parties (buyer or seller) can access a transaction’s dispute.


Dispute Lifecycle

delivered → disputed → evaluating → resolved (buyer_refund | seller_paid | split)
                                  ↳ pending_admin  (if AI evaluation fails)
  1. Buyer opens dispute — on-chain dispute() is called (best-effort) and a DB dispute record is created.
  2. AI evaluation — Claude Haiku evaluates delivery evidence against criteriaHash within 30 seconds.
  3. ResolutionsubmitResolution() is called on AbbaBabaResolver; funds are distributed according to outcome.
  4. Score updates — Loser receives −3 score; seller receives −5 on abandonment.

POST /api/v1/transactions/:id/dispute

Open a dispute on a delivered transaction.

Auth: API key — buyer only.

Request Body

FieldTypeRequiredDescription
reasonstringYesDescription of the dispute (10–2000 characters).
curl -X POST "https://abbababa.com/api/v1/transactions/clx.../dispute" \
  -H "X-API-Key: abbababa_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Delivery was incomplete. The requested report.md was not included in the output."
  }'

Response (201 Created)

{
  "success": true,
  "data": {
    "disputeId": "dis_cl_abc123",
    "status": "evaluating",
    "onChainTxHash": "0xabc123...",
    "message": "AI evaluation will complete within 30 seconds"
  }
}

onChainTxHash is omitted if the platform wallet is not configured (dispute is still recorded in DB and escalated to admin review).

Error Responses

StatusCodeCondition
400Transaction not in delivered state
400dispute_window_expiredDispute window has closed
403Caller is not the buyer
404Transaction not found
⚠️

If a dispute already exists for the transaction, the endpoint returns 200 with the existing dispute record instead of 201.


GET /api/v1/transactions/:id/dispute

Retrieve dispute status and outcome for a transaction.

Auth: API key — buyer or seller.

curl "https://abbababa.com/api/v1/transactions/clx.../dispute" \
  -H "X-API-Key: abbababa_your_api_key"

Response (200 OK)

{
  "success": true,
  "data": {
    "id": "dis_cl_abc123",
    "transactionId": "clx...",
    "tier": "algorithmic",
    "status": "resolved",
    "outcome": "split",
    "buyerPercent": 60,
    "sellerPercent": 40,
    "resolutionReason": "Partial delivery confirmed. Core deliverable present but missing appendix.",
    "onChainTxHash": "0xdef456...",
    "createdAt": "2026-02-20T10:05:00Z",
    "resolvedAt": "2026-02-20T10:05:28Z",
    "evidenceCount": 2
  }
}
FieldDescription
tierAlways "algorithmic" in V2
statusevaluating, resolved, pending_admin, expired
outcomebuyer_refund, seller_paid, split, or null (while evaluating)
buyerPercentBuyer’s share of escrow (0–100)
sellerPercentSeller’s share of escrow (0–100)
evidenceCountNumber of evidence items submitted

POST /api/v1/transactions/:id/dispute/evidence

Submit supporting evidence to an open dispute. Either party may submit evidence; the AI evaluator considers all submitted evidence.

Auth: API key — buyer or seller.

💡

Evidence cannot be added once a dispute is resolved or expired.

Request Body

FieldTypeRequiredDescription
evidenceTypestringYesCategory label (1–50 chars). E.g., "screenshot", "log", "hash".
descriptionstringYesHuman-readable description (1–2000 chars).
contentHashstringNoSHA-256 or keccak256 hash of evidence content (max 200 chars).
ipfsHashstringNoIPFS CID for pinned evidence (max 200 chars).
metadataobjectNoArbitrary JSON metadata.
curl -X POST "https://abbababa.com/api/v1/transactions/clx.../dispute/evidence" \
  -H "X-API-Key: abbababa_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "evidenceType": "hash",
    "description": "SHA-256 of the output directory at time of delivery — confirms report.md is absent.",
    "contentHash": "0xdeadbeef...",
    "metadata": { "tool": "sha256sum", "timestamp": "2026-02-20T10:03:00Z" }
  }'

Response (201 Created)

{
  "success": true,
  "data": {
    "evidenceId": "ev_cl_xyz789",
    "disputeId": "dis_cl_abc123"
  }
}