---
schema_version: "1"
id: ca62a1eba12ce649eef7346f10a0357ba53aefcb4af58fc067b9cb74719e21cf
title: SubAccounts
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/TPM_SubAccounts.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 40d03574caf1fefd80a185b39c4d4e75303a311415f58f88e6f6742ff4ff4818
description: Creates an empty sub accounts structure.Returns the list of all sub accounts in the sub accounts instance.Serializes the sub accounts information into a generic object. Useful for usage on remote calls.Serializes the sub accounts information into a String used for storage.Adds a sub account information to the current SubAccounts instance. The parameters are the Account External Id, a flag to determine if the sub account is included or excluded and it’s volume percentage (between 0 and 100).Creates an empty sub accounts structure.Loads the serialized sub accounts information into the current instance. The current instance will be cleared and the sub accounts represented by the payload will be loaded.Loads the sub accounts information from the parameter generic object. The current instance will be cleared and the sub accounts represented by the payload will be loaded.Removes all information from the current instance and leaves it empty. Same state as the constructor.Removes the parameter sub account from the instance. If the Sub Account is not part of the instance, nothing is removed.
---
# SubAccounts

Creates an empty sub accounts structure.

## Namespace

cgcloud

- **[TPM\_SubAccounts Methods](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#tpm_sub_accounts_method)**

## TPM\_SubAccounts Methods

The following are methods for TPM\_Scenarios.ScenarioParameter.

- **[global List<SubAccount> getSubAccounts](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#globalTPM_SubAccounts)**  
    Returns the list of all sub accounts in the sub accounts instance.
- **[global Object toGenericObject](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#oGenericObject)**  
    Serializes the sub accounts information into a generic object. Useful for usage on remote calls.
- **[global String toJSON](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#global_String)**  
    Serializes the sub accounts information into a String used for storage.
- **[global SubAccount addSubAccount](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#unique_104221365)**  
    Adds a sub account information to the current SubAccounts instance. The parameters are the Account External Id, a flag to determine if the sub account is included or excluded and it’s volume percentage (between 0 and 100).
- **[global TPM\_SubAccounts](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#unique_355626147)**  
    Creates an empty sub accounts structure.
- **[global TPM\_SubAccounts load](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#unique_1035390390)**  
    Loads the serialized sub accounts information into the current instance. The current instance will be cleared and the sub accounts represented by the payload will be loaded.
- **[global TPM\_SubAccounts load](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#unique_441198258)**  
    Loads the sub accounts information from the parameter generic object. The current instance will be cleared and the sub accounts represented by the payload will be loaded.
- **[global void clear](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#globalvoidclear)**  
    Removes all information from the current instance and leaves it empty. Same state as the constructor.
- **[global void removeSubAccount](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/TPM_SubAccounts.htm#removeSubAccount)**  
    Removes the parameter sub account from the instance. If the Sub Account is not part of the instance, nothing is removed.

### global List<SubAccount> getSubAccounts

Returns the list of all sub accounts in the sub accounts instance.

#### API Version

55

#### Signature

global List<SubAccount> getSubAccounts()

### global Object toGenericObject

Serializes the sub accounts information into a generic object. Useful for usage on remote calls.

#### API Version

55

#### Signature

global Object toGenericObject()

### global String toJSON

Serializes the sub accounts information into a String used for storage.

#### API Version

55

#### Signature

global String toJSON()

### global SubAccount addSubAccount

Adds a sub account information to the current SubAccounts instance. The parameters are the Account External Id, a flag to determine if the sub account is included or excluded and it’s volume percentage (between 0 and 100).

#### API Version

55

#### Signature

global SubAccount addSubAccount(String externalid, Boolean included, Decimal volume)

### global TPM\_SubAccounts

Creates an empty sub accounts structure.

#### API Version

55

#### Signature

global TPM\_SubAccounts

### global TPM\_SubAccounts load

Loads the serialized sub accounts information into the current instance. The current instance will be cleared and the sub accounts represented by the payload will be loaded.

#### API Version

55

#### Signature

global TPM\_SubAccounts load(String payload)

### global TPM\_SubAccounts load

Loads the sub accounts information from the parameter generic object. The current instance will be cleared and the sub accounts represented by the payload will be loaded.

#### API Version

55

#### Signature

global TPM\_SubAccounts load(Object data)

### global void clear

Removes all information from the current instance and leaves it empty. Same state as the constructor.

#### API Version

55

#### Signature

global void clear()

### global void removeSubAccount

Removes the parameter sub account from the instance. If the Sub Account is not part of the instance, nothing is removed.

#### API Version

55

#### Signature

global void removeSubAccount(SubAccount sa)