Documentation Index
Fetch the complete documentation index at: https://docs.txcloud.thetekcircle.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Idempotency ensures that making the same API request multiple times produces the same result. This is crucial for reliable integrations, especially when network issues cause request failures.How It Works
Include anIdempotency-Key header with a unique value for each logical request:
Idempotency-Key:
- First request: Processed normally, result stored
- Subsequent requests: Return cached result immediately
Using Idempotency Keys
Key Guidelines
Key Format
| Requirement | Example |
|---|---|
| Length | 10-255 characters |
| Characters | Alphanumeric, hyphens, underscores |
| Uniqueness | Must be unique per request type |
user_123_verify_2025-01-15T10:30:00Zorder_456_payment_attempt_1550e8400-e29b-41d4-a716-446655440000
Key Expiration
Idempotency keys are stored for 24 hours. After expiration:- The same key can be reused
- The request will be processed as new
Key Scope
Keys are scoped to:- Your API key
- The endpoint being called
Safe Retry Pattern
Implement retry logic with idempotency:Response Headers
When a cached response is returned, TXCloud includes:| Header | Description |
|---|---|
Idempotent-Replayed | true if response was cached |
X-Request-Id | ID of the original request |
Handling Conflicts
If you send the same key with different request bodies, you’ll get an error:Endpoints Supporting Idempotency
| Endpoint | Supports Idempotency |
|---|---|
POST /identity/verify | ✅ Yes |
POST /identity/sessions | ✅ Yes |
POST /transactions/score | ✅ Yes |
POST /lending/assess | ✅ Yes |
POST /kyb/verify | ✅ Yes |
POST /watchlist/screen | ✅ Yes |
GET endpoints | ❌ Already idempotent |
DELETE endpoints | ❌ Already idempotent |
Best Practices
Generate Keys Client-Side
Generate Keys Client-Side
Generate idempotency keys in your application, not in TXCloud. This ensures retries use the same key.
Include Context in Keys
Include Context in Keys
Make keys meaningful for debugging:
Store Keys for Debugging
Store Keys for Debugging
Log idempotency keys with your requests for troubleshooting.
Don't Reuse Keys Across Operations
Don't Reuse Keys Across Operations
Each logical operation should have its own key:
Example: Payment Processing
A common use case for idempotency is payment processing:API Reference
Learn more about request handling in the API Reference