> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m3ter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Compoundaggregations

## List Compound Aggregations

**Function name:** `m3ter_ListCompoundAggregations`
**Category:** READ
**HTTP method:** GET (paginated)
**Destination:** m3ter

Retrieve a list of all Compound Aggregations.

This endpoint retrieves a list of Compound Aggregations associated with a specific organization. Compound Aggregations enable you to define numerical measures based on simple Aggregations of usage data. It supports pagination, and includes various query parameters to filter the Compound Aggregations based on Product, Compound Aggregation IDs or short codes.

### Parameters

| Name                       | Label            | Type                    | Required | Description                                | Constraints                                                           |
| -------------------------- | ---------------- | ----------------------- | :------: | ------------------------------------------ | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials      | M3terEntityParameter    |    Yes   | The m3ter credentials to use.              | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `statePath`                | State Path       | StateVariableParameter  |    No    | State variable to store the response.      | -                                                                     |
| `queryParams`              | Query Parameters | KeyValueLookupParameter |    No    | Query parameters to include in the request | allowedValues: productId,ids,codes                                    |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |

## Create Compound Aggregation

**Function name:** `m3ter_PostCompoundAggregation`
**Category:** WRITE
**HTTP method:** POST
**Destination:** m3ter

Create a new Compound Aggregation.

This endpoint allows you to create a new Compound Aggregation for a specific Organization. The request body must include all the necessary details such as the Calculation formula.

### Parameters

| Name                       | Label        | Type                   | Required | Description                            | Constraints                                                           |
| -------------------------- | ------------ | ---------------------- | :------: | -------------------------------------- | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials  | M3terEntityParameter   |    Yes   | The m3ter credentials to use.          | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `requestPath`              | Request Path | StateVariableParameter |    Yes   | State variable containing the request. | -                                                                     |
| `statePath`                | State Path   | StateVariableParameter |    No    | State variable to store the response.  | -                                                                     |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |

## Retrieve Compound Aggregation

**Function name:** `m3ter_GetCompoundAggregation`
**Category:** READ
**HTTP method:** GET
**Destination:** m3ter

Retrieve a Compound Aggregation using the given UUID.

This endpoint returns a specific Compound Aggregation associated with an Organization. It provides detailed information about the Compound Aggregation.

### Parameters

| Name                       | Label       | Type                   | Required | Description                                                           | Constraints                                                           |
| -------------------------- | ----------- | ---------------------- | :------: | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials | M3terEntityParameter   |    Yes   | The m3ter credentials to use.                                         | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `id`                       | id          | LookupParameter        |    Yes   | The unique identifier (UUID) of the Compound Aggregation to retrieve. | -                                                                     |
| `statePath`                | State Path  | StateVariableParameter |    No    | State variable to store the response.                                 | -                                                                     |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |

## Update Compound Aggregation

**Function name:** `m3ter_PutCompoundAggregation`
**Category:** WRITE
**HTTP method:** PUT
**Destination:** m3ter

Update the Compound Aggregation with the given UUID.

This endpoint allows you to update the details of a specific Compound Aggregation associated with an Organization. Use it to modify details of an existing Compound Aggregation such as the Calculation formula.

**Note:** If you have created Custom Fields for a Compound Aggregation, when you use this endpoint to update the Compound Aggregation use the `customFields` parameter to preserve those Custom Fields. If you omit them from the update request, they will be lost.

### Parameters

| Name                       | Label        | Type                   | Required | Description                                                         | Constraints                                                           |
| -------------------------- | ------------ | ---------------------- | :------: | ------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials  | M3terEntityParameter   |    Yes   | The m3ter credentials to use.                                       | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `id`                       | id           | LookupParameter        |    Yes   | The unique identifier (UUID) of the Compound Aggregation to update. | -                                                                     |
| `requestPath`              | Request Path | StateVariableParameter |    Yes   | State variable containing the request.                              | -                                                                     |
| `statePath`                | State Path   | StateVariableParameter |    No    | State variable to store the response.                               | -                                                                     |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |

## Delete Compound Aggregation

**Function name:** `m3ter_DeleteCompoundAggregation`
**Category:** WRITE
**HTTP method:** DELETE
**Destination:** m3ter

Delete a Compound Aggregation with the given UUID.

This endpoint enables deletion of a specific Compound Aggregation associated with a specific Organization. Useful when you need to remove an existing Compound Aggregation that is no longer required, such as when changing pricing or planning models.

### Parameters

| Name                       | Label       | Type                   | Required | Description                                                         | Constraints                                                           |
| -------------------------- | ----------- | ---------------------- | :------: | ------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials | M3terEntityParameter   |    Yes   | The m3ter credentials to use.                                       | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `id`                       | id          | LookupParameter        |    Yes   | The unique identifier (UUID) of the Compound Aggregation to delete. | -                                                                     |
| `statePath`                | State Path  | StateVariableParameter |    No    | State variable to store the response.                               | -                                                                     |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |
