OCR

Get OCR Response (Async)

GET
https://api.mercoa.com/ocr-async/:jobId

Get the status and results of an asynchronous OCR job.

Path parameters

jobId
string

Response

This endpoint return an object.
jobId
string
status
enum
Allowed values: pendingsuccessfailed
data
optional object
GET
/ocr-async/:jobId
curl https://api.mercoa.com/ocr-async/:jobId \
-H "Authorization: Bearer <token>"
Response
{
"jobId": "string",
"status": "pending",
"data": {
"invoice": {
"id": "string",
"status": "DRAFT",
"paymentDestinationConfirmed": true,
"hasDocuments": true,
"approvers": [
{
"approvalPolicyId": "string",
"approvalSlotId": "string",
"action": "NONE",
"eligibleRoles": [
"string"
],
"eligibleUserIds": [
"string"
],
"date": "2023-01-01T00:00:00Z",
"assignedUserId": "string"
}
],
"approvalPolicy": [
{
"id": "string",
"trigger": [
{
"type": "amount",
"amount": 1,
"currency": "AED"
}
],
"rule": {
"type": "approver",
"identifierList": {
"type": "rolesList",
"value": [
"string"
]
},
"numApprovers": 0
},
"upstreamPolicyId": "string"
}
],
"metadata": {
"string": "string"
},
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"amount": 1,
"currency": "AED",
"invoiceDate": "2023-01-01T00:00:00Z",
"deductionDate": "2023-01-01T00:00:00Z",
"settlementDate": "2023-01-01T00:00:00Z",
"dueDate": "2023-01-01T00:00:00Z",
"invoiceNumber": "string",
"noteToSelf": "string",
"serviceStartDate": "2023-01-01T00:00:00Z",
"serviceEndDate": "2023-01-01T00:00:00Z",
"payerId": "string",
"payer": {
"id": "string",
"name": "string",
"email": "string",
"isCustomer": true,
"accountType": "business",
"profile": {
"business": {
"legalBusinessName": "string",
"taxIDProvided": true,
"email": "string",
"businessType": "soleProprietorship",
"phone": {
"countryCode": "string",
"number": "string"
},
"doingBusinessAs": "string",
"website": "string",
"description": "string",
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
},
"ownersProvided": true
},
"individual": {
"email": "string",
"name": {
"firstName": "string",
"lastName": "string",
"middleName": "string",
"suffix": "string"
},
"birthDateProvided": true,
"governmentIDProvided": true,
"phone": {
"countryCode": "string",
"number": "string"
},
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
}
}
},
"status": "unverified",
"acceptedTos": true,
"isPayor": true,
"isPayee": true,
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"emailTo": "string",
"emailToAlias": [
"string"
]
},
"paymentSource": {
"type": "bankAccount",
"accountName": "string",
"accountNumber": "string",
"accountType": "CHECKING",
"bankName": "string",
"createdAt": "2023-01-01T00:00:00Z",
"id": "string",
"isDefaultDestination": true,
"isDefaultSource": true,
"routingNumber": "string",
"status": "NEW",
"supportedCurrencies": [
"AED"
],
"updatedAt": "2023-01-01T00:00:00Z",
"checkOptions": {
"enabled": true,
"initialCheckNumber": 0,
"routingNumberOverride": "string",
"accountNumberOverride": "string",
"signatoryName": "string",
"signatureImage": "string"
}
},
"paymentSourceId": "string",
"vendorId": "string",
"vendor": {
"id": "string",
"name": "string",
"email": "string",
"isCustomer": true,
"accountType": "business",
"profile": {
"business": {
"legalBusinessName": "string",
"taxIDProvided": true,
"email": "string",
"businessType": "soleProprietorship",
"phone": {
"countryCode": "string",
"number": "string"
},
"doingBusinessAs": "string",
"website": "string",
"description": "string",
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
},
"ownersProvided": true
},
"individual": {
"email": "string",
"name": {
"firstName": "string",
"lastName": "string",
"middleName": "string",
"suffix": "string"
},
"birthDateProvided": true,
"governmentIDProvided": true,
"phone": {
"countryCode": "string",
"number": "string"
},
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
}
}
},
"status": "unverified",
"acceptedTos": true,
"isPayor": true,
"isPayee": true,
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"emailTo": "string",
"emailToAlias": [
"string"
]
},
"paymentDestination": {
"type": "bankAccount",
"accountName": "string",
"accountNumber": "string",
"accountType": "CHECKING",
"bankName": "string",
"createdAt": "2023-01-01T00:00:00Z",
"id": "string",
"isDefaultDestination": true,
"isDefaultSource": true,
"routingNumber": "string",
"status": "NEW",
"supportedCurrencies": [
"AED"
],
"updatedAt": "2023-01-01T00:00:00Z",
"checkOptions": {
"enabled": true,
"initialCheckNumber": 0,
"routingNumberOverride": "string",
"accountNumberOverride": "string",
"signatoryName": "string",
"signatureImage": "string"
}
},
"paymentDestinationId": "string",
"paymentDestinationOptions": {
"type": "check",
"delivery": "PRINT"
},
"comments": [
{
"id": "string",
"text": "string",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"user": {
"id": "string",
"roles": [
"string"
],
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"email": "string",
"name": "string"
},
"associatedApprovalAction": {
"userId": "string",
"action": "NONE"
}
}
],
"lineItems": [
{
"id": "string",
"currency": "AED",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"amount": 1,
"description": "string",
"name": "string",
"quantity": 0,
"unitPrice": 1,
"serviceStartDate": "2023-01-01T00:00:00Z",
"serviceEndDate": "2023-01-01T00:00:00Z",
"metadata": {
"string": "string"
},
"glAccountId": "string"
}
],
"foreignId": "string",
"creatorUser": {
"id": "string",
"roles": [
"string"
],
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"email": "string",
"name": "string"
},
"failureType": "SOURCE_PAYMENT_ERROR",
"processedAt": "2023-01-01T00:00:00Z",
"fees": {
"sourcePaymentMethodFee": 1,
"sourcePlatformMarkupFee": 1,
"destinationPaymentMethodFee": 1,
"destinationPlatformMarkupFee": 1
}
},
"vendor": {
"id": "string",
"name": "string",
"email": "string",
"isCustomer": true,
"accountType": "business",
"profile": {
"business": {
"legalBusinessName": "string",
"taxIDProvided": true,
"email": "string",
"businessType": "soleProprietorship",
"phone": {
"countryCode": "string",
"number": "string"
},
"doingBusinessAs": "string",
"website": "string",
"description": "string",
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
},
"ownersProvided": true
},
"individual": {
"email": "string",
"name": {
"firstName": "string",
"lastName": "string",
"middleName": "string",
"suffix": "string"
},
"birthDateProvided": true,
"governmentIDProvided": true,
"phone": {
"countryCode": "string",
"number": "string"
},
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
}
}
},
"status": "unverified",
"acceptedTos": true,
"isPayor": true,
"isPayee": true,
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"emailTo": "string",
"emailToAlias": [
"string"
]
},
"check": {
"addressLine1": "string",
"city": "string",
"country": "string",
"createdAt": "2023-01-01T00:00:00Z",
"id": "string",
"isDefaultDestination": true,
"isDefaultSource": true,
"payToTheOrderOf": "string",
"postalCode": "string",
"stateOrProvince": "string",
"supportedCurrencies": [
"AED"
],
"updatedAt": "2023-01-01T00:00:00Z",
"addressLine2": "string"
},
"bankAccount": {
"accountName": "string",
"accountNumber": "string",
"accountType": "CHECKING",
"bankName": "string",
"createdAt": "2023-01-01T00:00:00Z",
"id": "string",
"isDefaultDestination": true,
"isDefaultSource": true,
"routingNumber": "string",
"status": "NEW",
"supportedCurrencies": [
"AED"
],
"updatedAt": "2023-01-01T00:00:00Z",
"checkOptions": {
"enabled": true,
"initialCheckNumber": 0,
"routingNumberOverride": "string",
"accountNumberOverride": "string",
"signatoryName": "string",
"signatureImage": "string"
}
}
}
}