ReceiptItem

ReceiptItem(
    tax_category,
    name,
    sub_total,
    amount,
    unit=None,
    price_per_unit=None,
    loyalty_program_qualified=None,
)

Represents an item in a receipt.

Attributes: tax_category (str): The tax category of the item. name (str): The name of the item. sub_total (float): The subtotal of the item. loyalty_program_qualified (Optional[str]): Name of the qualifying loyalty program if applicable. amount (float): The amount of the item. unit (Optional[str]): The unit of the item. price_per_unit (Optional[float]): The price per unit of the item.

Methods

Name Description
to_dict Converts the ReceiptItem instance to a dictionary.

to_dict

ReceiptItem.to_dict()

Converts the ReceiptItem instance to a dictionary.

Returns: dict: A dictionary representation of the ReceiptItem instance.