OCR

Run OCR (Sync)

POST
Run OCR on an Base64 encoded image or PDF. This endpoint will block until the OCR is complete.

Query parameters

vendorNetworkenumOptional
Limit OCR vendor search to a specific network
Allowed values: allplatformentity
entityIdstringOptional
When using the Entity vendor network, specify the entity to use if. EntityId on an auth token will take precedence over this parameter.

Request

This endpoint expects an object.
mimeType
stringRequired
MIME type of the image. Supported types are image/png, image/jpeg, and application/pdf.
image
stringRequired
Base64 encoded image or PDF. PNG, JPG, and PDF are supported. 10MB max.

Response

This endpoint returns an object
invoice
object
vendor
object
check
objectOptional
bankAccount
objectOptional
POST
$curl -X POST "https://api.mercoa.com/ocr?vendorNetwork=all&entityId=string" \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "mimeType": "string",
> "image": "string"
>}'
Response
1{
2 "invoice": {
3 "id": "string",
4 "status": "DRAFT",
5 "paymentDestinationConfirmed": true,
6 "hasDocuments": true,
7 "hasSourceEmail": true,
8 "approvers": [
9 {
10 "approvalPolicyId": "string",
11 "approvalSlotId": "string",
12 "action": "NONE",
13 "eligibleRoles": [
14 "string"
15 ],
16 "eligibleUserIds": [
17 "string"
18 ],
19 "date": "2023-01-01T00:00:00Z",
20 "assignedUserId": "string"
21 }
22 ],
23 "approvalPolicy": [
24 {
25 "id": "string",
26 "trigger": [
27 {
28 "type": "amount",
29 "amount": 1,
30 "currency": "AED"
31 }
32 ],
33 "rule": {
34 "type": "approver",
35 "identifierList": {
36 "type": "rolesList",
37 "value": [
38 "string"
39 ]
40 },
41 "numApprovers": 0
42 },
43 "upstreamPolicyId": "string"
44 }
45 ],
46 "metadata": {
47 "string": "string"
48 },
49 "createdAt": "2023-01-01T00:00:00Z",
50 "updatedAt": "2023-01-01T00:00:00Z",
51 "amount": 1,
52 "currency": "AED",
53 "invoiceDate": "2023-01-01T00:00:00Z",
54 "deductionDate": "2023-01-01T00:00:00Z",
55 "settlementDate": "2023-01-01T00:00:00Z",
56 "dueDate": "2023-01-01T00:00:00Z",
57 "invoiceNumber": "string",
58 "noteToSelf": "string",
59 "serviceStartDate": "2023-01-01T00:00:00Z",
60 "serviceEndDate": "2023-01-01T00:00:00Z",
61 "payerId": "string",
62 "payer": {
63 "id": "string",
64 "name": "string",
65 "email": "string",
66 "isCustomer": true,
67 "accountType": "business",
68 "profile": {
69 "business": {
70 "legalBusinessName": "string",
71 "taxIDProvided": true,
72 "email": "string",
73 "businessType": "soleProprietorship",
74 "phone": {
75 "countryCode": "string",
76 "number": "string"
77 },
78 "doingBusinessAs": "string",
79 "website": "string",
80 "description": "string",
81 "address": {
82 "addressLine1": "string",
83 "city": "string",
84 "stateOrProvince": "string",
85 "postalCode": "string",
86 "addressLine2": "string",
87 "country": "string"
88 },
89 "ownersProvided": true
90 },
91 "individual": {
92 "name": {
93 "firstName": "string",
94 "lastName": "string",
95 "middleName": "string",
96 "suffix": "string"
97 },
98 "birthDateProvided": true,
99 "governmentIDProvided": true,
100 "email": "string",
101 "phone": {
102 "countryCode": "string",
103 "number": "string"
104 },
105 "address": {
106 "addressLine1": "string",
107 "city": "string",
108 "stateOrProvince": "string",
109 "postalCode": "string",
110 "addressLine2": "string",
111 "country": "string"
112 }
113 }
114 },
115 "status": "unverified",
116 "acceptedTos": true,
117 "isPayor": true,
118 "isPayee": true,
119 "createdAt": "2023-01-01T00:00:00Z",
120 "updatedAt": "2023-01-01T00:00:00Z",
121 "foreignId": "string",
122 "emailTo": "string",
123 "emailToAlias": [
124 "string"
125 ]
126 },
127 "paymentSource": {
128 "type": "bankAccount",
129 "accountName": "string",
130 "accountNumber": "string",
131 "accountType": "CHECKING",
132 "bankName": "string",
133 "createdAt": "2023-01-01T00:00:00Z",
134 "id": "string",
135 "isDefaultDestination": true,
136 "isDefaultSource": true,
137 "routingNumber": "string",
138 "status": "NEW",
139 "supportedCurrencies": [
140 "AED"
141 ],
142 "updatedAt": "2023-01-01T00:00:00Z",
143 "checkOptions": {
144 "signatoryName": "string",
145 "enabled": true,
146 "initialCheckNumber": 0,
147 "routingNumberOverride": "string",
148 "accountNumberOverride": "string",
149 "signatureImage": "string",
150 "useSignatureImage": true
151 }
152 },
153 "paymentSourceId": "string",
154 "vendorId": "string",
155 "vendor": {
156 "id": "string",
157 "name": "string",
158 "email": "string",
159 "isCustomer": true,
160 "accountType": "business",
161 "profile": {
162 "business": {
163 "legalBusinessName": "string",
164 "taxIDProvided": true,
165 "email": "string",
166 "businessType": "soleProprietorship",
167 "phone": {
168 "countryCode": "string",
169 "number": "string"
170 },
171 "doingBusinessAs": "string",
172 "website": "string",
173 "description": "string",
174 "address": {
175 "addressLine1": "string",
176 "city": "string",
177 "stateOrProvince": "string",
178 "postalCode": "string",
179 "addressLine2": "string",
180 "country": "string"
181 },
182 "ownersProvided": true
183 },
184 "individual": {
185 "name": {
186 "firstName": "string",
187 "lastName": "string",
188 "middleName": "string",
189 "suffix": "string"
190 },
191 "birthDateProvided": true,
192 "governmentIDProvided": true,
193 "email": "string",
194 "phone": {
195 "countryCode": "string",
196 "number": "string"
197 },
198 "address": {
199 "addressLine1": "string",
200 "city": "string",
201 "stateOrProvince": "string",
202 "postalCode": "string",
203 "addressLine2": "string",
204 "country": "string"
205 }
206 }
207 },
208 "status": "unverified",
209 "acceptedTos": true,
210 "isPayor": true,
211 "isPayee": true,
212 "createdAt": "2023-01-01T00:00:00Z",
213 "updatedAt": "2023-01-01T00:00:00Z",
214 "foreignId": "string",
215 "emailTo": "string",
216 "emailToAlias": [
217 "string"
218 ]
219 },
220 "paymentDestination": {
221 "type": "bankAccount",
222 "accountName": "string",
223 "accountNumber": "string",
224 "accountType": "CHECKING",
225 "bankName": "string",
226 "createdAt": "2023-01-01T00:00:00Z",
227 "id": "string",
228 "isDefaultDestination": true,
229 "isDefaultSource": true,
230 "routingNumber": "string",
231 "status": "NEW",
232 "supportedCurrencies": [
233 "AED"
234 ],
235 "updatedAt": "2023-01-01T00:00:00Z",
236 "checkOptions": {
237 "signatoryName": "string",
238 "enabled": true,
239 "initialCheckNumber": 0,
240 "routingNumberOverride": "string",
241 "accountNumberOverride": "string",
242 "signatureImage": "string",
243 "useSignatureImage": true
244 }
245 },
246 "paymentDestinationId": "string",
247 "paymentDestinationOptions": {
248 "type": "check",
249 "delivery": "PRINT"
250 },
251 "comments": [
252 {
253 "id": "string",
254 "text": "string",
255 "createdAt": "2023-01-01T00:00:00Z",
256 "updatedAt": "2023-01-01T00:00:00Z",
257 "user": {
258 "id": "string",
259 "roles": [
260 "string"
261 ],
262 "createdAt": "2023-01-01T00:00:00Z",
263 "updatedAt": "2023-01-01T00:00:00Z",
264 "foreignId": "string",
265 "email": "string",
266 "name": "string"
267 },
268 "associatedApprovalAction": {
269 "userId": "string",
270 "action": "NONE"
271 }
272 }
273 ],
274 "lineItems": [
275 {
276 "id": "string",
277 "currency": "AED",
278 "createdAt": "2023-01-01T00:00:00Z",
279 "updatedAt": "2023-01-01T00:00:00Z",
280 "amount": 1,
281 "description": "string",
282 "name": "string",
283 "quantity": 0,
284 "unitPrice": 1,
285 "serviceStartDate": "2023-01-01T00:00:00Z",
286 "serviceEndDate": "2023-01-01T00:00:00Z",
287 "metadata": {
288 "string": "string"
289 },
290 "glAccountId": "string"
291 }
292 ],
293 "foreignId": "string",
294 "creatorUser": {
295 "id": "string",
296 "roles": [
297 "string"
298 ],
299 "createdAt": "2023-01-01T00:00:00Z",
300 "updatedAt": "2023-01-01T00:00:00Z",
301 "foreignId": "string",
302 "email": "string",
303 "name": "string"
304 },
305 "failureType": "SOURCE_PAYMENT_ERROR",
306 "processedAt": "2023-01-01T00:00:00Z",
307 "fees": {
308 "sourcePaymentMethodFee": 1,
309 "sourcePlatformMarkupFee": 1,
310 "destinationPaymentMethodFee": 1,
311 "destinationPlatformMarkupFee": 1
312 }
313 },
314 "vendor": {
315 "id": "string",
316 "name": "string",
317 "email": "string",
318 "isCustomer": true,
319 "accountType": "business",
320 "profile": {
321 "business": {
322 "legalBusinessName": "string",
323 "taxIDProvided": true,
324 "email": "string",
325 "businessType": "soleProprietorship",
326 "phone": {
327 "countryCode": "string",
328 "number": "string"
329 },
330 "doingBusinessAs": "string",
331 "website": "string",
332 "description": "string",
333 "address": {
334 "addressLine1": "string",
335 "city": "string",
336 "stateOrProvince": "string",
337 "postalCode": "string",
338 "addressLine2": "string",
339 "country": "string"
340 },
341 "ownersProvided": true
342 },
343 "individual": {
344 "name": {
345 "firstName": "string",
346 "lastName": "string",
347 "middleName": "string",
348 "suffix": "string"
349 },
350 "birthDateProvided": true,
351 "governmentIDProvided": true,
352 "email": "string",
353 "phone": {
354 "countryCode": "string",
355 "number": "string"
356 },
357 "address": {
358 "addressLine1": "string",
359 "city": "string",
360 "stateOrProvince": "string",
361 "postalCode": "string",
362 "addressLine2": "string",
363 "country": "string"
364 }
365 }
366 },
367 "status": "unverified",
368 "acceptedTos": true,
369 "isPayor": true,
370 "isPayee": true,
371 "createdAt": "2023-01-01T00:00:00Z",
372 "updatedAt": "2023-01-01T00:00:00Z",
373 "foreignId": "string",
374 "emailTo": "string",
375 "emailToAlias": [
376 "string"
377 ]
378 },
379 "check": {
380 "addressLine1": "string",
381 "city": "string",
382 "country": "string",
383 "createdAt": "2023-01-01T00:00:00Z",
384 "id": "string",
385 "isDefaultDestination": true,
386 "isDefaultSource": true,
387 "payToTheOrderOf": "string",
388 "postalCode": "string",
389 "stateOrProvince": "string",
390 "supportedCurrencies": [
391 "AED"
392 ],
393 "updatedAt": "2023-01-01T00:00:00Z",
394 "addressLine2": "string"
395 },
396 "bankAccount": {
397 "accountName": "string",
398 "accountNumber": "string",
399 "accountType": "CHECKING",
400 "bankName": "string",
401 "createdAt": "2023-01-01T00:00:00Z",
402 "id": "string",
403 "isDefaultDestination": true,
404 "isDefaultSource": true,
405 "routingNumber": "string",
406 "status": "NEW",
407 "supportedCurrencies": [
408 "AED"
409 ],
410 "updatedAt": "2023-01-01T00:00:00Z",
411 "checkOptions": {
412 "signatoryName": "string",
413 "enabled": true,
414 "initialCheckNumber": 0,
415 "routingNumberOverride": "string",
416 "accountNumberOverride": "string",
417 "signatureImage": "string",
418 "useSignatureImage": true
419 }
420 }
421}