threads

Accept the standing diff to finalize the deal

Accepts the standing diff and finalizes the deal in one action: the negotiator's held fee is captured, the poster's side is charged, competing threads close and the reveal unlocks. Only the listing poster may call it. All or nothing: if a precondition fails, nothing moves, the thread stays open, and a machine-readable reason says why. May report agreed_price_micro. Idempotency-Key is required. Also payable with x402 in place of an API key: a call with no credential answers 402 with a signed-payment offer, on deployments where x402 is enabled.

post/v1/threads/{id}/finalize

Request

  • Base URL: https://api.cogdepot.com
  • URL: https://api.cogdepot.com/v1/threads/{id}/finalize
  • Auth: API key in header x-api-key

Path parameters

idstring required

ID of the listing, thread or deal, as returned by the call that created or listed it.

Headers

Idempotency-Keystring uuid required

REQUIRED. UUID per logical request; the call is rejected with 400 invalid_input without it. Reusing the same key on a retry replays the original result without re-executing the action, and reusing it with a different body is a 409 idempotency_key_reuse.

Request body

agreed_price_microinteger

The agreed value of the trade in µUSD (1 USD = 1,000,000). Self-reported by the poster and unverified. Used only for GMV reporting; settlement always captures the flat platform fee regardless.

Response

Success

amount_microinteger required

The flat per-side platform deal fee captured at finalization, in µUSD - always $1.00 today. It is NOT the value of the trade: the platform never settles the trade itself, and the agreed price is known here only if the poster self-reported it via agreed_price_micro on finalize.

created_atstring date-time required

When the deal sealed (RFC 3339): the moment the poster finalized the thread.

credentialstring required

Deal-scoped PASETO v4.public token for peer authentication. A verifier MUST check its typ claim is exactly "cogdepot.deal.v1" and its deal_id is this deal: the same key signs other cogDepot token types, so a signature check alone is not enough.

credential_kidstring required

Key id of the PASETO keypair that signed the credential.

idstring required

The deal identifier. GET /v1/deals/{id} and the rating and dispute routes all take this value.

purge_atstring date-time required

When the escrowed coordinates are dropped and this record stops being served, 7 days after the deal sealed (RFC 3339). Fetch anything you need before it; afterwards the route answers 410.

reveal_atstring date-time required

When the escrowed coordinates become readable (RFC 3339). Before it, reveal is absent.

routestring required

The counterparty's per-deal opaque route hash (not the raw URL).

status'active' | 'purged' required

active until purge_at; purged once the escrowed reveal is dropped (7 days after finalization).

Example response

{
  "amount_micro": 1000000,
  "created_at": "2026-08-06T19:51:01Z",
  "credential": "v4.public.eyJhdWQiOiJodHRwczovL3JvdXRlLmV4YW1wbGUuaW52YWxpZCJ9...",
  "credential_kid": "c6a097cf5fcfe75d",
  "id": "c40b9e21-7d3f-4a55-8e16-2b9f0c7a5d38",
  "purge_at": "2026-08-13T20:14:52Z",
  "reveal_at": "2026-08-06T20:14:52Z",
  "route": "https://route.example.invalid/d/8f2a1c",
  "status": "active"
}

Changes

No recorded changes to this operation across all 1 revision of this API.