---
schema_version: "1"
id: 30737ff9406b752b7cb30c03411406e52a43c82f78d58640999e0aa5f462ddd5
title: ShippingMethod Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_RichMessaging_ShippingMethod.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1ace9a41df880cdb5f6846ad54d56b82b8ee20d55353efbeeceb175e4c3c75fa
description: Represents a shipping method listed in payment requests sent in enhanced Messaging channels.Creates a new instance of the RichMessaging.ShippingMethod class.Creates a new instance of the RichMessaging.ShippingMethod class.The amount of the shipping method.The amount value of the shipping method.Details about the shipping method.The detail value of the shipping method.The identifier of the shipping method.The identifier value of the shipping method.The label of the shipping method.The label value of the shipping method.The shipping method type. Read only.
---
# ShippingMethod Class

Represents a shipping method listed 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 MessagingShippingMethods {
    
    @InvocableMethod
    public static List<List<RichMessaging.ShippingMethod>> getShippingMethods(){
        Double amount = 0.25;
        List<List<RichMessaging.ShippingMethod>> result = new List<List<RichMessaging.ShippingMethod>>();
        
        List<RichMessaging.ShippingMethod> options = new List<RichMessaging.ShippingMethod>{
            new RichMessaging.ShippingMethod('doordash', amount, '1 hour delivery to your door', 'ddash'),
            new RichMessaging.ShippingMethod('UPS', amount, '2 days delivery', 'UPS')
        };
        result.add(options);
        return result;
    }
    
}

- **[ShippingMethod Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_constructors)**
- **[ShippingMethod Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_properties)**

## ShippingMethod Constructors

The following are constructors for ShippingMethod.

- **[ShippingMethod(label, amount, detail, identifier)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_ctor)**  
    Creates a new instance of the RichMessaging.ShippingMethod class.
- **[ShippingMethod()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_ctor_2)**  
    Creates a new instance of the RichMessaging.ShippingMethod class.

### ShippingMethod(label, amount, detail, identifier)

Creates a new instance of the RichMessaging.ShippingMethod class.

#### Signature

public ShippingMethod(String label, Double amount, String detail, String identifier)

#### 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 shipping method.
- **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 shipping method.
- **detail**: 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.") Details about the shipping method.
- **identifier**: 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 identifier of the shipping method.

### ShippingMethod()

Creates a new instance of the RichMessaging.ShippingMethod class.

#### Signature

public ShippingMethod()

## ShippingMethod Properties

The following are properties for ShippingMethod.

- **[amount](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_amount)**  
    The amount of the shipping method.
- **[amountValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_amountValue)**  
    The amount value of the shipping method.
- **[detail](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_detail)**  
    Details about the shipping method.
- **[detailValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_detailValue)**  
    The detail value of the shipping method.
- **[identifier](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_identifier)**  
    The identifier of the shipping method.
- **[identifierValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_identifierValue)**  
    The identifier value of the shipping method.
- **[label](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_label)**  
    The label of the shipping method.
- **[labelValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_labelValue)**  
    The label value of the shipping method.
- **[shippingMethodType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_ShippingMethod.htm#apex_RichMessaging_ShippingMethod_shippingMethodType)**  
    The shipping method type. Read only.

### amount

The amount of the shipping method.

#### 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 shipping method.

#### 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.")

### detail

Details about the shipping method.

#### Signature

public String detail {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.")

### detailValue

The detail value of the shipping method.

#### Signature

public String detailValue {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.")

### identifier

The identifier of the shipping method.

#### Signature

public String identifier {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.")

### identifierValue

The identifier value of the shipping method.

#### Signature

public String identifierValue {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.")

### label

The label of the shipping method.

#### 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 shipping method.

#### 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.")

### shippingMethodType

The shipping method type. Read only.

#### Signature

public String shippingMethodType {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.")