Skip to main content
Follow these best practices to get the most out of the Triqai API while building reliable, efficient integrations.

Data Quality

Send Complete Transaction Data

Include the full, original transaction string:

Use Accurate Country Codes

The country code significantly affects matching accuracy:
  • Use the transaction’s origin country, not user’s country
  • Use ISO 3166-1 alpha-2 codes (US, NL, GB)
  • Default to account country if unknown

Set Correct Transaction Type

The type field affects category selection:

Performance Optimization

Deduplicate Similar Transactions

Group identical transactions before enriching to save credits:

Rate Limit Management

Rate limits are handled automatically via retries and Retry-After header support. You can monitor usage through the debug hook:
For full rate limit details on a response, use raw requests:

Error Handling

Built-In Retry Logic

Retries are handled automatically with exponential backoff on transient errors (429, 500, 503, 504). You can customize the behavior:
For POST requests, retries only happen when an idempotencyKey is provided:

Handle Partial Results

Don’t discard partial results — use available data:

Security

Protect API Keys

  • Store keys in environment variables
  • Never commit keys to version control
  • Use separate keys for dev/staging/prod
  • Rotate keys periodically

Make Requests Server-Side

Never expose your API key in client-side code:

Monitoring and Observability

Track Key Metrics

Monitor these metrics for your integration:

Structured Logging

Use the debug hooks for structured logging:

Architecture Patterns

Async Processing for Bulk Data

For large volumes, process asynchronously:

Graceful Degradation

Design for partial failures:

Checklist

Use this checklist when building your integration:
  • API key stored securely in environment
  • Full transaction strings sent, not truncated
  • Caching implemented for duplicate transactions
  • Retry logic with exponential backoff
  • Rate limiting handled gracefully
  • Partial results processed correctly
  • Errors logged with requestId
  • Metrics and monitoring in place
  • Credit usage tracked

Next Steps

Error Handling

Comprehensive error handling guide

Rate Limits

Manage request limits effectively