Queues & Retries
URA API downtime is inevitable. TaxBridge uses intelligent queuing and exponential backoff to ensure your invoices get fiscalized even when the government systems are struggling.
The Problem: Unpredictable URA
EFRIS is a critical government system, but it's not always available. Network issues, maintenance windows, and peak loads can cause failures that would otherwise lose your fiscal data.
- • Network timeout during T109 submission
- • URA server maintenance windows
- • Temporary cryptographic key issues
- • High load during tax season peaks
- • Transient database connectivity problems
The Solution: Resilient Processing
TaxBridge treats fiscalization as an asynchronous, retryable operation. When you confirm a TaxIntent, it enters a queue for processing with intelligent retry logic.
Queue Immediately
Your request returns instantly. Processing happens in the background.
Retry Automatically
Failed submissions retry with exponential backoff up to 24 hours.
Webhook Notification
Get notified when fiscalization succeeds or permanently fails.
Queue Processing Flow
When you confirm a TaxIntent, it goes through this resilient processing pipeline.
Queue Entry
TaxIntent status changes to "processing". Job enters Redis queue with priority.
Handshake Check
Verify cryptographic keys and session validity. Refresh if needed.
EFRIS Submission
Encrypt and submit T109 payload. Handle immediate success/failure.
Polling & Confirmation
For async responses, poll T111 until final status is determined.
Webhook Delivery
Notify your application of success or final failure.
Retry Strategy
TaxBridge uses exponential backoff with jitter to handle transient failures without overwhelming URA systems or creating thundering herd problems.
const RETRY_CONFIG = {
maxAttempts: 10,
initialDelay: 1000, // 1 second
maxDelay: 3600000, // 1 hour
backoffMultiplier: 2,
jitter: true
}; | Attempt | Delay | Cumulative Time | Success Rate |
|---|---|---|---|
| 1 | 1s | 1s | ~50% |
| 2 | 2s | 3s | ~75% |
| 3 | 4s | 7s | ~87% |
| 5 | 16s | 31s | ~97% |
| 10 | 17m | ~34m | ~99.9% |
Failure Classification
Not all failures should be retried. TaxBridge intelligently classifies errors to determine the appropriate response.
Webhook Notifications
Get notified asynchronously when your TaxIntents complete processing. Configure webhook URLs in your dashboard.
POST https://your-app.com/webhooks/taxbridge
Content-Type: application/json
{
"event": "tax_intent.succeeded",
"data": {
"id": "ti_xyz789",
"status": "succeeded",
"fdn": "1234567890",
"verification_code": "ABC123XYZ",
"qrcode": "base64_encoded_qr"
}
} POST https://your-app.com/webhooks/taxbridge
Content-Type: application/json
{
"event": "tax_intent.failed",
"data": {
"id": "ti_xyz789",
"status": "failed",
"last_error": "Network timeout after 10 retries"
}
} Monitoring & Observability
Track queue health and retry patterns through comprehensive logging and metrics in your dashboard.
Queue Metrics
Success Rates
Best Practices
Design for Async
Build your application to handle webhooks and status polling, not synchronous responses.
Monitor Queue Health
Set up alerts for queue depth and failure rates to catch issues before they impact users.
Handle Webhook Failures
Implement webhook retry logic in your application since TaxBridge expects 2xx responses.