- Cloud OCR SDK Documentation
Quick Start GuidesThese guides will help you to start development with ABBYY Cloud OCR SDK.
API ReferenceThe description of API methods.
Code SamplesDemo samples show how to create a simple application with Cloud OCR SDK.
Sample ImagesHere you can download sample images in different languages.
Technical SpecificationsThe list of supported image formats, recognition languages, text types, etc.
FAQAnswers to commonly-asked questions about ABBYY Cloud OCR SDK.
Best PracticesGeneral recommendations on settings needed for the best recognition results.
Cloud OCR SDK Documentation
Important: the technology fully supports US receipts, other countries are currently supported in beta mode.
Use recommendations at ABBYY Technology Portal to gain the best result.
The method allows you to recognize the image of a receipt. The method loads the image, creates a processing task for the image with the specified parameters, and passes the task for processing.
The image file is transmitted in the request body. See the list of supported input formats.
See How to Recognize Receipts to know how to tune the parameters.
For details on task cost please see billing terms.
|Parameter||Is required||Default value||Description|
Specifies the country where the receipt was printed. This parameter can contain several names of countries separated with commas, for example "taiwan,china". The following values are supported:
Important! The technology fully supports US receipts, other countries are currently supported in beta mode.
Specifies the source of the image. It can be either a scanned image, or a photograph created with a digital camera. Special preprocessing operations can be performed with the image depending on the selected source. For example, the system can automatically correct distorted text lines, poor focus and lighting on photos.
The value of this parameter can be one of the following:
|correctOrientation||No||"true"||Specifies whether the orientation of the image should be automatically detected and corrected. It can have one of the following values:
|correctSkew||No||"true"||Specifies whether the skew of the image should be automatically detected and corrected. It can have either true or false value.|
|xml:writeExtendedCharacterInfo||No||"false"||Specifies whether the additional information on the recognized characters (e.g. whether the character is recognized uncertainly) should be written to an output file in XML format. The parameter can have one of the following values:
|description||No||""||Contains the description of the processing task. Must contain no more than 255 characters.|
|pdfPassword||No||""||Contains a password for accessing password-protected images in PDF format.|
Status codes and response format
General status codes and response format of the method are described in HTTP Status Codes and Response Formats.
The following status codes can be returned when this method is called:
|200||Successful method call.|
|450||Incorrect parameters have been passed. One of the following errors occurred:
|550||An internal program error occurred while processing the image.|
|551||An error occurred on the server side:
Output file format
The result of processing is returned in an XML file of the following format:
<?xml version="1.0" encoding="UTF-8"?>
<receipts count="1" xmlns="http://www.abbyy.com/ReceiptCaptureSDK_xml/ReceiptCapture-1.0.xsd">
See the XSD schema of an XML file.
You do not need to set the recognition languages for receipt recognition; they will be selected automatically on the basis of the countries you specify. See below the list of languages corresponding to countries.
|Brazil||Portuguese (Brazil); English|
Note that the receipt in one of these languages, but printed in some other country, is not guaranteed to be recognized correctly.
Description of receipt fields and attributes
The receipt tag can have several attributes which characterize the receipt as a whole.
The payment type of the purchase. Can have one of the following values:
|cardType||The type of the card used for payment. It only makes sense if purchaseType is Card.|
|currency||The three-character code of the currency of the receipt. If it is impossible to determine the code for dollar currency (e.g. if it is US dollar or Australian dollar), this property returns "$".|
|purchaseType||The purchase type. It can be a receipt from supermarket, fuel station, parking, etc.|
The receipt tag also contains field tags, line item tags, and a tag with the full recognized text of the receipt. Each field represents some type of data found on the receipt. Each line item represents a line of the receipt and can contain several components.
The following table describes fields which can be found on the receipt.
The total sum of the purchase.
|SubTotal||The subtotal of the receipt.|
|CardNumber||The number of the card which was used during purchase. It only makes sense if purchaseType is Card.|
The total sum of the tax.
One of the tax fields.
|Date||The date of the purchase.|
|Time||The time when the receipt was printed out.|
|Vendor||The title of the vendor organization.|
|Address||The address field of the receipt.|
|Phone||The phone number printed on the receipt.|
|Fax||The fax number printed on the receipt.|
The following table describes the components a line item may have.
|Line item component||Description|
The name of the purchased item.
The total amount of money in the receipt line.
The price per one item.