---
schema_version: "1"
id: fbcf2b7fa4d1f4944c4b74d12a37f9b34322b39478c80e2219c5df4f1ffb9202
title: PaymentLineItem Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_RichMessaging_PaymentLineItem.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 506bc41afdbf17d7b1790903bae10dd72b6261f44f49d1c9cab31a872a48621a
description: Represents a payment line item in payment requests sent in enhanced Messaging channels. Creates a new instance of the RichMessaging.PaymentLineItem class.Creates a new instance of the RichMessaging.PaymentLineItem class.Creates a new instance of the RichMessaging.PaymentLineItem class.The amount of the payment line item.The amount value of the payment line item.The automatic reload payment threshold amount of the payment line item.The automatic reload payment threshold amount value of the payment line item.The commerce attributes of the payment line item.The commerce attributes variable for the payment line item.The discount applied to the payment line item.The discount variable for the payment line item.The label of the payment line item.The label value of the payment line item.The line item type of the payment line item. Read-only variable.The quantity of the payment line item.The quantity variable for the payment line item.The sale amount of the payment line item.The sale amount variable for the payment line item.The status of the payment line item.The status value of the payment line item.The timing of the payment line item.The timing value of the payment line item.
---
# PaymentLineItem Class

Represents a payment line item in payment requests sent in enhanced Messaging channels. 

## Namespace

[RichMessaging](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_RichMessaging.htm "Provides objects and methods for handling content in enhanced Messaging channels.")

## Example

public with sharing class MessagingPaymentLineItems {
    
    @InvocableMethod
    public static List<List<RichMessaging.PaymentLineItem>> getLineItems() {
        Double amount = 0.25;
        List<List<RichMessaging.PaymentLineItem>> result = new List<List<RichMessaging.PaymentLineItem>>();
        RichMessaging.PaymentLineItem pizza = new RichMessaging.PaymentLineItem('pizza', amount);
        RichMessaging.PaymentLineItem pasta = new RichMessaging.PaymentLineItem('pasta', amount);
        pizza.statusValue = RichMessaging.PaymentItemStatus.FinalCost;
        pasta.statusValue = RichMessaging.PaymentItemStatus.FinalCost;
        
        List<RichMessaging.PaymentLineItem> options = new List<RichMessaging.PaymentLineItem>{
            pizza, pasta
        };
        result.add(options);
        return result;
    }
    
}

- **[PaymentLineItem Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_constructors)**
- **[PaymentLineItem Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_properties)**
- **[PaymentLineItem Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_methods)**

## PaymentLineItem Constructors

The following are constructors for PaymentLineItem.

- **[PaymentLineItem(label, amount, timing)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_ctor)**  
    Creates a new instance of the RichMessaging.PaymentLineItem class.
- **[PaymentLineItem(label, amount)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_ctor_2)**  
    Creates a new instance of the RichMessaging.PaymentLineItem class.
- **[PaymentLineItem()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_ctor_3)**  
    Creates a new instance of the RichMessaging.PaymentLineItem class.

### PaymentLineItem(label, amount, timing)

Creates a new instance of the RichMessaging.PaymentLineItem class.

#### Signature

public PaymentLineItem(String label, Double amount, RichMessaging.AbstractTiming timing)

#### Parameters

- **label**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The label of the payment line item.
- **amount**: Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.") The amount of the payment line item.
- **timing**: Type: [RichMessaging.AbstractTiming](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_AbstractTiming.htm#apex_class_RichMessaging_AbstractTiming "Parent class for other RichMessaging timing classes.") The timing of the payment line item.

### PaymentLineItem(label, amount)

Creates a new instance of the RichMessaging.PaymentLineItem class.

#### Signature

public PaymentLineItem(String label, Double amount)

#### Parameters

- **label**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The label of the payment line item.
- **amount**: Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.") The amount of the payment line item.

### PaymentLineItem()

Creates a new instance of the RichMessaging.PaymentLineItem class.

#### Signature

public PaymentLineItem()

## PaymentLineItem Properties

The following are properties for PaymentLineItem.

- **[amount](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_amount)**  
    The amount of the payment line item.
- **[amountValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_amountValue)**  
    The amount value of the payment line item.
- **[automaticReloadPaymentThresholdAmount](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_automaticReloadPaymentThresholdAmount)**  
    The automatic reload payment threshold amount of the payment line item.
- **[automaticReloadPaymentThresholdAmountValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_automaticReloadPaymentThresholdAmountValue)**  
    The automatic reload payment threshold amount value of the payment line item.
- **[commerce](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_commerce)**  
    The commerce attributes of the payment line item.
- **[commerceValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_commerceValue)**  
    The commerce attributes variable for the payment line item.
- **[discount](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_discount)**  
    The discount applied to the payment line item.
- **[discountValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_discountValue)**  
    The discount variable for the payment line item.
- **[label](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_label)**  
    The label of the payment line item.
- **[labelValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_labelValue)**  
    The label value of the payment line item.
- **[lineItemType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_lineItemType)**  
    The line item type of the payment line item. Read-only variable.
- **[quantity](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_quantity)**  
    The quantity of the payment line item.
- **[quantityValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_quantityValue)**  
    The quantity variable for the payment line item.
- **[saleAmount](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_saleAmount)**  
    The sale amount of the payment line item.
- **[saleAmountValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_saleAmountValue)**  
    The sale amount variable for the payment line item.
- **[status](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_status)**  
    The status of the payment line item.
- **[statusValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_statusValue)**  
    The status value of the payment line item.
- **[timing](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_timing)**  
    The timing of the payment line item.
- **[timingValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PaymentLineItem.htm#apex_RichMessaging_PaymentLineItem_timingValue)**  
    The timing value of the payment line item.

### amount

The amount of the payment line item.

#### Signature

public Double amount {get; set;}

#### Property Value

Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.")

### amountValue

The amount value of the payment line item.

#### Signature

public Double amountValue {get; set;}

#### Property Value

Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.")

### automaticReloadPaymentThresholdAmount

The automatic reload payment threshold amount of the payment line item.

#### Signature

public Double automaticReloadPaymentThresholdAmount {get; set;}

#### Property Value

Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.")

### automaticReloadPaymentThresholdAmountValue

The automatic reload payment threshold amount value of the payment line item.

#### Signature

public Double automaticReloadPaymentThresholdAmountValue {get; set;}

#### Property Value

Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.")

### commerce

The commerce attributes of the payment line item.

#### Signature

public RichMessaging.OrderItemCommerceAttributes commerce {get; set;}

#### Property Value

Type: [RichMessaging.OrderItemCommerceAttributes](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_OrderItemCommerceAttributes.htm#apex_class_RichMessaging_OrderItemCommerceAttributes "Represents the commerce attributes of an order item.")

### commerceValue

The commerce attributes variable for the payment line item.

#### Signature

public RichMessaging.OrderItemCommerceAttributes commerceValue {get; set;}

#### Property Value

Type: [RichMessaging.OrderItemCommerceAttributes](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_OrderItemCommerceAttributes.htm#apex_class_RichMessaging_OrderItemCommerceAttributes "Represents the commerce attributes of an order item.")

### discount

The discount applied to the payment line item.

#### Signature

public RichMessaging.Discount discount {get; set;}

#### Property Value

Type: RichMessaging.Discount

### discountValue

The discount variable for the payment line item.

#### Signature

public RichMessaging.Discount discountValue {get; set;}

#### Property Value

Type: RichMessaging.Discount

### label

The label of the payment line item.

#### Signature

public String label {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### labelValue

The label value of the payment line item.

#### Signature

public String labelValue {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### lineItemType

The line item type of the payment line item. Read-only variable.

#### Signature

public String lineItemType {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### quantity

The quantity of the payment line item.

#### Signature

public Integer quantity {get; set;}

#### Property Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### quantityValue

The quantity variable for the payment line item.

#### Signature

public Integer quantityValue {get; set;}

#### Property Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### saleAmount

The sale amount of the payment line item.

#### Signature

public Double saleAmount {get; set;}

#### Property Value

Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.")

### saleAmountValue

The sale amount variable for the payment line item.

#### Signature

public Double saleAmountValue {get; set;}

#### Property Value

Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.")

### status

The status of the payment line item.

#### Signature

public String status {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### statusValue

The status value of the payment line item.

#### Signature

public RichMessaging.PaymentItemStatus statusValue {get; set;}

#### Property Value

Type: [RichMessaging.PaymentItemStatus](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_RichMessaging_PaymentItemStatus.htm "Represents the status of a payment item in payment requests sent in enhanced Messaging channels. ")

### timing

The timing of the payment line item.

#### Signature

public RichMessaging.AbstractTiming timing {get; set;}

#### Property Value

Type: [RichMessaging.AbstractTiming](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_AbstractTiming.htm#apex_class_RichMessaging_AbstractTiming "Parent class for other RichMessaging timing classes.")

### timingValue

The timing value of the payment line item.

#### Signature

public RichMessaging.AbstractTiming timingValue {get; set;}

#### Property Value

Type: [RichMessaging.AbstractTiming](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_AbstractTiming.htm#apex_class_RichMessaging_AbstractTiming "Parent class for other RichMessaging timing classes.")

## PaymentLineItem Methods

The following are methods for PaymentLineItem.