Skip to main content

ScanOptions

Configures a scan session. Build one with ScanOptions.newBuilder() and pass it to the recognizer before starting a scan.

Package: com.microblink

Declaration

class ScanOptions : Parcelable

Quick Reference​

Properties​

PropertyDescription
activation()Whether the Activation post-scan flow runs in the camera UI
countryCode()ISO country code for regional scanning
detectBarcodes()Whether barcode detection is enabled
detectDuplicates()Whether duplicate receipt detection is enabled
detectEdges()Whether edge detection is enabled
detectLogo()Whether merchant logo detection is enabled
edgeDetectionConfiguration()Configuration for edge detection behavior
externalStorage()Whether stored frames go to external storage
filterSensitiveData()Whether sensitive data is redacted
frameCharacteristics()Frame storage and compression settings
merchantConfiguration()Merchant-specific configuration
promotionSlugs()Promotion slugs to evaluate
returnSubProducts()Whether sub-products are included in results
returnVoidedProducts()Whether voided line items are included
searchTargets()Target products to search for
storeFrames()Whether captured frames are stored
validatePromotions()Whether promotions should be validated

Methods​

MethodDescription
newBuilder()Creates a ScanOptions.Builder

Builder​

val options = ScanOptions.newBuilder()
.countryCode("US")
.detectDuplicates(true)
.filterSensitiveData(true)
.build()

ScanOptions.Builder() is equivalent to ScanOptions.newBuilder().


Properties​

activation()​

fun activation(): Boolean
// Builder: .activation(Boolean)

Whether the Activation post-scan flow (ads loading, receipt summary, rewards) runs inside the camera UI after a successful scan.

Default: false


countryCode()​

fun countryCode(): String
// Builder: .countryCode(String)

ISO country code for regional scanning and merchant matching configuration.

Default: "US" (also used when the builder is given an empty string)


detectBarcodes()​

fun detectBarcodes(): Boolean
// Builder: .detectBarcodes(Boolean)

Whether barcode detection runs on captured frames. Detected barcodes are returned in ScanResults.barcodes().

Default: false


detectDuplicates()​

fun detectDuplicates(): Boolean
// Builder: .detectDuplicates(Boolean)

Whether duplicate receipt detection is enabled.

Default: false


detectEdges()​

fun detectEdges(): Boolean

Whether edge detection is enabled to identify receipt boundaries. There is no builder setter: it is true when BlinkReceiptSdk.onDeviceOcr() is true and edgeDetectionConfiguration() is non-null, which it is by default. Edge detection applies only to on-device OCR.


fun detectLogo(): Boolean
// Builder: .logoDetection(Boolean)

Whether merchant logo detection is enabled. Returns true only when logo detection was requested with .logoDetection(true) and BlinkReceiptSdk.onDeviceOcr() is true; logo detection applies only to on-device OCR.

Default: false


edgeDetectionConfiguration()​

fun edgeDetectionConfiguration(): EdgeDetectionConfiguration?
// Builder: .edgeDetectionConfiguration(EdgeDetectionConfiguration)

Configuration object for edge detection behavior.

Default: a default EdgeDetectionConfiguration


externalStorage()​

fun externalStorage(): Boolean

Whether stored frames are written to external storage. There is no ScanOptions.Builder setter: the value comes from frameCharacteristics() (FrameCharacteristics.Builder.externalStorage(Boolean)).

Default: false


filterSensitiveData()​

fun filterSensitiveData(): Boolean
// Builder: .filterSensitiveData(Boolean)

Whether sensitive data (e.g., full credit card numbers) is redacted from results.

Default: false


frameCharacteristics()​

fun frameCharacteristics(): FrameCharacteristics
// Builder: .frameCharacteristics(FrameCharacteristics)

Frame storage and compression settings: whether captured frames are stored, whether they go to external storage, and their compression format and quality. Build one with FrameCharacteristics.newBuilder().

Default: a default FrameCharacteristics (frames not stored)


merchantConfiguration()​

fun merchantConfiguration(): MerchantConfiguration?
// Builder: .merchantConfiguration(MerchantConfiguration)

Merchant-specific configuration for detection and matching behavior.


promotionSlugs()​

fun promotionSlugs(): List<Slug>?
// Builder: .promotionSlugs(List<Slug>)

Promotion slugs to evaluate against the receipt.


returnSubProducts()​

fun returnSubProducts(): Boolean
// Builder: .returnSubProducts(Boolean)

Whether sub-products (e.g., combo components) are included in results.

Default: false


returnVoidedProducts()​

fun returnVoidedProducts(): Boolean
// Builder: .returnVoidedProducts(Boolean)

Whether voided or cancelled line items are included in results.

Default: false


searchTargets()​

fun searchTargets(): List<Product>?
// Builder: .searchTargets(List<Product>)

Target products to search for within the scanned receipt.


storeFrames()​

fun storeFrames(): Boolean

Whether captured image frames are stored during the scan session. There is no ScanOptions.Builder setter: the value comes from frameCharacteristics() (FrameCharacteristics.Builder.storeFrames(Boolean)).

Default: false


validatePromotions()​

fun validatePromotions(): Boolean
// Builder: .validatePromotions(Boolean)

Whether promotions should be validated against the receipt data.

Default: false


Methods​

newBuilder()​

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

Returns a new ScanOptions.Builder with default values. Call build() on it to create the ScanOptions.