---
schema_version: "1"
id: bb7638e1c75b482d6708e5d59c2bb8715bbc3e67d6a22821bc5da96a23c6c8d6
title: PostalAddress Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_RichMessaging_PostalAddress.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 979c954b7e55d0de0a4247fe6de12c620616777441f86e100750d98aad959c4c
description: Represents the postal address.Creates a new instance of the RichMessaging.PostalAddress class.The street address.The administrative area.The country.The country code.The locality of the address.The postal code.The sub-administrative area.The sub-locality of the address.
---
# PostalAddress Class

Represents the postal address.

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

- **[PostalAddress Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_constructors)**
- **[PostalAddress Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_properties)**

## PostalAddress Constructors

The following are constructors for PostalAddress.

- **[PostalAddress(addressLines, subLocality, locality, postalCode, subAdministrativeArea, administrativeArea, country, countryCode)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_ctor)**  
    Creates a new instance of the RichMessaging.PostalAddress class.

### PostalAddress(addressLines, subLocality, locality, postalCode, subAdministrativeArea, administrativeArea, country, countryCode)

Creates a new instance of the RichMessaging.PostalAddress class.

#### Signature

public PostalAddress(List<String> addressLines, String subLocality, String locality, String postalCode, String subAdministrativeArea, String administrativeArea, String country, String countryCode)

#### Parameters

- **addressLines**: Type: List<String> The street address.
- **subLocality**: 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 sub-locality of the address.
- **locality**: 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 locality of the address.
- **postalCode**: 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 postal code.
- **subAdministrativeArea**: 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 sub-administrative area.
- **administrativeArea**: 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 administrative area.
- **country**: 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 country.
- **countryCode**: 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 country code.

## PostalAddress Properties

The following are properties for PostalAddress.

- **[addressLines](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_addressLines)**  
    The street address.
- **[administrativeArea](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_administrativeArea)**  
    The administrative area.
- **[country](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_country)**  
    The country.
- **[countryCode](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_countryCode)**  
    The country code.
- **[locality](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_locality)**  
    The locality of the address.
- **[postalCode](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_postalCode)**  
    The postal code.
- **[subAdministrativeArea](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_subAdministrativeArea)**  
    The sub-administrative area.
- **[subLocality](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_PostalAddress.htm#apex_RichMessaging_PostalAddress_subLocality)**  
    The sub-locality of the address.

### addressLines

The street address.

#### Signature

public List<String> addressLines {get; set;}

#### Property Value

Type: List<String>

### administrativeArea

The administrative area.

#### Signature

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

### country

The country.

#### Signature

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

### countryCode

The country code.

#### Signature

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

### locality

The locality of the address.

#### Signature

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

### postalCode

The postal code.

#### Signature

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

### subAdministrativeArea

The sub-administrative area.

#### Signature

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

### subLocality

The sub-locality of the address.

#### Signature

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