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