Response Structure
All responses share a common structure:Success Responses
Full Success
When all enrichment modules succeed, theentities array contains all identified entities:
Partial Success
When some enrichment modules succeed and others fail:Working with the Entities Array
The entities array only contains identified entities. To check for a specific entity type, usefind:
Error Responses
When a request fails entirely:Error Response Handling
Errors are thrown as typed exceptions you can catch directly:Working with Enrichment Data
Merchant Data
Location Data
Category Data
Subscription Detection
Complete Processing Example
Best Practices
Always check success status first
Always check success status first
Before accessing data, verify
success === true.Handle partial results gracefully
Handle partial results gracefully
Don’t fail if some entities are missing. Use what’s available in the entities array.
Check entity existence before accessing data
Check entity existence before accessing data
Always use
entities.find(e => e.type === 'merchant') and check for null before accessing .data.Use confidence scores and reasons for display decisions
Use confidence scores and reasons for display decisions
Show confidence indicators to users or flag low-confidence results. Use reason tags for smarter decisions.
Store the requestId
Store the requestId
Keep the
meta.requestId for debugging and issue reports.Next Steps
Error Handling
Handle errors and edge cases
Confidence Scores
Interpret confidence values and reason tags