Skip to main content

Product

Represents one line item on a receipt. Produced by the SDK from OCR results and optionally enriched with Product Intelligence data.

Package: com.microblink.core

Declaration

class Product : Parcelable

Quick Reference​

Properties​

PropertyDescription
productNumber()SKU or product identification number
description()Product description text
descriptionPrefix()Text prepended to the main description
descriptionPostfix()Text appended to the main description
quantity()Quantity purchased
unitPrice()Price per single unit
unitOfMeasure()Unit of measurement
totalPrice()Total price for the line item
fullPrice()Full pre-discount price
priceAfterCoupons()Final price after coupon discounts
pricePostFix()Text appended to the price display
skuPrefix()Text prepended to the SKU
skuPostfix()Text appended to the SKU
voided()Whether this line item was voided
added()Whether this product was manually added
line()Line number of this item on the receipt
sensitive()Whether this product is flagged as sensitive data
additionalLines()Supplementary lines associated with this product
subProducts()Nested child products
possibleProducts()Alternative product matches
shippingStatus()Delivery or shipping state for this line item
productName()Full standardized product name
brand()Brand name
upc()Universal Product Code
category()Product category
subCategory()Product sub-category
majorCategory()Top-level category grouping
sector()Business sector classification
department()Retail department
size()Product size specification
imageUrl()URL of the product image
blinkReceiptBrand()Brand as identified by the BlinkReceipt system
blinkReceiptCategory()Category as identified by the BlinkReceipt system
rewardsGroup()Loyalty program rewards grouping
competitorRewardsGroup()Rewards group for competitor program evaluation
fuelType()Fuel category classification
itemType()Classification of the item type
probability()Confidence score for the product match
attributes()Additional key-value attribute mappings
extendedFields()Custom extended field mappings
modified()Whether corrections() has been applied
productNameModified()Whether the product name was corrected
brandModified()Whether the brand was corrected
upcModified()Whether the UPC was corrected
imageUrlModified()Whether the image URL was corrected
originalProductName()Product name before correction
originalBrand()Brand before correction
originalUpc()UPC before correction
originalImageUrl()Image URL before correction
originalQuantity()Quantity before correction
originalUnitPrice()Unit price before correction
originalTotalPrice()Total price before correction

Methods​

MethodDescription
corrections(...)Applies user corrections to this product
newBuilder()Creates an empty Product.Builder
builder()Creates a builder pre-filled with this product's values

Properties​

Receipt Properties​

productNumber()​

fun productNumber(): StringType?

SKU or product identification number as printed on the receipt.


description()​

fun description(): StringType?

Product description text as printed on the receipt.


descriptionPrefix()​

fun descriptionPrefix(): StringType?

Text prepended to the main description (e.g., a quantity modifier).


descriptionPostfix()​

fun descriptionPostfix(): StringType?

Text appended to the main description.


quantity()​

fun quantity(): FloatType?

Quantity purchased. See FloatType.


unitPrice()​

fun unitPrice(): FloatType?

Price per single unit.


unitOfMeasure()​

fun unitOfMeasure(): StringType?

Unit of measurement (e.g., "oz", "lb", "ea").


totalPrice()​

fun totalPrice(): FloatType?

Total price for the line item (quantity × unitPrice).


fullPrice()​

fun fullPrice(): Float

Full pre-discount price for the line item.


priceAfterCoupons()​

fun priceAfterCoupons(): FloatType?

Final price after coupon discounts have been applied.


pricePostFix()​

fun pricePostFix(): StringType?

Text appended to the price display (e.g., "/lb").


skuPrefix()​

fun skuPrefix(): StringType?

Text prepended to the SKU.


skuPostfix()​

fun skuPostfix(): StringType?

Text appended to the SKU.


voided()​

fun voided(): Boolean

true if this line item was voided or cancelled on the receipt.


added()​

fun added(): Boolean

true if this product was manually added rather than parsed from the receipt.


line()​

fun line(): Int

Line number of this item on the receipt.


sensitive()​

fun sensitive(): Boolean

true if this product has been flagged as sensitive data.


additionalLines()​

fun additionalLines(): List<AdditionalLine>?

Supplementary lines associated with this product. See AdditionalLine.


subProducts()​

fun subProducts(): List<Product>?

Nested child products (e.g., individual components of a combo item).


possibleProducts()​

fun possibleProducts(): List<Product>?

Alternative product matches when the SDK cannot determine the best match with high confidence.


shippingStatus()​

fun shippingStatus(): String?

Delivery or shipping state for this line item (primarily from e-receipts).


Product Intelligence Properties​

The following properties are populated only when a Product Intelligence key is configured.

productName()​

fun productName(): String?

Full standardized product name from the product database.


brand()​

fun brand(): String?

Brand name.


upc()​

fun upc(): String?

Universal Product Code (UPC/GTIN).


category()​

fun category(): String?

Product category.


subCategory()​

fun subCategory(): String?

Product sub-category.


majorCategory()​

fun majorCategory(): String?

Top-level category grouping.


sector()​

fun sector(): String?

Business sector classification.


department()​

fun department(): String?

Retail department.


size()​

fun size(): String?

Product size specification (e.g., "6.6 oz").


imageUrl()​

fun imageUrl(): String?

URL of the product image.


blinkReceiptBrand()​

fun blinkReceiptBrand(): String?

Brand as identified by the BlinkReceipt system (may differ from brand() after client modification).


blinkReceiptCategory()​

fun blinkReceiptCategory(): String?

Category as identified by the BlinkReceipt system.


rewardsGroup()​

fun rewardsGroup(): String?

Loyalty program rewards grouping for this product.


competitorRewardsGroup()​

fun competitorRewardsGroup(): String?

Rewards group identifier for competitor program evaluation.


fuelType()​

fun fuelType(): String?

Fuel category classification (for fuel products).


itemType()​

fun itemType(): String?

Classification of the item type.


probability()​

fun probability(): Double

Confidence score for the product match, from 0.0 to 1.0.


attributes()​

fun attributes(): List<Map<String, String>>?

Additional key-value attribute mappings from Product Intelligence.


extendedFields()​

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

Custom extended field mappings for retailer-specific product data.


User Corrections​

Use corrections() when your app lets the user fix a line item. It updates the product in place and records what changed in the properties below. To correct the receipt date, use ScanResults.correctedReceiptDate().

corrections(...)​

fun corrections(
correctedBrand: String?,
correctedUpc: String?,
correctedProductName: String?,
correctedImageUrl: String?,
correctedTotalPrice: Float,
correctedQuantity: Float
): Product

Applies user corrections to this product and returns the same instance.

  • Brand, UPC, product name, image URL: a non-null value that differs (ignoring case) from the current one replaces it; the previous value moves to the matching original*() property and the matching *Modified() flag becomes true. Pass null to leave a field unchanged.
  • Total price and quantity: a value that differs from the current one by more than 0.001 replaces it, and the previous value moves to originalTotalPrice() or originalQuantity(). Pass the current values to leave them unchanged. If either changed, the unit price is recomputed as correctedTotalPrice / correctedQuantity and the previous one moves to originalUnitPrice().

Each call resets the four *Modified() flags before applying the new values, and sets modified() to true.

Parameters:

ParameterDescription
correctedBrandCorrected brand, or null to keep the current one
correctedUpcCorrected UPC, or null to keep the current one
correctedProductNameCorrected product name, or null to keep the current one
correctedImageUrlCorrected image URL, or null to keep the current one
correctedTotalPriceCorrected total price for the line item
correctedQuantityCorrected quantity

modified()​

fun modified(): Boolean

true once corrections() has been called on this product.


productNameModified()​

fun productNameModified(): Boolean

true if the last corrections() call changed the product name.


brandModified()​

fun brandModified(): Boolean

true if the last corrections() call changed the brand.


upcModified()​

fun upcModified(): Boolean

true if the last corrections() call changed the UPC.


imageUrlModified()​

fun imageUrlModified(): Boolean

true if the last corrections() call changed the image URL.


originalProductName()​

fun originalProductName(): String?

The product name before corrections() changed it.


originalBrand()​

fun originalBrand(): String?

The brand before corrections() changed it.


originalUpc()​

fun originalUpc(): String?

The UPC before corrections() changed it.


originalImageUrl()​

fun originalImageUrl(): String?

The image URL before corrections() changed it.


originalQuantity()​

fun originalQuantity(): FloatType?

The quantity before corrections() changed it.


originalUnitPrice()​

fun originalUnitPrice(): FloatType?

The unit price before corrections() recomputed it.


originalTotalPrice()​

fun originalTotalPrice(): FloatType?

The total price before corrections() changed it.


Construction​

newBuilder()​

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

Returns an empty Product.Builder, with one setter per field (for example .productName(String?), .totalPrice(FloatType?)) and build(). Useful for building search targets for ScanOptions.searchTargets() or test fixtures.


builder()​

fun builder(): Product.Builder

Returns a Product.Builder pre-filled with this product's scanned and Product Intelligence values, for creating a modified copy. The added() flag and correction state are not copied.