BRScanResults

Objective-C

@interface BRScanResults : NSObject <BRSerializable>

Swift

class BRScanResults : NSObject, BRSerializable

This class holds the scan results for a particular scanning session

Properties

  • For future auto-detect retailer functionality

    Declaration

    Objective-C

    @property (nonatomic, readonly) WFRetailerId retailerId;

    Swift

    var retailerId: WFRetailerId { get }
  • Unique ID for this receipt which allows BlinkReceipt to correspond scan data to the correct receipt image stored by client

    Declaration

    Objective-C

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

    Swift

    var blinkReceiptId: String! { get }
  • An array of BRProduct objects representing the products that were detected on the receipt, if any Some e-receipts may return shipments with products instead of products list directly.

    Declaration

    Objective-C

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

    Swift

    var products: [BRProduct]! { get }
  • An array of BRCoupon objects representing the coupons that were detected on the receipt, if any

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRCoupon *> *coupons;

    Swift

    var coupons: [BRCoupon]! { get }
  • The total detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var total: BRFloatValue! { get }
  • The subtotal detected on the receipt, if any

    Declaration

    Objective-C

    @property (nonatomic, readonly) BRFloatValue *subtotal;

    Swift

    var subtotal: BRFloatValue! { get }
  • The tax detected on the receipt, if any

    Declaration

    Objective-C

    @property (nonatomic, readonly) BRFloatValue *taxes;

    Swift

    var taxes: BRFloatValue! { get }
  • tip

    The tip detected on the receipt, if any

    Declaration

    Objective-C

    @property (nonatomic, readonly) BRFloatValue *tip;

    Swift

    var tip: BRFloatValue! { get }
  • The purchase date found on the receipt formatted as MM/dd/yyyy, if any

    Declaration

    Objective-C

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

    Swift

    var receiptDate: BRStringValue! { get }
  • The purchase time found on the receipt formatted as HH:mm, if any

    Declaration

    Objective-C

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

    Swift

    var receiptTime: BRStringValue! { get }
  • The barcode detected on the receipt, if any. Currently we recognize Code 39, Code 128, and ITF formats

    Declaration

    Objective-C

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

    Swift

    var barcode: String! { get }
  • The store number detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var storeNumber: BRStringValue! { get }
  • The store name detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var merchantName: BRStringValue! { get }
  • If there is client-specific version of a particular merchant, it will be passed back in this property

    Declaration

    Objective-C

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

    Swift

    var clientMerchantName: BRStringValue! { get }
  • An array of NSNumber objects wrapping BRMerchantSource values indicating which merchant detection method(s) succeeded in identifying the current merchant. This will be nil if no merchant was detected (i.e. merchantName == nil)

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<NSNumber *> *merchantSources;

    Swift

    var merchantSources: [NSNumber]! { get }
  • When no merchant is detected using standard methods, the parser will occasionally return a best guess for the merchant based on receipt heuristics.

    Declaration

    Objective-C

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

    Swift

    var merchantGuess: String! { get }
  • The mall name in which the retailer is located, if any

    Declaration

    Objective-C

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

    Swift

    var mallName: BRStringValue! { get }
  • The store street address detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var storeAddress: BRStringValue! { get }
  • The store city detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var storeCity: BRStringValue! { get }
  • The store state detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var storeState: BRStringValue! { get }
  • The store zipcode detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var storeZip: BRStringValue! { get }
  • The store phone number detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var storePhone: BRStringValue! { get }
  • The cashier ID detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var cashierId: BRStringValue! { get }
  • The transaction ID detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var transactionId: BRStringValue! { get }
  • Some receipts contain a longer transaction number in addition to the standard one

    Declaration

    Objective-C

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

    Swift

    var longTransactionId: BRStringValue! { get }
  • The register ID detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var registerId: BRStringValue! { get }
  • An array of BRPaymentMethod objects representing all payment methods found on the receipt, if any

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRPaymentMethod *> *paymentMethods;

    Swift

    var paymentMethods: [BRPaymentMethod]! { get }
  • The last 4 digits of the credit card used, if any

    Declaration

    Objective-C

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

    Swift

    var last4CC: BRStringValue! { get }
  • The tax ID of the retailer, if any

    Declaration

    Objective-C

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

    Swift

    var taxId: BRStringValue! { get }
  • The retail channel for this receipt, if any

    Declaration

    Objective-C

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

    Swift

    var channel: BRStringValue! { get }
  • The unique identifier associated with the payment processor’s terminal

    Declaration

    Objective-C

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

    Swift

    var paymentTerminalId: BRStringValue! { get }
  • The unique identifier associated with the payment processor’s transaction

    Declaration

    Objective-C

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

    Swift

    var paymentTransactionId: BRStringValue! { get }
  • Represents the type of purchase

    Declaration

    Objective-C

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

    Swift

    var purchaseType: String! { get }
  • Whether there is an indication of a loyalty program found on the receipt

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL loyaltyProgram;

    Swift

    var loyaltyProgram: Bool { get }
  • Whether the purchase was made by an Instacart shopper

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isInstacartShopper;

    Swift

    var isInstacartShopper: Bool { get }
  • An average confidence (between 0 and 100) for the OCR performed on this receipt

    Declaration

    Objective-C

    @property (nonatomic, readonly) float ocrConfidence;

    Swift

    var ocrConfidence: Float { get }
  • Indicates whether any server lookups were still pending at the time results were returned to the client

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL serverLookupsCompleted;

    Swift

    var serverLookupsCompleted: Bool { get }
  • Indicates whether a top edge was found on any frame that was scanned in this session

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL foundTopEdge;

    Swift

    var foundTopEdge: Bool { get }
  • Indicates whether a bottom edge was found on any frame that was scanned in this session

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL foundBottomEdge;

    Swift

    var foundBottomEdge: Bool { get }
  • Indicates whether the subtotal matches the sum of the products and coupons

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL subtotalMatches;

    Swift

    var subtotalMatches: Bool { get }
  • The currency for this receipt, if identified

    Declaration

    Objective-C

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

    Swift

    var currencyCode: String! { get }
  • Indicates how many products were still awaiting product intelligence results when the scan session ended

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger productsPendingLookup;

    Swift

    var productsPendingLookup: Int { get }
  • Indicate whether the receipt is a duplicate (depends on BRScanOptions.detectDuplicates being enabled)

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isDuplicate;

    Swift

    var isDuplicate: Bool { get }
  • Indicate whether the receipt is believed to be fraudulent (depends on BRScanOptions.detectDuplicates being enabled)

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isFraudulent;

    Swift

    var isFraudulent: Bool { get }
  • If isDuplicate is true, this property contains the Blink Receipt ID(s) of the duplicate receipts

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<NSString *> *duplicateBlinkReceiptIds;

    Swift

    var duplicateBlinkReceiptIds: [String]! { get }
  • If promotion validation is enabled, this will contain all the promotions that were validated

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRPromotion *> *qualifiedPromotions;

    Swift

    var qualifiedPromotions: [BRPromotion]! { get }
  • If promotion validation is enabled, this will contain all the promotions that were NOT validated

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRPromotion *> *unqualifiedPromotions;

    Swift

    var unqualifiedPromotions: [BRPromotion]! { get }
  • If promotion validation is enabled, this will contain all the surveys that were validated

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRSurvey *> *qualifiedSurveys;

    Swift

    var qualifiedSurveys: [BRSurvey]! { get }
  • Additional receipt fields

    Declaration

    Objective-C

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

    Swift

    var extendedFields: [AnyHashable : Any]! { get }
  • For an Amazon or e-receipt order, this is the order number

    Declaration

    Objective-C

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

    Swift

    var ereceiptOrderNumber: String! { get }
  • For an e-receipt order, this is the order status

    Declaration

    Objective-C

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

    Swift

    var ereceiptOrderStatus: String! { get }
  • For an Amazon or e-receipt order, this is the raw HTML that was parsed

    Declaration

    Objective-C

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

    Swift

    var ereceiptRawHTML: String! { get }
  • The name of the email provider from which this e-receipt was obtained

    Declaration

    Objective-C

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

    Swift

    var ereceiptEmailProvider: String! { get }
  • The sender address for this e-receipt

    Declaration

    Objective-C

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

    Swift

    var ereceiptMerchantEmail: String! { get }
  • The subject of the e-receipt email

    Declaration

    Objective-C

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

    Swift

    var ereceiptEmailSubject: String! { get }
  • For e-receipt orders, if aggregation is turned on, this property will contain the scan results objects from each component email for a given order. However, please note that for emails related to the same order that were originally seen in a different scrape session, the only property of the BRScanResults object that will be populated is the blinkReceiptId

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRScanResults *> *ereceiptComponentEmails;

    Swift

    var ereceiptComponentEmails: [BRScanResults]! { get }
  • For an Amazon or e-receipt order, this is the type of purchase

    Declaration

    Objective-C

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

    Swift

    var ereceiptPurchaseType: String! { get }
  • The name of the 3rd party service (like Instacart) that fulfilled this order, if any

    Declaration

    Objective-C

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

    Swift

    var ereceiptFulfilledBy: String! { get }
  • The name of the sub-merchant (like “McDonald’s” for some Uber Eats orders), if any

    Declaration

    Objective-C

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

    Swift

    var ereceiptSubMerchant: String! { get }
  • The point of sale system used for this order, if any

    Declaration

    Objective-C

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

    Swift

    var ereceiptPOSSystem: String! { get }
  • The internal identifier of this email message from the provider

    Declaration

    Objective-C

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

    Swift

    var ereceiptEmailId: String! { get }
  • The shipping costs for this e-receipt, if any

    Declaration

    Objective-C

    @property (nonatomic, readonly) float ereceiptShippingCosts;

    Swift

    var ereceiptShippingCosts: Float { get }
  • Whether this e-receipt could be authenticated via DKIM or SPF headers

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL ereceiptAuthenticated;

    Swift

    var ereceiptAuthenticated: Bool { get }
  • Whether the email was successfully identified as an e-receipt or related message (as opposed to a marketing message, etc)

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL ereceiptIsValid;

    Swift

    var ereceiptIsValid: Bool { get }
  • Additional fees / charges for this e-receipt, if any (like tips, bag / bottle fees, etc…) Each key-value pair, represents the name of the fee and its amount { “Tips”: “2.19”, “Bag Fee”: “0.05” }

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSDictionary<NSString *, NSString *> *ereceiptAdditionalFees;

    Swift

    var ereceiptAdditionalFees: [String : String]! { get }
  • An array of BRShipment objects representing all shipments discovered in this order

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<BRShipment *> *shipments;

    Swift

    var shipments: [BRShipment]! { get }
  • NSString representing cumulative set of raw results

    Declaration

    Objective-C

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

    Swift

    var combinedRawText: String! { get }
  • Float value representing cashback amount

    Declaration

    Objective-C

    @property (nonatomic, readonly) float cashback;

    Swift

    var cashback: Float { get }
  • A set of raw product data results

    Declaration

    Objective-C

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

    Swift

    var rawBasketText: String! { get }
  • A set of raw trip results found on top of receipt

    Declaration

    Objective-C

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

    Swift

    var rawTripHeaderText: String! { get }
  • A set of raw trip results found on bottom of receipt

    Declaration

    Objective-C

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

    Swift

    var rawTripFooterText: String! { get }
  • Loyalty member number detected on the receipt, if any

    Declaration

    Objective-C

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

    Swift

    var memberNumber: String! { get }
  • For custom user corrections flow, if the user adds a new product, call this method to add it to this scan results object

    Declaration

    Objective-C

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

    Swift

    func addUserCorrectedProduct(withBrand brand: String!, upc: String!, productName: String!, imageUrl imgUrl: String!, totalPrice: Float, quantity: Float)

    Parameters

    brand

    The brand, if any, of the new product

    upc

    The upc, if any, of the new product

    productName

    The name, if any, of the new product

    imgUrl

    The image URL, if any, of the new product

    totalPrice

    The total price of the new product

    quantity

    The quantity of the new product

  • For custom user corrections flow, when a user modifies the date, call this method to update the receipt’s purchase date

    Declaration

    Objective-C

    - (void)userCorrectedDate:(NSString *)dateString;

    Swift

    func userCorrectedDate(_ dateString: String!)

    Parameters

    dateString

    The date in MM/dd/yyyy format

  • For custom user corrections flow, when a user modifies the total, call this method to update the receipt’s purchase total

    Declaration

    Objective-C

    - (void)userCorrectedTotal:(float)total;

    Swift

    func userCorrectedTotal(_ total: Float)

    Parameters

    total

  • For custom user corrections flow, when a user modifies the merchant, call this method to update the receipt’s purchase merchant name

    Declaration

    Objective-C

    - (void)userCorrectedMerchant:(NSString *)name;

    Swift

    func userCorrectedMerchant(_ name: String!)

    Parameters

    name