---
title: "Confirm swap execution with on-chain tx hash"
method: POST
path: "/agents/confirm"
tags: ["Swap"]
---

# Confirm swap execution with on-chain tx hash

`POST /agents/confirm`

## Request

- Base URL: `https://www.farmdash.one/api`
- URL: `https://www.farmdash.one/api/agents/confirm`
- Auth: one of:
  - HTTP bearer
  - none

After broadcasting the swap transaction, confirm it here with the tx hash.
FarmDash verifies the transaction on-chain (10s timeout with LRU cache)
and marks the fee event as settled. Idempotent — safe to retry.

## Headers

- `X-ClawHub-Skill` string

## Request body

- ConfirmRequest
  - `sessionId` string, required: Owning FarmDash session id (the session that owns the fee event).
  - `agentAddress` string, required: Session owner / customer wallet address.
  - `sessionToken` string: Optional in this raw-HTTP schema: the session credential may be sent in the request body or via the X-FarmDash-Session-Token header. It authenticates the FarmDash session only; it is not wallet signing or transaction authority, and FarmDash never broadcasts the swap on the caller's behalf.
  - `feeEventId` string, uuid, required: FarmDash fee-event id associated with the prepared swap.
  - `txHash` string, required: On-chain transaction hash, which exists only after the customer-controlled wallet broadcast. A transaction hash alone is not confirmation: FarmDash verifies the canonical receipt/finality and the expected fee transfer before durable settlement is recorded.

## Response `200`

Confirmation result

- ConfirmResponse
  - `ok` boolean
  - `feeEventId` string, uuid
  - `settlementStatus` 'confirmed' | 'pending' | 'expired'
  - `idempotent` boolean: True if this was a duplicate confirmation (safe to retry)

## Other responses

- `400`: Malformed or invalid confirmation input.
- `401`: Missing or malformed session token.
- `402`: Free-tier limit exceeded — x402 payment required
- `403`: Ownership or token authorization failure.
- `404`: Session not found or expired.
- `409`: Settlement conflict. Either the exact expected fee transfer failed verification, or the fee event was already confirmed using a DIFFERENT transaction hash (code already_confirmed_conflict). In the latter case the existing settlement is NOT replaced, and this is not a retry-with-the-new-hash condition.
- `429`: Rate limit exceeded
- `502`: Unexpected internal confirmation failure (typed dust_storm). Settlement was not recorded.

---

[API](https://skmtc.dev/farmdash/apis/farmdash-agent-api.md) · [All operations](https://skmtc.dev/farmdash/apis/farmdash-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/farmdash/apis/farmdash-agent-api/revisions/96310281f58c?raw)
