---
schema_version: "1"
id: 95d7083fda66baec93b9ce81ba676e9e347af55310001f7082f738ae7d6904e9
title: addToGroup Method
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-addtogroup-method.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-addtogroup-method.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b09b2e7c1f79b21aa175280c06f4fa16575d6395e2bd5280715ffe6f43fae007
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# addToGroup Method

Adds a service point to a group.

<!-- Section title is the name of the method followed by "Method". If appropriate, precede the method name with the class name and a colon.-->

## Class

<!-- broken link-->

<!-- Link(s) to the class(es) to which this method belongs. If more than one class implements the same interface, use an itemized list. Don't use a link if the class itself isn't documented for users, but do list the class name.-->


## Input Parameters

<!-- If this method has separate input and output parameters, split this section into two sections titled "Input Parameters" and "Output Parameters". Some methods of classes that implement VlocityOpenInterface2 might require an "Options Parameters" section as well.-->

| Parameter   | Required                                         | Description                                                                                                                                                                                                                                                                                                                                    |
| ----------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| parentId    | Required                                         | Opportunity ID.                                                                                                                                                                                                                                                                                                                                |
| contextId   | Required                                         | Parent cart Id (Master/Enterprise Quote/Order Id)                                                                                                                                                                                                                                                                                              |
| groupId     | Required                                         | Group ID.                                                                                                                                                                                                                                                                                                                                      |
| groupCartId | Required if corresponding cart record is present | Group Quote/Order Id.                                                                                                                                                                                                                                                                                                                          |
| groupJSON   | Required                                         | Pass the IDs of member to add to the group.`{"servicePoints":["a3R6g000000BAN3EAO", "a3R6g000000BAN4EAO"]}`                                                                                                                                                                                                                                    |
| filters     | Optional                                         | A SOQL condition added by the API to narrow query results. For custom CPQ Group Member Types in Custom Metadata, no context filter is applied automatically. You must include a filter (e.g., OpportunityId\_\_c:0060b00000vGbYbAAK) to limit results to the relevant Quote, Opportunity, or Account; otherwise, all records will be returned. |
| cartType    | Optional: Defaults to Quote                      | Quote or Order                                                                                                                                                                                                                                                                                                                                 |
| memberType  | Optional: Defaults to ServicePoint               | CPQ Group Member Type Name. For example: ServicePoint                                                                                                                                                                                                                                                                                          |

## Output Parameters

| Parameter | Description           |
| --------- | --------------------- |
| message   | In case of any error. |


## Example Input Data

<!-- This is usually JSON, but it could be XML or a single value. For methods of classes implementing VlocityOpenInterface2 that have options parameters, include those here.-->

```
{"groupId":"a4M0b000002CWMaEAO","groupCartId":"0Q00b000000znU2CAI","groupName":"South Group","parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","groupJSON":{"servicePoints":["a3h0b00000CwSUFAA3","a3h0b00000CwSUGAA3"]},"memberType":"ServicePoint","OpportunityId\_\_c":"0060b00000vGbYbAAK","cartType":"Quote"}
```

## Example Output Data

<!-- This is usually JSON, but it could be XML or a single value. Salesforce uses Return Type, but this takes care of that.-->

```
{"error":"OK"}
```

