Analyzer - Analyze Receipt

Extract field text and semantic values from a given receipt document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.

POST {endpoint}/formrecognizer/v2.1/prebuilt/receipt/analyze
POST {endpoint}/formrecognizer/v2.1/prebuilt/receipt/analyze?includeTextDetails={includeTextDetails}&locale={locale}&pages={pages}

URI Parameters

Name In Required Type Description
endpoint
path True

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).

includeTextDetails
query

boolean

Include text lines and element references in the result.

locale
query

Locale

Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).

pages
query

string[]

Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma.

Request Header

Media Types: "application/pdf", "application/json", "image/jpeg", "image/png", "image/tiff", "image/bmp"

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Request Body

Media Types: "application/pdf", "application/json", "image/jpeg", "image/png", "image/tiff", "image/bmp"

Name Type Description
source

string

File source path.

Responses

Name Type Description
202 Accepted

Request is queued successfully.

Headers

Operation-Location: string

Other Status Codes

ErrorResponse

Response entity accompanying non-successful responses containing additional details about the error.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Analyze receipt

Sample request

POST {endpoint}/formrecognizer/v2.1/prebuilt/receipt/analyze

Sample response

Operation-Location: {endpoint}/formrecognizer/v2.1/prebuilt/receipt/analyzeResults/3b1e6c5b-e113-4114-ab6b-ce65dfe8050f

Definitions

Name Description
ErrorInformation
ErrorResponse
Locale

Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).

SourcePath

Uri or local path to source data.

ErrorInformation

Name Type Description
code

string

message

string

ErrorResponse

Name Type Description
error

ErrorInformation

Locale

Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).

Name Type Description
en-AU

string

en-CA

string

en-GB

string

en-IN

string

en-US

string

SourcePath

Uri or local path to source data.

Name Type Description
source

string

File source path.