Contract Templates
Templates are pre-configured verification contracts that reduce friction and ensure deterministic settlement. Choose a template, fill in the inputs, and FinalTX handles verification automatically.
Verification Modes
FinalTX makes HTTP requests to verify the seller's endpoint returns expected responses.
Seller posts completion data to a FinalTX callback URL. Great for async jobs.
FinalTX sends a challenge to the seller's endpoint and verifies the response.
Core Principles
Verification decides settlement
The buyer cannot manually approve or reject after delivery. The contract verification is final.
Deterministic by design
No human judgment in verification. Same input always produces same outcome.
Caps enforce safety
Timeouts, response size limits, and retry caps prevent abuse and keep costs predictable.
Official Templates
API Usage
List templates
GET /v1/templates/contracts
GET /v1/templates/contracts?mode=http
GET /v1/templates/contracts?tag=healthcheck
GET /v1/templates/contracts?q=callbackGet template details
GET /v1/templates/contracts/http-json-healthcheck-v1Create contract from template
POST /v1/contracts/{contract_id}/versions/from-template
Headers:
Authorization: Bearer sk_live_...
Idempotency-Key: unique-key-123
Content-Type: application/json
Body:
{
"template_id": "http-json-healthcheck-v1",
"inputs": {
"base_url": "https://api.example.com",
"path": "/health",
"expected_status": 200,
"max_latency_ms": 1500,
"required_json_paths": ["$.status", "$.version"]
}
}
Response:
{
"data": {
"contract_version_id": "cv_...",
"contract_hash_sha256": "abc123...",
"version_number": 1,
"template_id": "http-json-healthcheck-v1",
"contract_json": { ... }
}
}When to Use What
| Use Case | Recommended Template | Why |
|---|---|---|
| API deployment verification | http-json-healthcheck-v1 | Quick smoke test, low friction |
| Long-running job completion | callback-job-receipt-v1 | Async-safe, no polling needed |
| File/artifact delivery | callback-artifact-url-head-v1 | Validates without downloading |
| API spec conformance | http-endpoint-schema-v1 | Strict JSON Schema validation |
| Integration testing | webhook-smoke-challenge-v1 | Proves bidirectional connectivity |