Skip to main content

BRProduct

Describes one product detected on a receipt.

Declaration

@interface BRProduct : NSObject <BRSerializable>
class BRProduct : NSObject, BRSerializable

Quick Reference

Properties

PropertyDescription
productNumberThe product number (SKU, UPC, or other identifier) found on the receipt.
productDescriptionThe product description found on the receipt, if any.
quantityThe product quantity found on the receipt, if any. Can be a count of items or an amount when units are weight.
unitPriceThe unit price. For example, if the item costs $8/lb, this would be 8.0.
unitOfMeasureThe unit of measurement for this item (e.g., "pounds", "ounces", "packs").
totalPriceThe total price paid for this line item, taking into account quantities, weights, and discounts.
fullPriceThe total price before any savings were applied to this item. To compute the discount, subtract totalPrice from fullPrice.
priceAfterCouponsPrice after coupon application.
additionalLinesAn array of any additional lines connected to this product that were scanned (can be above or below). nil if no lines were found. See BRProductAdditionalLine.
isVoidedIndicates whether this is a voided product. Voided products are only returned if BRScanOptions.returnVoidedProducts is set.
shippingStatusFor e-receipt orders, this indicates the shipping status of this product.
prodDescPrefixThe prefix found before the product description, if any.
prodDescPostfixThe postfix found after the product description, if any.
prodNumPrefixThe prefix found before the product number, if any.
prodNumPostfixThe postfix found after the product number, if any.
pricePostfixText found after a price, if any.
fuelTypeIf this product is fuel, this will be the type of fuel (e.g., "Regular", "Unleaded").
sellerThe product reseller, if any.
conditionThe product condition, if any (e.g., "New", "Used").
productUrlThe product URL, if any. Usually found in e-receipts.
currencyCodeThe currency for this product, if identified. May differ from BRScanResults.currencyCode.
subscriptionFrequencyThe subscription frequency for this product, if identified (e.g., "every week", "every month").
extendedFieldsAdditional product fields.
userAddedWhether the user added this product during the receipt correction flow.
userModifiedWhether the user modified this product during the receipt correction flow.
isSensitiveIf BRScanOptions.filterSensitiveData is enabled, indicates whether this product is from a sensitive category as determined by Product Intelligence.
productNameThe full product name.
brandThe product brand.
upcThe product UPC.
sectorThe product sector (highest level of taxonomy).
departmentThe product department.
majorCategoryThe product major category.
subCategoryThe product sub-category.
sizeThe product size.
itemTypeThe product item type.
imgUrlThe product thumbnail URL (size may vary).
attributesZero or more attributes related to the product. Each attribute is a dictionary with a single key-value pair representing the attribute name and value.
probabilityIf this product is part of a different product's possibleProducts array, indicates how likely this particular product is to match the description of the parent BRProduct.
possibleProductsIf Product Intelligence cannot return an exact match, it may return an array of possible products. Each will have only Product Intelligence properties populated.
subProductsAn array of sub-products tied to this product, if any. Generally only populated for restaurants.
categoryThe product category. Note: this is a legacy property — use sector, department, majorCategory, and subCategory instead.

Methods

MethodDescription
userCorrectedBrand:upc:productName:imageUrl:totalPrice:quantity:Updates an existing product's properties after a user correction.

Properties

Receipt Properties

productNumber (read-only)

@property (nonatomic, strong, readonly) BRStringValue *productNumber;
var productNumber: BRStringValue! { get }

The product number (SKU, UPC, or other identifier) found on the receipt, if any.


productDescription (read-only)

@property (nonatomic, strong, readonly) BRStringValue *productDescription;
var productDescription: BRStringValue! { get }

The product description found on the receipt, if any.


quantity (read-only)

@property (nonatomic, strong, readonly) BRFloatValue *quantity;
var quantity: BRFloatValue! { get }

The product quantity found on the receipt, if any. Can be a count of items or an amount when units are weight.


unitPrice (read-only)

@property (nonatomic, strong, readonly) BRFloatValue *unitPrice;
var unitPrice: BRFloatValue! { get }

The unit price. For example, if the item costs $8/lb, this would be 8.0.


unitOfMeasure (read-only)

@property (nonatomic, strong, readonly) BRStringValue *unitOfMeasure;
var unitOfMeasure: BRStringValue! { get }

The unit of measurement for this item (e.g., "pounds", "ounces", "packs").


totalPrice (read-only)

@property (nonatomic, strong, readonly) BRFloatValue *totalPrice;
var totalPrice: BRFloatValue! { get }

The total price paid for this line item, taking into account quantities, weights, and discounts.


fullPrice (read-only)

@property (nonatomic, strong, readonly) BRFloatValue *fullPrice;
var fullPrice: BRFloatValue! { get }

The total price before any savings were applied to this item. To compute the discount, subtract totalPrice from fullPrice.


priceAfterCoupons (read-only)

@property (strong, nonatomic, readonly) BRFloatValue *priceAfterCoupons;
var priceAfterCoupons: BRFloatValue! { get }

Price after coupon application.


additionalLines (read-only)

@property (nonatomic, strong, readonly) NSArray<BRProductAdditionalLine *> *additionalLines;
var additionalLines: [BRProductAdditionalLine]! { get }

An array of any additional lines connected to this product that were scanned (can be above or below). nil if no lines were found. See BRProductAdditionalLine.


isVoided (read-only)

@property (nonatomic, readonly) BOOL isVoided;
var isVoided: Bool { get }

Indicates whether this is a voided product. Voided products are only returned if BRScanOptions.returnVoidedProducts is set.


shippingStatus (read-only)

@property (nonatomic, strong, readonly) NSString *shippingStatus;
var shippingStatus: String! { get }

For e-receipt orders, this indicates the shipping status of this product.


prodDescPrefix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *prodDescPrefix;
var prodDescPrefix: BRStringValue! { get }

The prefix found before the product description, if any.


prodDescPostfix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *prodDescPostfix;
var prodDescPostfix: BRStringValue! { get }

The postfix found after the product description, if any.


prodNumPrefix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *prodNumPrefix;
var prodNumPrefix: BRStringValue! { get }

The prefix found before the product number, if any.


prodNumPostfix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *prodNumPostfix;
var prodNumPostfix: BRStringValue! { get }

The postfix found after the product number, if any.


pricePostfix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *pricePostfix;
var pricePostfix: BRStringValue! { get }

Text found after a price, if any.


fuelType (read-only)

@property (nonatomic, strong, readonly) NSString *fuelType;
var fuelType: String! { get }

If this product is fuel, this will be the type of fuel (e.g., "Regular", "Unleaded").


seller (read-only)

@property (nonatomic, strong, readonly) NSString *seller;
var seller: String! { get }

The product reseller, if any.


condition (read-only)

@property (nonatomic, strong, readonly) NSString *condition;
var condition: String! { get }

The product condition, if any (e.g., "New", "Used").


productUrl (read-only)

@property (nonatomic, strong, readonly) NSString *productUrl;
var productUrl: String! { get }

The product URL, if any. Usually found in e-receipts.


currencyCode (read-only)

@property (nonatomic, strong, readonly) NSString *currencyCode;
var currencyCode: String! { get }

The currency for this product, if identified. May differ from BRScanResults.currencyCode.


subscriptionFrequency (read-only)

@property (nonatomic, strong, readonly) NSString *subscriptionFrequency;
var subscriptionFrequency: String! { get }

The subscription frequency for this product, if identified (e.g., "every week", "every month").


extendedFields (read-only)

@property (nonatomic, strong, readonly) NSDictionary *extendedFields;
var extendedFields: [AnyHashable : Any]! { get }

Additional product fields.


userAdded (read-only)

@property (nonatomic, readonly) BOOL userAdded;
var userAdded: Bool { get }

Whether the user added this product during the receipt correction flow.


userModified (read-only)

@property (nonatomic, readonly) BOOL userModified;
var userModified: Bool { get }

Whether the user modified this product during the receipt correction flow.


isSensitive (read-only)

@property (nonatomic, readonly) BOOL isSensitive;
var isSensitive: Bool { get }

If BRScanOptions.filterSensitiveData is enabled, indicates whether this product is from a sensitive category as determined by Product Intelligence.


Product Intelligence Properties

These properties are populated when a Product Intelligence key is configured. Without a valid key, they return nil or empty values.

productName (read-only)

@property (nonatomic, strong, readonly) NSString *productName;
var productName: String! { get }

The full product name.


brand (read-only)

@property (nonatomic, strong, readonly) NSString *brand;
var brand: String! { get }

The product brand.


upc (read-only)

@property (nonatomic, strong, readonly) NSString *upc;
var upc: String! { get }

The product UPC.


sector (read-only)

@property (nonatomic, strong, readonly) NSString *sector;
var sector: String! { get }

The product sector (highest level of taxonomy).


department (read-only)

@property (nonatomic, strong, readonly) NSString *department;
var department: String! { get }

The product department.


majorCategory (read-only)

@property (nonatomic, strong, readonly) NSString *majorCategory;
var majorCategory: String! { get }

The product major category.


subCategory (read-only)

@property (nonatomic, strong, readonly) NSString *subCategory;
var subCategory: String! { get }

The product sub-category.


size (read-only)

@property (nonatomic, strong, readonly) NSString *size;
var size: String! { get }

The product size.


itemType (read-only)

@property (nonatomic, strong, readonly) NSString *itemType;
var itemType: String! { get }

The product item type.


imgUrl (read-only)

@property (nonatomic, strong, readonly) NSString *imgUrl;
var imgUrl: String! { get }

The product thumbnail URL (size may vary).


attributes (read-only)

@property (nonatomic, strong, readonly) NSArray<NSDictionary *> *attributes;
var attributes: [[AnyHashable : Any]]! { get }

Zero or more attributes related to the product. Each attribute is a dictionary with a single key-value pair representing the attribute name and value.


probability (read-only)

@property (nonatomic, readonly) float probability;
var probability: Float { get }

If this product is part of a different product's possibleProducts array, indicates how likely this particular product is to match the description of the parent BRProduct.


possibleProducts (read-only)

@property (nonatomic, strong, readonly) NSArray<BRProduct *> *possibleProducts;
var possibleProducts: [BRProduct]! { get }

If Product Intelligence cannot return an exact match, it may return an array of possible products. Each will have only Product Intelligence properties populated.


subProducts (read-only)

@property (nonatomic, strong, readonly) NSArray<BRProduct *> *subProducts;
var subProducts: [BRProduct]! { get }

An array of sub-products tied to this product, if any. Generally only populated for restaurants.


category (read-only)

@property (nonatomic, strong, readonly) NSString *category;
var category: String! { get }

The product category. Note: this is a legacy property — use sector, department, majorCategory, and subCategory instead.


Methods

userCorrectedBrand:upc:productName:imageUrl:totalPrice:quantity:

- (void)userCorrectedBrand:(NSString *)brand
upc:(NSString *)upc
productName:(NSString *)productName
imageUrl:(NSString *)imageUrl
totalPrice:(float)totalPrice
quantity:(float)quantity;
func userCorrectedBrand(
_ brand: String!,
upc: String!,
productName: String!,
imageUrl: String!,
totalPrice: Float,
quantity: Float
)

For a custom user corrections flow: when a user modifies an existing product, call this method to update the product's properties. Pass values for all parameters even if the user did not modify them.

Parameters:

ParameterDescription
brandThe (possibly corrected) product brand
upcThe (possibly corrected) product UPC
productNameThe (possibly corrected) product name
imageUrlThe (possibly corrected) product image URL
totalPriceThe (possibly corrected) total price for this line item
quantityThe (possibly corrected) quantity