CFE validation service
Address service
Address service allows to validate a CFE document and get the structured data of residence and owner of the service contract. Also, the service consults directly in CFE to verify.
Web service description
Validate CFE document and address
This method performs the validation of the CFE document and obtains the information of the contract by OCR (Optical Character Recognition), verifies before the CFE if the contract number presented in the CFE address document.
~/api/address/cfe
Parameters
Tag |
Type |
Required |
Description |
imageFile |
file |
yes |
CFE image type .jpg, .jpeg, .png or .pdf. The minimum dimensions are 500x1010 and the maximum 4500x4500. |
v |
string |
yes |
Version of the API, Type number 2 for the last version of the service |
Tag |
Type |
Required |
Description |
apikey |
string |
yes |
Customer key. |
{
"imageFile": "file"
}
Response:
Name |
Type |
Description |
Correct: |
|
|
valid |
boolean |
"Success" |
data |
|
|
name: |
string |
Name of the CFE service contract owner. |
addressline1 |
string |
Street and number. |
addressline2 |
string |
Street reference. |
addressline3 |
string |
Suburb and postal code. |
addressline4 |
string |
City and state. |
payment |
double |
Total amount invoiced. |
period |
string |
Billed period. |
serviceNumber |
String |
Service contract number. |
paymentDeadline |
string |
Payment deadline. |
geocodeUrl |
string |
URL of the geographical location of the address. |
lat |
string |
Latitude. |
lng |
string |
Length. |
cfeData |
|
|
contractingName |
string |
Name of the service contrator. |
address |
string |
Address of the CFE service. |
contractingServiceNumber |
string |
Contract number of the CFE service. |
rmu |
string |
RMU (Registro Móvil de Usuarios) of the service. |
contractingTotalPayment |
string |
Total payment for the last month. |
rate |
string |
Rate of the service. |
meterNumber |
string |
Meter number of the CFE service. |
multiplier |
string |
Multiplier of the CFE service. |
paymentLimit |
string |
Last day for payment of the CFE service. |
cutoffDate |
string |
Day of cut of the service. |
Error |
|
|
code: |
string |
Error code. |
message |
string |
"Error message". |
JSON
{
"valid": "boolean",
"data": {
"name": "string",
"addressline1": "string",
"addressline2": "string",
"addressline3": "string",
"addressline4": "string",
"totalPayment": "double",
"period": "string",
"serviceNumber": "string",
"paymentDeadline": "string",
"geocodeUrl": "string",
"lat": "float",
"lng": "float"
},
"cfeData": {
"contractingName": "string",
"address": "string",
"contractingServiceNumber": "string",
"rmu": "string",
"contractingTotalPayment": "string",
"rate": "string",
"meterNumber": "string",
"multiplier": "string",
"paymentLimit": "string",
"cutoffDate": "string"
},
"warnings": [
{
"code": "string",
"message": "string"
}
]
}
Error
{
"error": "Error code",
"message": "Error message"
}
Verification CFE by data
This method obtains the information related with a contract in the CFE throw the service number, the name of the contrating person and the bill in string base64
~/api/address/cfe/byData
Parameters
Tag |
Type |
Required |
Description |
serviceNumber |
string |
yes |
Contract number. |
name |
string |
yes |
Name of the contracting person. |
Tag |
Type |
Required |
Description |
apikey |
string |
yes |
Customer key. |
{
"serviceNumber": "string",
"name": "string"
}
Response:
Success
Name |
Type |
Description |
valid |
bool |
info validated |
data |
object |
|
geolocation |
object |
|
geocodeurl |
string |
geocodeurl location |
lat |
string |
lat location |
lng |
string |
lng location |
file |
string |
base64 file |
cfeData |
object |
|
contractingName |
string |
contractingName found in the CFE source |
address |
string |
address found in the CFE source |
contractingServiceNumber |
string |
contractingServiceNumber found in the CFE source |
rmu |
string |
rmu found in the CFE source |
contractingTotalPayment |
string |
contractingTotalPayment found in the CFE source |
rate |
string |
rate found in the CFE source |
meterNumber |
string |
meterNumber found in the CFE source |
multiplier |
string |
multiplier found in the CFE source |
paymentLimit |
string |
paymentLimit found in the CFE source |
cutoffDate |
string |
cutoffDate found in the CFE source |
warnings |
array |
list of warnings |
code |
string |
warning code |
message |
string |
warning message |
JSON
{
"valid": true,
"data": {
"geolocation": {
"geocodeurl": "string",
"lat": "string",
"lng": "string"
}
},
"file": "string",
"cfeData": {
"contractingName": "string",
"address": "string",
"contractingServiceNumber": "string",
"rmu": "string",
"contractingTotalPayment": "string",
"rate": "string",
"meterNumber": "string",
"multiplier": "string",
"paymentLimit": "string",
"cutoffDate": "string"
},
"warnings": [
{
"code": "string",
"message": "string"
}
]
}
Error
Name |
Type |
Description |
code |
string |
Error code |
message |
string |
Error message |
{
"code": "Error code",
"message": "Error message"
}
Service messages
Code |
Message |
Description |
ADS001 |
Structure of data |
Indicates whether the request was successful or unsuccessful. If everything goes well, it will show the data correctly. |
ADS002 |
Failed to get data |
Message to show that no information was found or when the OCR could not be read, or the file has poor quality. |
ADS003 |
The file format is not correct |
Message displayed when the request contains an incorrect document, when there are files different than .png, .jpg or .pdf or when the document does not correspond to the standard format. |
ADS004 |
The quality of the file prevents the correct reading of the information. |
Message displayed when the document received does not corresponds to CFE. |
ADS005 |
The $0$ field is required. |
Message displayed when a request is received with null parameters or blank spaces. |
ADS006 |
The document is expired |
Message displayed when the document has expired. |
ADS007 |
File size is larger than expected |
Message displayed when the document exceeds 5MB. |
ADS008 |
There was a problem to get geolocation. |
Message displayed when the address could not be found by geolocation. |
ADS009 |
The apiKey is not valid |
Message displayed when the apiKey is incorrect. |
ADS010 |
Server response failed |
Message displayed when server response failed. |
ADS011 |
Response time has exceeded |
Message displayed when response time is exceeded. |
ADS012 |
Error load image |
Message displayed when the service cannot process the image received. |
ADS013 |
The document could not be read |
Message to show that no information was found or when the OCR could not be read |
ADS014 |
The URL is not valid |
Message that is displayed when an invalid URL is sent to confirm the existence of the document of CFE |
ADS015 |
Unable to validate document with source |
Mensaje para mostrar cuando no se puede realizar una comparación del OCR contra los datos en la CFE |
ADS016 |
The address line $0$ doesn't exactly match |
Message that is displayed when a line obtained by OCR does not match the CFE data |
ADS017 |
Authorization header is not valid |
Message that is shown when the authorization field does not match with a user - password |
ADS018 |
The document cannot be validated because the payment deadline has an invalid value. |
Message displayed when the CFE deadline cannot be read correctly |
ADS019 |
The serviceNumber field is required. |
Message displayed when the field serviceNumber is null or blank spaces. |
ADS020 |
The serviceNumber field format is not correct |
Message displayed when the field serviceNumber is not only numbers. |
ADS021 |
The name field is required. |
Message displayed when the field name is null or blank spaces. |
ADS022 |
The name field format is not correct |
Message displayed when the field name contains characters not alphanumeric. |
ADS023 |
There was a problem to validate the document. |
Message displayed when the service is temporarily unable. |
ADS024 |
No information was found with the data. |
Message displayed when the input data do not have information related |
ADS025 |
The information couldn't be verified in the CFE source. |
Message displayed when the service couldn't make the verification. |
ADS026 |
The address could not be read. |
Message displayed when the service couldn't get the address from the document. |
ADS027 |
The file does not have the minimum dimensions. |
Message that appears when the uploaded image does not have the minimum dimensions allowed (500x1010). |
ADS028 |
It is not an official document issued by CFE. |
Message that appears when the document is not issued by the CFE. |
ADS029 |
The image does not have a valid orientation. |
Message that appears when the document has the allowed orientation. |
ADS030 |
The file exceeds the maximum allowed dimensions. |
Message that appears when the document is larger than the allowed dimensions (4500x4500). |
ADS031 |
File Not Found. |
The bill is not available for download. |