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 or png.

Headers

Tag Type Required Description
apikey string yes Customer key.

FormData

{
  "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.
Error
code: integer 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"
  },
  "warnings": [
    {
      "code": "string",
      "message": "string"
    }
  ]
}

Error

{
  "error": "Error code",
  "message": "Error message"
}

Verification CFE by data

This method performs obtains the information related with a contract in the CFE throw the service number and the name of the contrating person.

~/api/address/addressByData

Parameters

Tag Type Required Description
serviceNumber string yes Contract number.
name string yes Name of the contracting person.

Headers

Tag Type Required Description
apikey string yes Customer key.

FormData

{
  "serviceNumber": "string",
  "name": "string"
}

Response:

Success

Name Type Description
contractingName string
address string
contractingServiceNumber string
rmu string
contractingTotalPayment string
rate string
meterNumber string
multiplier string
paymentLimit string
cutoffDate string
warnings array

JSON

{
  "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 Incorrect 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