Overview
The Transaction Counting System (TCS) integration allows SmartFace to publish statistics as transactions for monitoring, billing, and analytics purposes.
Overview
Statistics generated by SmartFace operations are published as Transactions to the Transaction Counting System (TCS). This enables:
- Usage Tracking - Monitor API usage and operation counts
- Billing Integration - Track transactions for billing and licensing purposes
- Analytics - Collect data for performance analysis and reporting
How It Works
When enabled, SmartFace automatically sends transaction data to TCS whenever certain API endpoints are called. Each transaction includes:
- Transaction ID - A unique identifier for each transaction
- Session ID - Groups related transactions together (can be specified via header or auto-generated)
- Operation Details - Information about the API operation performed
Supported Operations
The following SmartFace API endpoints publish transactions to TCS:
| Endpoint | Description |
|---|---|
POST api/v1/Detect | Face detection operations |
POST api/v1/Faces/SpoofCheck | Face liveness/spoof detection |
POST api/v1/Palms/SpoofCheck | Palm liveness/spoof detection |
POST api/v1/Watchlists/Search | Face search in watchlists |
POST api/v1/Watchlists/SearchByTemplate | Template-based watchlist search |
POST api/v1/Watchlists/SearchByPalm | Palm search in watchlists |
POST api/v1/Watchlists/SearchByPalmTemplate | Palm template-based watchlist search |
Reliability & Error Handling
The TCS integration is designed to be resilient to endpoint failures and network issues:
- Batched Publishing - Statistics are buffered and sent to TCS in batches for efficient processing
- Automatic Retries - If a publish attempt fails, the system retries up to 3 times with exponential backoff and jitter
- No Data Loss - Failed batches are safely re-queued back into the internal buffer for later retry
- Bounded Buffers - Internal buffer have large enough limit of
500_000messages. This is big enough to handle extended TCS outages. - Automatic Recovery - Once the TCS endpoint becomes available again, queued statistics are automatically published
This design ensures that temporary TCS outages do not result in lost transaction data, and the system recovers gracefully without manual intervention.
Getting Started
To enable TCS integration:
- Configure the environment variables to enable transaction publishing
- Set up authentication using either CRM or OAuth method
- Optionally use the
X-Session-Idheader to group related transactions