AltScore
Borrower Central (BC)/Integrations

SRI Integration API

This API allows integration with the Internal Revenue Service (SRI) of Ecuador. It provides endpoints for:

  • Verify credentials (RUC, additional identification, and password).
  • Start extraction of electronic vouchers in the SRI.
  • Check the extraction status of electronic vouchers.

Endpoints

1. Verify credentials in SRI

POST /v1/integrations/sri/credentials

Summary
Verifies the credentials (RUC, additional identification, and password) in the SRI.

Description
Sends the RUC, additional identification (optional), and password to be used to access the SRI.

Input Parameters

ParameterDescriptionTypeRequiredExample
rucUnique Taxpayer RegistryStringYes"0000000000000"
additionalIdentificationAdditional identification (e.g., taxpayer's ID)StringNo"0000000000"
passwordPassword to access the SRIStringYes"S3cr3tP4ss!"

Request Example

{
  "ruc": "0000000000000",
  "additionalIdentification": "0000000000",
  "password": "S3cr3tP4ss!"
}

Responses

CodeDescription
201Credentials successfully registered
401Incorrect credentials or insufficient permissions

In case of error (401), the response will include a JSON object with the descriptive message, for example:

{
  "message": "invalid credentials"
}

or

{
  "message": "not enough permissions"
}

2. Start voucher extraction in the SRI

POST /v1/integrations/sri/extractions/start

Summary
Starts the extraction of electronic vouchers in the SRI, querying by RUC.

Description
Receives data to start the extraction of electronic vouchers in the SRI from a given RUC and date.

Input Parameters

ParameterDescriptionTypeRequiredExample
rucUnique Taxpayer RegistryStringYes"9999999999001"
dateToAnalyzeDate to analyze (format YYYY-MM-DD)StringYes"2024-01-01"
daysOfToleranceNumber of tolerance days for extraction (e.g., 15)IntegerNo15

Request Example

{
  "ruc": "9999999999001",
  "dateToAnalyze": "2024-01-01",
  "daysOfTolerance": 15
}

Responses

CodeDescription
200Extraction started successfully

If the data is already extracted, the response will be:

{
  "message": "Data is already up to date."
}

2. Check voucher extraction in the SRI

POST /v1/integrations/sri/extractions/check

Summary Checks the extraction status of electronic vouchers in the SRI, querying by RUC.

Description Receives data to verify if the information of electronic vouchers in the SRI is being extracted (or has been extracted).

Input Parameters

ParameterDescriptionTypeRequiredExample
rucUnique Taxpayer RegistryStringYes"9999999999001"
dateToAnalyzeDate to analyze (format YYYY-MM-DD)StringYes"2024-01-01"
daysOfToleranceNumber of tolerance days for extraction (e.g., 15)IntegerNo15

Request Example

{
  "ruc": "9999999999001",
  "dateToAnalyze": "2024-01-01",
  "daysOfTolerance": 15
}

Responses

CodeDescription
200Successful operation

The response body will include a JSON object with the extraction status, for example:

{
    "ruc": "9999999999001",
    "date_from": "2024-01-01",
    "date_to": "2024-01-01",
    "has_coverage": true,
    "has_running_extractions": false
}

Error Handling

In addition to the specific responses for each endpoint, the API may return the following error codes:

CodeDescription
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error

Errors will include a descriptive message in the response body, for example:

{
  "message": "Error description"
}

On this page