Skip to main content

ScanResults

Holds all parsed data from a scan session. Produced by the SDK — construct one yourself with ScanResults.newBuilder() only if building test fixtures; in production the SDK returns instances directly.

Package: com.microblink.core

Declaration

class ScanResults : Parcelable

Quick Reference​

Methods​

MethodDescription
retailerId()Retailer enum value identifying the merchant
merchantName()Detected merchant or store name
merchantDetection()Diagnostic signals showing how the merchant was detected
clientMerchantName()Client-supplied merchant name override
merchantMatchGuess()SDK's best-guess merchant match
merchantSource()Data source used to identify the merchant
merchantSources()Multiple source codes for merchant identification
storeNumber()Store or branch identifier
storeAddress()Street address of the store
storeCity()City where the store is located
storeState()State or province
storeZip()Postal or ZIP code
storeCountry()Country code for the store location
storePhone()Store phone number as printed on the receipt
mallName()Name of the shopping mall or center
purchaseCountry()Country where the purchase was made
blinkReceiptId()Unique identifier assigned to this scan
transactionId()Transaction identifier from the receipt
longTransactionId()Extended transaction identifier
registerId()Cash register identifier
cashierId()Cashier or employee ID
channel()Transaction channel
purchaseType()Type of purchase
isReturn()Whether the receipt is a return
taxId()Tax identification number
barcodes()Barcodes detected on the receipt
receiptDate()Purchase date from the receipt
receiptTime()Purchase time from the receipt
timeSeconds()Receipt time as epoch seconds
receiptDateTime()Combined Date object for receipt date and time
submissionDate()Date the receipt was submitted
total()Total purchase amount
subtotal()Subtotal before tax
taxes()Total tax amount
tip()Tip amount
cashback()Cashback amount received at the register
subtotalMatches()Whether subtotal + taxes ≈ total
currencyCode()ISO 4217 currency code
products()Line items parsed from the receipt
productsPendingLookup()Count of products awaiting enrichment
paymentMethods()All payment methods used
last4cc()Last four digits of the card used
authCode()Payment authorization code
aid()Application Identifier from EMV/chip transactions
paymentTerminalId()Terminal or register ID from the payment system
paymentTransactionId()Payment-specific transaction identifier
loyaltyProgram()Whether a loyalty program was detected
loyaltyForBanner()Whether loyalty applies to the store banner
memberNumber()Loyalty membership or account number
isInstacartShopper()Whether the receipt is from an Instacart shopper order
qualified()Promotions the receipt qualifies for
unqualified()Promotions that were evaluated but not qualified
qualified(promotions)Replaces the qualified promotions
unqualified(promotions)Replaces the unqualified promotions
coupons()Coupons applied on the receipt
qualifiedSurveys()Surveys the user qualifies for
ocrConfidence()OCR accuracy score
tripConfidence()Parser confidence in the receipt-level data
itemConfidence()Parser confidence in the line items
foundTopEdge()Whether the top edge of the receipt was detected
foundBottomEdge()Whether the bottom edge of the receipt was detected
duplicate()Whether the receipt is flagged as a duplicate
duplicateBlinkReceiptIds()IDs of previously submitted receipts this may duplicate
fraudulent()Whether the receipt is flagged as suspicious
eReceipt()Whether this result was parsed from an email receipt
eReceiptOrderNumber()Order number from the receipt email
eReceiptOrderStatus()Order status at the time the email was parsed
eReceiptEmailProvider()Email provider
eReceiptMerchantEmail()Sender email address of the receipt
eReceiptEmailSubject()Subject line of the receipt email
eReceiptEmailId()Internal email identifier
eReceiptAuthenticated()Whether the receipt email passed authentication
eReceiptPOSSystem()POS system identified from the email
eReceiptSubMerchant()Sub-merchant identifier
eReceiptFulfilledBy()Fulfillment provider name
eReceiptShippingCosts()Shipping charges from the receipt email
eReceiptShippingAddress()Shipping or delivery address
eReceiptShippingStatus()Shipping or delivery status
eReceiptAdditionalFees()Breakdown of additional fees
eReceiptRawHtml()Raw HTML body of the receipt email
eReceiptComponentEmails()Sub-receipts from a combined email
combinedRawText()Full concatenated OCR text from all frames
rawBasket()Unprocessed text from the product/basket section
rawTripHeader()Unprocessed text from the transaction header
rawTripFooter()Unprocessed text from the transaction footer
rawData()Full unprocessed OCR output string
rawDataType()Type classification of the raw data
extendedFields()Custom extended key-value fields
shipments()Shipment records associated with the receipt
originalReceiptDate()The original (pre-correction) receipt date
correctedReceiptDate(date)Sets a corrected receipt date
submissionDate(date)Sets the submission date
add(...)Manually adds a product to the results
newBuilder()Creates a builder for constructing results yourself

Methods​

Merchant & Store​

retailerId()​

fun retailerId(): Retailer

Retailer enum value identifying the merchant's banner. Never null: Retailer.UNKNOWN when the banner is not one the enum lists.


merchantName()​

fun merchantName(): StringType?

Detected merchant or store name.


merchantDetection()​

fun merchantDetection(): MerchantDetection?

Diagnostic signals showing how the scanner arrived at the merchant: which detectors fired and what each matched. null when no detector produced a signal. See MerchantDetection. Not needed for a normal integration; the merchant itself is merchantName().

Since: 2.5.0


clientMerchantName()​

fun clientMerchantName(): String?

Client-supplied merchant name override.


merchantMatchGuess()​

fun merchantMatchGuess(): StringType?

SDK's best-guess merchant match when exact identification is uncertain.


merchantSource()​

fun merchantSource(): String?

Identifier for the data source used to identify the merchant.


merchantSources()​

fun merchantSources(): List<Int>?

Multiple source codes when more than one source contributed to merchant identification.


storeNumber()​

fun storeNumber(): StringType?

Store or branch identifier.


storeAddress()​

fun storeAddress(): StringType?

Street address of the store.


storeCity()​

fun storeCity(): StringType?

City where the store is located.


storeState()​

fun storeState(): StringType?

State or province.


storeZip()​

fun storeZip(): StringType?

Postal or ZIP code.


storeCountry()​

fun storeCountry(): StringType?

Country code for the store location.


storePhone()​

fun storePhone(): StringType?

Store phone number as printed on the receipt.


mallName()​

fun mallName(): StringType?

Name of the shopping mall or center, if applicable.


purchaseCountry()​

fun purchaseCountry(): String?

Country where the purchase was made (may differ from store country for cross-border transactions).


Transaction​

blinkReceiptId()​

fun blinkReceiptId(): String

Unique identifier assigned to this scan by the BlinkReceipt backend.


transactionId()​

fun transactionId(): StringType?

Transaction identifier extracted from the receipt.


longTransactionId()​

fun longTransactionId(): StringType?

Extended or long-form transaction identifier.


registerId()​

fun registerId(): StringType?

Cash register identifier.


cashierId()​

fun cashierId(): StringType?

Cashier or employee ID.


channel()​

fun channel(): StringType?

Transaction channel (e.g., in-store, online).


purchaseType()​

fun purchaseType(): StringType?

Type of purchase as printed on the receipt.


isReturn()​

fun isReturn(): Boolean

true if the receipt is a return rather than a purchase.

Default: false

Since: 2.4.0


taxId()​

fun taxId(): StringType?

Tax identification number from the receipt.


barcodes()​

fun barcodes(): List<Barcode>?

Barcodes detected on the receipt. See Barcode.


Purchase Date & Time​

receiptDate()​

fun receiptDate(): StringType?

Purchase date as extracted from the receipt.


receiptTime()​

fun receiptTime(): StringType?

Purchase time as extracted from the receipt.


timeSeconds()​

fun timeSeconds(): StringType?

Receipt time expressed as epoch seconds.


receiptDateTime()​

fun receiptDateTime(): Date?

Combined Date object representing the receipt's date and time. null if no date could be parsed.


submissionDate()​

fun submissionDate(): Date?
fun submissionDate(date: Date?): ScanResults

Date when the receipt was submitted for processing. The setter overload sets the submission date and returns self for chaining.


Totals​

total()​

fun total(): FloatType?

Total purchase amount. See FloatType.


subtotal()​

fun subtotal(): FloatType?

Subtotal before tax.


taxes()​

fun taxes(): FloatType?

Total tax amount.


tip()​

fun tip(): FloatType?

Tip amount, if present.


cashback()​

fun cashback(): Float

Cashback amount received at the register.


subtotalMatches()​

fun subtotalMatches(): Boolean

true if subtotal + taxes ≈ total. A useful receipt-validity signal.


currencyCode()​

fun currencyCode(): String?

ISO 4217 currency code (e.g., "USD").


Products & Items​

products()​

fun products(): List<Product>?

Line items parsed from the receipt. See Product.


productsPendingLookup()​

fun productsPendingLookup(): Int

Count of products still awaiting Product Intelligence enrichment.


Payment​

paymentMethods()​

fun paymentMethods(): List<PaymentMethod>?

All payment methods used for the transaction. See PaymentMethod.


last4cc()​

fun last4cc(): StringType?

Last four digits of the credit or debit card used.


authCode()​

fun authCode(): StringType?

Payment authorization code.


aid()​

fun aid(): StringType?

Application Identifier from EMV/chip card transactions.


paymentTerminalId()​

fun paymentTerminalId(): StringType?

Terminal or register ID from the payment system.


paymentTransactionId()​

fun paymentTransactionId(): StringType?

Payment-specific transaction identifier.


Loyalty & Member​

loyaltyProgram()​

fun loyaltyProgram(): Boolean?

true if a loyalty program was detected on the receipt. null when not determined.


loyaltyForBanner()​

fun loyaltyForBanner(): Boolean

true if loyalty applies to the store banner specifically.


memberNumber()​

fun memberNumber(): String?

Loyalty membership or account number.


isInstacartShopper()​

fun isInstacartShopper(): Boolean

true if the receipt originated from an Instacart shopper order.


Promotions & Surveys​

qualified()​

fun qualified(): List<Promotion>?

Promotions the receipt qualifies for. See Promotion.


unqualified()​

fun unqualified(): List<Promotion>?

Promotions the receipt was evaluated for but did not qualify.


qualified(promotions)​

fun qualified(promotions: List<Promotion>): ScanResults

Replaces the list returned by qualified(). Returns self for chaining.


unqualified(promotions)​

fun unqualified(promotions: List<Promotion>): ScanResults

Replaces the list returned by unqualified(). Returns self for chaining.


coupons()​

fun coupons(): List<Coupon>?

Coupons applied on the receipt. See Coupon.


qualifiedSurveys()​

fun qualifiedSurveys(): List<Survey>?

Surveys the user qualifies for based on this receipt. See Survey.


Quality & Validation​

ocrConfidence()​

fun ocrConfidence(): Float

OCR accuracy score, ranging from 0.0 to 1.0.


tripConfidence()​

fun tripConfidence(): Float

Confidence, from 0 to 100, that the parser computed for the receipt-level data at the end of the scan session. 0 when unknown, for example when OCR ran on the server.


itemConfidence()​

fun itemConfidence(): Float

Confidence, from 0 to 100, that the parser computed for the line items at the end of the scan session. 0 when unknown, for example when OCR ran on the server.


foundTopEdge()​

fun foundTopEdge(): Boolean

true if the top edge of the receipt image was detected.


foundBottomEdge()​

fun foundBottomEdge(): Boolean

true if the bottom edge of the receipt image was detected.


duplicate()​

fun duplicate(): Boolean

true if this receipt is flagged as a potential duplicate of a previously submitted scan.


duplicateBlinkReceiptIds()​

fun duplicateBlinkReceiptIds(): List<String>?

IDs of previously submitted receipts that this scan may be a duplicate of.


fraudulent()​

fun fraudulent(): Boolean

true if the receipt is flagged as suspicious or fraudulent.


E-Receipt​

eReceipt()​

fun eReceipt(): Boolean

true if this result was parsed from an email receipt rather than a camera scan.


eReceiptOrderNumber()​

fun eReceiptOrderNumber(): String?

Order number extracted from the receipt email.


eReceiptOrderStatus()​

fun eReceiptOrderStatus(): String?

Order status at the time the email was parsed.


eReceiptEmailProvider()​

fun eReceiptEmailProvider(): String?

Email provider (e.g., "Gmail", "Outlook").


eReceiptMerchantEmail()​

fun eReceiptMerchantEmail(): String?

Sender email address of the receipt.


eReceiptEmailSubject()​

fun eReceiptEmailSubject(): String?

Subject line of the receipt email.


eReceiptEmailId()​

fun eReceiptEmailId(): String?

Internal email identifier.


eReceiptAuthenticated()​

fun eReceiptAuthenticated(): Boolean

true if the receipt email passed sender authentication checks.


eReceiptPOSSystem()​

fun eReceiptPOSSystem(): String?

POS system identified from the email content.


eReceiptSubMerchant()​

fun eReceiptSubMerchant(): String?

Sub-merchant identifier (e.g., a marketplace seller).


eReceiptFulfilledBy()​

fun eReceiptFulfilledBy(): String?

Fulfillment provider name.


eReceiptShippingCosts()​

fun eReceiptShippingCosts(): Float

Shipping charges from the receipt email.


eReceiptShippingAddress()​

fun eReceiptShippingAddress(): String?

Shipping or delivery address.


eReceiptShippingStatus()​

fun eReceiptShippingStatus(): String?

Shipping or delivery status.


eReceiptAdditionalFees()​

fun eReceiptAdditionalFees(): Map<String, String>?

Breakdown of additional fees (e.g., handling, service charges).


eReceiptRawHtml()​

fun eReceiptRawHtml(): String?

Raw HTML body of the receipt email. Useful for debugging parser issues.


eReceiptComponentEmails()​

fun eReceiptComponentEmails(): List<ScanResults>?

Sub-receipts parsed from a combined or multi-part email.


Raw Data​

combinedRawText()​

fun combinedRawText(): StringType?

Full concatenated OCR text from all receipt frames.


rawBasket()​

fun rawBasket(): String?

Unprocessed text from the product/basket section of the receipt.


rawTripHeader()​

fun rawTripHeader(): String?

Unprocessed text from the transaction header.


rawTripFooter()​

fun rawTripFooter(): String?

Unprocessed text from the transaction footer.


rawData()​

fun rawData(): String?

Full unprocessed OCR output string.


rawDataType()​

fun rawDataType(): String?

Type classification of the raw data.


extendedFields()​

fun extendedFields(): Map<String, String>?

Custom extended key-value fields appended by the SDK for retailer-specific data.


shipments()​

fun shipments(): List<Shipment>?

Shipment records associated with the receipt (typically from e-receipts). See Shipment.


User Corrections​

Use these when your app lets the user correct a scanned receipt. To correct an individual line item, use Product.corrections().

originalReceiptDate()​

fun originalReceiptDate(): StringType?

The receipt date as scanned, before correctedReceiptDate() replaced it. null if the date was never corrected.


correctedReceiptDate(date)​

fun correctedReceiptDate(date: String): ScanResults

Sets a corrected receipt date. If it differs from the current receiptDate(), the scanned value moves to originalReceiptDate() and receiptDate() returns the corrected one. Returns self for chaining.

Parameters:

ParameterDescription
dateThe corrected date, in MM/dd/yyyy format

add(brand, upc, productName, imageUrl, totalPrice, quantity)​

fun add(
brand: String?,
upc: String?,
productName: String?,
imageUrl: String?,
totalPrice: Float,
quantity: Float
): ScanResults

Manually adds a product to the results. The new product's added() returns true. Returns self for chaining.

Parameters:

ParameterDescription
brandBrand name of the product
upcUniversal Product Code
productNameFull product name
imageUrlURL of the product image
totalPriceTotal price for this line item
quantityQuantity purchased

Construction​

newBuilder()​

// Java static method
fun newBuilder(): ScanResults.Builder

Returns an empty ScanResults.Builder. The builder has one setter per field (for example .merchantName(StringType?), .products(List<Product>?), .isReturn(Boolean)) and build(). Intended for test fixtures; the SDK returns ScanResults instances directly.