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

# List merchant groups

> To return an array of all merchant groups, send a GET request to the /merchantgroups endpoint.

GET/merchantgroups

To return an array of all merchant groups, send a `GET` request to the `/merchantgroups` endpoint.

To return an array of all merchant groups that include a specific merchant identifier, send a `GET` request to the `/merchantgroups` endpoint that includes the merchant identifier in the query parameters.

## URL query parameters

| Fields | Description |
| - | - |
| mid string  Optional | Returns all merchant groups that contain the specified merchant identifier. **Allowable Values:**  Existing merchant identifier |
| count integer  Optional | Number of resources to retrieve. **Allowable Values:**  1-10 **Default value:** 10 |
| start\_index integer  Optional | Sort order index of the first resource in the returned array. **Allowable Values:**  Any integer **Default value:** 0 |
| sort\_by string  Optional | Field on which to sort. Use any field in the resource model, or one of the system fields `lastModifiedTime` or `createdTime`. Prefix the field name with a hyphen (`-`) to sort in descending order. Omit the hyphen to sort in ascending order. **Allowable Values:**  `createdTime`, `lastModifiedTime`, or any field in the resource model **Default value:** `-lastModifiedTime` |

## Response body

| Fields | Description |
| - | - |
| count integer  Conditionally returned | Number of resources retrieved. This field is returned if there are resources in your returned array. **Allowable Values:**  Any integer |
| data array of objects  Conditionally returned | Array of merchant group resources. Resources are returned as appropriate to your query. **Allowable Values:**  Valid array of one or more merchant group objects |
| data\[].**active** boolean  Conditionally returned | Indicates if the merchant group is active or not. **Allowable Values:**  `true`, `false` |
| data\[].**created\_time** datetime  Conditionally returned | Date and time when the resource was created, in UTC. **Allowable Values:**  Format: yyyy-MM-ddThh:mm:ssZ |
| data\[].**last\_modified\_time** datetime  Conditionally returned | Date and time when the resource was last modified, in UTC. **Allowable Values:**  Format: yyyy-MM-ddThh:mm:ssZ |
| data\[].**mids** array of strings  Conditionally returned | Comma-separated list of alphanumeric merchant identifiers. **Allowable Values:**  Valid array of one or more merchant identifiers |
| data\[].**name** string  Conditionally returned | Name of the merchant group. **Allowable Values:**  40 char max |
| data\[].**token** string  Conditionally returned | Unique identifier of the merchant group. **Allowable Values:**  Existing merchant group token |
| end\_index integer  Conditionally returned | The sort order index of the last resource in the returned array. This field is returned if there are resources in your returned array. **Allowable Values:**  Any integer |
| is\_more boolean  Conditionally returned | A value of `true` indicates that more unreturned resources exist. A value of `false` indicates that no more unreturned resources exist. This field is returned if there are resources in your returned array. **Allowable Values:**  `true`, `false` |
| start\_index integer  Conditionally returned | Sort order index of the last resource in the returned array. This field is returned if there are resources in your returned array. **Allowable Values:**  Any integer |

## Sample response body

```json JSON expandable lines wrap theme={null}
{
  "count": 2,
  "start_index": 0,
  "end_index": 1,
  "is_more": false,
  "data": [
    {
      "token": "my_merchantgroup",
      "name": "My Merchant Group",
      "mids": [
        "123456789012345",
        "345123456789012",
        "123456789012"
      ],
      "active": true,
      "created_time": "2022-05-01T13:22:07Z",
      "last_modified_time": "2022-05-01T13:32:07Z"
    },
    {
      "token": "my_merchantgroup_01",
      "name": "My Merchant Group 01",
      "mids": [
        "998877665544331",
        "246813579000"
      ],
      "active": true,
      "created_time": "2021-05-02T01:42:07Z",
      "last_modified_time": "2022-05-02T01:42:07Z"
    }
  ]
}
```


## Related topics

- [Merchant Groups Overview](https://www.marqeta.com/docs/core-api/merchant-groups.md)
- [Update merchant group](https://www.marqeta.com/docs/core-api/merchant-groups/update-merchant-group.md)
- [Create merchant group](https://www.marqeta.com/docs/core-api/merchant-groups/create-merchant-group.md)
- [Retrieve merchant group](https://www.marqeta.com/docs/core-api/merchant-groups/retrieve-merchant-group.md)
- [List MCC groups](https://www.marqeta.com/docs/core-api/mcc-groups/list-mcc-groups.md)
