REST API with 'processReceipts'' serverUrl


I was trying out the sample code for the Python implementation of ABBYY OCR SDK ( Specifically, I was trying to make use of the processReceipt method, to extract fields from a receipt and get an XML file I can parse later on. 

In, I changed the ServerUrl (line 38) to 
"" (as per this guide: then I uploaded a sample receipt file (JPG file), but got the following error: 

 File "", line 111, in <module>


  File "", line 105, in main

    recognize_file(source_file, target_file, language, output_format)

  File "", line 39, in recognize_file

    task = processor.process_image(file_path, settings)

  File "C:\Users\domer\Desktop\receipt_separation\ABBY OCR SDK\", line 65, in process_image

    task = self.decode_response(response.text)

  File "C:\Users\domer\Desktop\receipt_separation\ABBY OCR SDK\", line 94, in decode_response

    dom = xml.dom.minidom.parseString(xml_response)

  File "C:\Users\domer\AppData\Local\Programs\Python\Python38-32\lib\xml\dom\", line 1969, in parseString

    return expatbuilder.parseString(string)

  File "C:\Users\domer\AppData\Local\Programs\Python\Python38-32\lib\xml\dom\", line 925, in parseString

    return builder.parseString(string)

  File "C:\Users\domer\AppData\Local\Programs\Python\Python38-32\lib\xml\dom\", line 223, in parseString

    parser.Parse(string, True)

xml.parsers.expat.ExpatError: not well-formed (invalid token): line 22, column 59

I've tried "" previous to the one above, and was able to successfully extract the text. 


py "receipt.jpg" results.txt


Id = abe4beb8-5a05-48a9-9f13-4dab3f0abe05

Status = Queued



Status = Completed

Result was written to results.txt


Any ideas how I can best approach this problem? 






Was this article helpful?

0 out of 0 found this helpful


1 comment

  • Avatar

    Hi again! So apparently, I only needed to change the method name in line 60 of (as below).  The problem now is I can't seem to access the v2 of this API (i.e. "v2/processReceipt), which I am curious to check whether it will give me better output for the receipt field extraction.

    I am using the free trial version of the SDK, so could it be possible that that's the reason for the forbidden HTTP request exception I am getting?

    request_url = self.get_request_url("processReceipt")



Please sign in to leave a comment.