To retrieve extracted data from the list of receipts, use the TikiClient.receipt method.

This method requires the receiptId produced by the TikiClient.publish method as its parameter. It returns a list of ReceiptResponse items, each containing data extracted from the individual images in the receipt list.

Note that the outcome of processing receipt images through the mytiki.com APIs, and consequently in the client library, will be presented as a list containing the results for each image in the receipt list. This list may include duplicate data, depending on the images submitted.

// Assuming you have the receiptId stored in a variable named 'receiptId'
let receiptData = await TikiClient.receipt(receiptId);
console.log(receiptData);
// Assuming you have the receiptId stored in a variable named 'receiptId'
suspend fun receipt(receiptId: String, onResult: (Array<ReceiptResponse?>) -> Unit)

WARNING: The data extraction from receipts is performed asynchronously by Amazon Textract. Processing typically takes a few seconds, but it can occasionally take up to a minute. It's important to note that making subsequent calls to TikiClient.receiptq shortly after using TikiClient.publish might lead to unexpected results and false 404 errors from the API. We recommend allowing sufficient time for the extraction process to complete before attempting to retrieve the extracted data.

ReceiptResponse

FieldTypeDescription
documentMetadataDocumentMetadataMetadata information about the OCR results
expenseDocumentsArray<ExpenseDocument >The OCR results