BRProduct
Describes one product detected on a receipt.
Declaration
@interface BRProduct : NSObject <BRSerializable>
class BRProduct : NSObject, BRSerializable
Quick Reference
Properties
| Property | Description |
|---|---|
productNumber | The product number (SKU, UPC, or other identifier) found on the receipt. |
productDescription | The product description found on the receipt, if any. |
quantity | The product quantity found on the receipt, if any. Can be a count of items or an amount when units are weight. |
unitPrice | The unit price. For example, if the item costs $8/lb, this would be 8.0. |
unitOfMeasure | The unit of measurement for this item (e.g., "pounds", "ounces", "packs"). |
totalPrice | The total price paid for this line item, taking into account quantities, weights, and discounts. |
fullPrice | The total price before any savings were applied to this item. To compute the discount, subtract totalPrice from fullPrice. |
priceAfterCoupons | Price after coupon application. |
additionalLines | 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 | Indicates whether this is a voided product. Voided products are only returned if BRScanOptions.returnVoidedProducts is set. |
shippingStatus | For e-receipt orders, this indicates the shipping status of this product. |
prodDescPrefix | The prefix found before the product description, if any. |
prodDescPostfix | The postfix found after the product description, if any. |
prodNumPrefix | The prefix found before the product number, if any. |
prodNumPostfix | The postfix found after the product number, if any. |
pricePostfix | Text found after a price, if any. |
fuelType | If this product is fuel, this will be the type of fuel (e.g., "Regular", "Unleaded"). |
seller | The product reseller, if any. |
condition | The product condition, if any (e.g., "New", "Used"). |
productUrl | The product URL, if any. Usually found in e-receipts. |
currencyCode | The currency for this product, if identified. May differ from BRScanResults.currencyCode. |
subscriptionFrequency | The subscription frequency for this product, if identified (e.g., "every week", "every month"). |
extendedFields | Additional product fields. |
userAdded | Whether the user added this product during the receipt correction flow. |
userModified | Whether the user modified this product during the receipt correction flow. |
isSensitive | If BRScanOptions.filterSensitiveData is enabled, indicates whether this product is from a sensitive category as determined by Product Intelligence. |
productName | The full product name. |
brand | The product brand. |
upc | The product UPC. |
sector | The product sector (highest level of taxonomy). |
department | The product department. |
majorCategory | The product major category. |
subCategory | The product sub-category. |
size | The product size. |
itemType | The product item type. |
imgUrl | The product thumbnail URL (size may vary). |
attributes | 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 | 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 | 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 | An array of sub-products tied to this product, if any. Generally only populated for restaurants. |
category | The product category. Note: this is a legacy property — use sector, department, majorCategory, and subCategory instead. |
Methods
| Method | Description |
|---|---|
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:
| Parameter | Description |
|---|---|
brand | The (possibly corrected) product brand |
upc | The (possibly corrected) product UPC |
productName | The (possibly corrected) product name |
imageUrl | The (possibly corrected) product image URL |
totalPrice | The (possibly corrected) total price for this line item |
quantity | The (possibly corrected) quantity |