Skip to main content

Promotion

Represents a promotion that was evaluated against a receipt.

Package: com.microblink.core

Declaration

class Promotion : Parcelable

Quick Reference

Properties

PropertyDescription
id()Server-assigned promotion identifier
slug()Human-readable promotion slug
reward()Reward value for this promotion
rewardCurrency()Currency code for the reward amount
errorCode()Error code from promotion evaluation
errorMessage()Human-readable error message
qualifications()Groups of product indices satisfying each rule
qualifiedProducts()Products that qualified for this promotion
relatedProductIndexes()Indices of products related to this promotion

Properties

id()

fun id(): Long

Server-assigned promotion identifier.


slug()

fun slug(): String?

Human-readable promotion slug (e.g., "summer-save-5").


reward()

fun reward(): BigDecimal?

Reward value for this promotion.


rewardCurrency()

fun rewardCurrency(): String?

Currency code for the reward amount.


errorCode()

fun errorCode(): Int

Error code from promotion evaluation. 0 indicates success.


errorMessage()

fun errorMessage(): String?

Human-readable error message if errorCode() != 0.


qualifications()

fun qualifications(): List<List<Int>>?

Groups of product indices that satisfy each qualification rule.


qualifiedProducts()

fun qualifiedProducts(): List<QualifiedProduct>?

Products that qualified for this promotion. See QualifiedProduct.


relatedProductIndexes()

fun relatedProductIndexes(): List<Int>?

Indices into ScanResults.products() for products related to this promotion.