Overview
The Equifax integration provides comprehensive credit bureau services, enabling retrieval of credit reports, credit scores, debt analysis, and financial risk assessment for individuals and businesses in Ecuador.Architecture
The integration consists of three main components:- EquifaxService - HTTP client for API communication (
Services/ApiEquifax/EquifaxService.cs) - OAuthEquifaxTokenService - OAuth 2.0 token management
- ApiEquifaxRepository - Data persistence layer (
Services/ApiEquifax/ApiEquifaxRepository.cs)
Authentication
Equifax uses OAuth 2.0 Bearer token authentication:- Token is automatically managed by
OAuthEquifaxTokenService - Tokens are refreshed as needed
- All API requests include the Bearer token in the Authorization header
Service Methods
ObtenerReportePorIdentificacion
Retrieves a comprehensive credit report for an individual or business by their identification number. Location:Services/ApiEquifax/EquifaxService.cs:23-60
Parameters
Identification number (Cédula or RUC)
Document type. Options:
Cedula- National ID cardRUC- Tax identification numberPasaporte- Passport
Response Structure
The method returns aReporteCrediticio object containing:
Summary of the credit report
Financial inclusion score data
Primary credit score information
Over-indebtedness score analysis
Economic impact indicators
Historical credit score evolution
Historical creditor information
Historical estimated payment information
Historical commercial debt data
Historical financial debt data
Historical overdue commercial obligations
Historical overdue financial obligations
Debt values across three financial systems
Protests and payment defaults
Debt evolution in banking, cooperatives, and commercial sectors
Historical commercial debt details
Historical cooperative debt details
Historical banking debt details
Factors influencing the credit score
Entities that have queried this credit report
Repository Operations
TheApiEquifaxRepository provides database operations for caching and retrieving Equifax data.
Create
Stores a new Equifax report in the database.GetById
Retrieves an Equifax report by its ID.GetById30Valid
Retrieves an Equifax report only if it was created within the last 30 days.null if the record is older than 30 days.
Location: Services/ApiEquifax/ApiEquifaxRepository.cs:29-42
Update
Updates an existing Equifax report.Request Structure
The request to Equifax follows this structure:HTTP Configuration
The service configures HTTP headers for optimal compatibility:Error Handling
Success Response
Status Code:200 OK
Returns a complete ReporteCrediticio object.
Error Response
Throws an exception with detailed error information:Common Errors
- 401 Unauthorized: Invalid or expired OAuth token
- 404 Not Found: No credit report found for the identification
- 500 Internal Server Error: Equifax service unavailable
Data Persistence
Equifax reports are stored in theind_ac_apiequifax database table with:
- Automatic timestamp tracking (
CreatedAt,UpdatedAt) - 30-day validity period for cached data
- Full report data in JSON format
GraphQL Integration Example
While the service is primarily used internally, you can access Equifax data through client-related queries:Best Practices
- Cache Utilization: Use
GetById30Validto leverage cached reports within the 30-day window - Token Management: The OAuth token is automatically managed - no manual refresh needed
- Error Handling: Always implement try-catch blocks when calling Equifax services
- Rate Limiting: Be mindful of API call frequency to avoid rate limits
- Data Privacy: Equifax data contains sensitive financial information - ensure proper access controls
Configuration
Equifax service requires the following configuration inappsettings.json:
Performance Considerations
- First request: ~2-5 seconds (includes OAuth token acquisition)
- Cached request: Less than 100ms (database retrieval)
- Token refresh: Automatic, transparent to callers
- Response compression: Enabled via Accept-Encoding headers