BRProduct

Objective-C

@interface BRProduct : NSObject <BRSerializable>

Swift

class BRProduct : NSObject, BRSerializable

Describes one product on a receipt

Properties

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

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRStringValue *productNumber;

    Swift

    var productNumber: BRStringValue! { get }
  • The product description found on the receipt, if any

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRStringValue *productDescription;

    Swift

    var productDescription: BRStringValue! { get }
  • The product quantity found on the receipt, if any (can be # of items or an amount if units are weight)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRFloatValue *quantity;

    Swift

    var quantity: BRFloatValue! { get }
  • The unit price (i.e. if the item costs $8/lb this would be 8.0)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRFloatValue *unitPrice;

    Swift

    var unitPrice: BRFloatValue! { get }
  • The unit of measure for this item (i.e. pounds, ounces, packs, etc)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRStringValue *unitOfMeasure;

    Swift

    var unitOfMeasure: BRStringValue! { get }
  • The total price paid for this line item, taking into account quantities, weights, and discounts

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRFloatValue *totalPrice;

    Swift

    var totalPrice: BRFloatValue! { get }
  • The total price before any savings were applied to this item (to compute the discount on this item, subtract totalPrice from fullPrice)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRFloatValue *fullPrice;

    Swift

    var fullPrice: BRFloatValue! { get }
  • Declaration

    Objective-C

    @property (strong, nonatomic, readonly) BRFloatValue *priceAfterCoupons

    Swift

    var priceAfterCoupons: BRFloatValue! { get }
  • An array of any additional lines connected to this product that were scanned (can be above or below). This array can be nil if no lines were found

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRProductAdditionalLine *> *additionalLines;

    Swift

    var additionalLines: [BRProductAdditionalLine]! { get }
  • Indicates whether this is a voided product. Voided products will only be returned if BRScanOptions.returnVoidedProducts is set

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isVoided;

    Swift

    var isVoided: Bool { get }
  • For e-receipt orders, this indicates the shipping status of this product

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *shippingStatus;

    Swift

    var shippingStatus: String! { get }
  • The prefix found before the product description if any

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRStringValue *prodDescPrefix;

    Swift

    var prodDescPrefix: BRStringValue! { get }
  • The postfix found after the product description if any

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRStringValue *prodDescPostfix;

    Swift

    var prodDescPostfix: BRStringValue! { get }
  • The prefix found before the product number if any

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRStringValue *prodNumPrefix;

    Swift

    var prodNumPrefix: BRStringValue! { get }
  • The postfix found after the product number if any

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BRStringValue *prodNumPostfix;

    Swift

    var prodNumPostfix: BRStringValue! { get }
  • If this product is fuel, this will be the type of fuel (e.g. “Regular”, “Unleaded”, etc)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *fuelType;

    Swift

    var fuelType: String! { get }
  • Additional product fields

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSDictionary *extendedFields;

    Swift

    var extendedFields: [AnyHashable : Any]! { get }
  • The product reseller, if any

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *seller;

    Swift

    var seller: String! { get }
  • The product condition, if any (e.g. “New”, “Used”, etc)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *condition;

    Swift

    var condition: String! { get }
  • The product url, if any (usually found in ereceipts)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *productUrl;

    Swift

    var productUrl: String! { get }
  • The currency for this product, if identified. It can be different from BRScanResults.currencyCode

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *currencyCode;

    Swift

    var currencyCode: String! { get }
  • The subscription frequency for this product, if identified (e.g. every week, every month, etc…)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *subscriptionFrequency;

    Swift

    var subscriptionFrequency: String! { get }

Product Intelligence Properties

  • The full product name

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *productName;

    Swift

    var productName: String! { get }
  • The product brand

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *brand;

    Swift

    var brand: String! { get }
  • The product category (this is a legacy property - it is recommended to use BRProduct.sector, BRProduct.department, BRProduct.majorCategory and BRProduct.subCategory instead

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *category;

    Swift

    var category: String! { get }
  • The product sector (highest level of taxonomy)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *sector;

    Swift

    var sector: String! { get }
  • The product department

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *department;

    Swift

    var department: String! { get }
  • The product major category

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *majorCategory;

    Swift

    var majorCategory: String! { get }
  • The product sub category

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *subCategory;

    Swift

    var subCategory: String! { get }
  • The product size

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *size;

    Swift

    var size: String! { get }
  • upc

    The product UPC

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *upc;

    Swift

    var upc: String! { get }
  • The product item type

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *itemType;

    Swift

    var itemType: String! { get }
  • Zero or more attributes related to the product. Each attribute is a dictionary with a single key-value pair, representing the name of the attribute and its value

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<NSDictionary *> *attributes;

    Swift

    var attributes: [[AnyHashable : Any]]! { get }
  • If this product is part of a different product’s possibleProducts array, then this property indicates an estimate of how likely this particular possible product is to match the description of the parent BRProduct

    Declaration

    Objective-C

    @property (nonatomic, readonly) float probability;

    Swift

    var probability: Float { get }
  • The product thumbnail URL (size may vary)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *imgUrl;

    Swift

    var imgUrl: String! { get }
  • If product intelligence is unable to return an exact product match, it may return an array of possible products. Each of these will have only the above product intelligence properties populated.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRProduct *> *possibleProducts;

    Swift

    var possibleProducts: [BRProduct]! { get }
  • An array of sub products tied to the current product, if any. Generally only populated for restaurants

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRProduct *> *subProducts;

    Swift

    var subProducts: [BRProduct]! { get }
  • Whether the user added this product during the receipt correction flow

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL userAdded;

    Swift

    var userAdded: Bool { get }
  • Whether the user modified this product during the receipt corretion flow

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL userModified;

    Swift

    var userModified: Bool { get }
  • If BRScanOptions.filterSensitiveData is enabled, then this flag will indicate whether the current product is from a sensitive category as determined by product intelligence

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isSensitive;

    Swift

    var isSensitive: Bool { get }
  • For custom user corrections flow, when a user modifies an existing product, call this method to update the product’s properties. Note: You should pass values for all the properties even if the user did not modify them

    Declaration

    Objective-C

    - (void)userCorrectedBrand:(NSString *)brand
                           upc:(NSString *)upc
                   productName:(NSString *)productName
                      imageUrl:(NSString *)imageUrl
                    totalPrice:(float)totalPrice
                      quantity:(float)quantity;

    Swift

    func userCorrectedBrand(_ brand: String!, upc: String!, productName: String!, imageUrl: String!, totalPrice: Float, quantity: Float)

    Parameters

    brand

    The brand, if any, of the modified product

    upc

    The upc, if any, of the modified product

    productName

    The name, if any, of the modified product

    imageUrl

    The image URL, if any, of the modified product

    totalPrice

    The total price of the modified product

    quantity

    The quantity of the modified product