Form OCR
Service that extracts fields from non-identifying printed documents: invoices, receipts and generic PDFs.
It is an exclusively online service: source only accepts the value FILE, and has no header operation-id and its assets do not participate in the operation cycle. A printed document is identified by its issuer (issuerCode) and not by its country.
Endpoint
POST /form/ocrHeaders
consumer-id
string
Yes
Consumer identifier.
Request body
Content-Type: application/json
Parameters
source
string
Yes
Only FILE. Any other value is rejected with 400.
files
array
Yes
Pages of the printed document in order, in Base64. A printed document can have any number of pages.
formType
string
Yes
Printed document type: INVOICE or PDF.
issuerCode
string
Yes
Issuer code of the printed document, agreed with the issuer. It is not a country code.
retrieveImages
boolean
No
Returns the cropped images in the response. By default false.
Request example
Responses
200 Success
Response parameters
serviceResultCode
integer
Code indicating the overall result of the service execution. 0 is success.
serviceResultLog
string
Descriptive field for the result of the service execution.
serviceTransactionId
string
Transaction identifier associated with the processed request.
serviceTime
string
Total processing time (milliseconds).
timestamp
string
Moment when processing finished, in format ISO 8601.
serviceResult
object
OCR result with the fields extracted from the printed document.
FORM_OCR is its own provisioning, separate from DOCUMENT_OCR. A consumer that processes invoices needs this service to be enabled.
Other responses
400
source different from FILE, formType unknown, or required field missing.
401
Missing, invalid, or expired Token.
403
The consumer is not provisioned with the service FORM_OCR.
429
The consumer has exceeded its request rate limit. The response includes Retry-After with the wait seconds, and X-RateLimit-Limit and X-RateLimit-Burst with the current thresholds.
The body of an error response has the form described in MIDAPI v2.
Last updated