CFE-OCR Services

Web Service description

Classification and OCR of CFE files.

The service classifies and generates the OCR for a CFE file; this data is used to obtain the geolocation, delivering a JSON response to the obtained data.

~/api/OCRCfe

Parameters.

Tag Type Required Description
cfeFile file yes CFE image type .jpg, .jpeg, .png or .pdf
crossBr bool no Indicates to ocr extract barcode data (default: false)

Headers.

Tag Type Required Description
apikey string yes Customer key.

FormData.

{
  "cfeFile": "file"
}

CURL

curl -X POST "~/api/OCRCfe?crossBr=false" \
  -H "accept: application/json" \
  -H "apikey: {YOUR_API_KEY}" \
  -H "Content-Type: multipart/form-data" \
  -F "cfeFile=@path_to_your_file"

Response.

Response:

Name Type Description
name string Name of the service owner
service string Number of service
address string Physical address of the property
rmu string rmu of the service owner
totalPay string Total cost to be paid on the receipt
paymentLimit string Payment deadline
cutoffDate string Service cut-off date
period string Period used for billing
rate string Consumer type tariff rate
rmu_bc string rmu in the barcode zone
barcode string barcode of the receipt
lat float The number of latitude
lng float The number of longitude
url float The url of geolocation
warnings array Array of objects with corresponding warnings

JSON.

  {
    "name": "",
    "service": "",
    "address": "",
    "rmu": "",
    "totalPay": "",
    "paymentLimit":"",
    "cutoffDate": "",
    "period": "",
    "rate": "",
    "rmu_bc": "",
    "barcode": "",
    "lat": 0.0,
    "lng": 0.0,
    "url": "",
    "warnings": [
      {
        "code": "string",
        "message": "string"
      }
    ]
  }

Service Messages.

Code Message Description HTTP code
CFE001 file is required The request does not include the required file. 400
CFE002 Maximum allowed file size is 5mb The uploaded file exceeds the maximum allowed size of 5 MB. 413
CFE003 Something was wrong, We are working on the failure An internal server error occurred while processing the request. 500
CFE004 Incorrect document The uploaded document is invalid or not supported. 422
CFE005 File upload error An error occurred while uploading the file. 500
CFE006 Json decode error An error occurred while decoding the JSON payload. 400
CFE007 Invalid json response The generated JSON response is invalid or malformed. 400
CFE008 Error processing PDF An error occurred while processing the PDF document. 400
CFE009 Error decoding image An error occurred while decoding the image file. 400
CFE011 Internal error An unexpected internal error occurred. 500
CFE012 Missing date of issue The issue date could not be found in the document. 400
CFE013 Error in geolocation configuration A configuration error occurred in the geolocation service. 400
CFE014 No information was found for this address. No records were found for the provided address. 422
CFE015 Connection failed Failed to establish a connection with the external service. 500
CFE016 error in decoding geolocation An error occurred while decoding geolocation data. 400
CFE017 The service only accepts file extension pdf, jpg, jpeg, png The uploaded file format is not supported. 400
CFE018 The document is incomplete The uploaded document is incomplete or missing information. 422
CFE019 Geolocation Service Error The geolocation service returned an error. 502
CFE020 Invalid address provided The provided address is invalid or could not be verified. 422
CFE037 The CFE service is currently unavailable, please try again later. The CFE service is temporarily unavailable. 500
CFE038 Service number from barcode does not match OCR service number. The service number extracted from the barcode does not match the OCR result. 200
CFE039 Payment limit from barcode does not match OCR payment limit. The payment limit extracted from the barcode does not match the OCR result. 200
CFE040 Total payment from barcode does not match OCR total payment. The total payment extracted from the barcode does not match the OCR result. 200
CFE041 Mismatch between RMU data and RMU Barcode. The RMU data does not match the RMU barcode information. 200
CFE042 No valid barcode found for cross-validation. No valid barcode was found to perform cross-validation. 200