> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/retail-stores/retail-store-groups/list-retail-store-groups.md).

# List retail store groups

Returns the retail store groups. All matching groups are returned in a single page (see **Pagination** in the section description). No default ordering is applied; use `sort` to order the results.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Retail Store Groups","description":"Administrative endpoints for **retail store groups** — named groups of retail stores. A store belongs to at most one group (the store's `group` field), and a group is identified across the platform by its unique `slug`.\n\nGroups are used by the scheduled-delivery (slot) features:\n* **Schedules** are assigned to retail store groups. When delivery slots are generated or validated for a scheduled delivery, only the schedules of the delivery's retail store group are considered.\n* **Slot suspenders** with the `retail_store_group` rule match stores by the **slug** of their group (see the **Slot Suspenders** section).\n\n## Core Capabilities\n\n**1. Listing & Filtering**\n* Retrieve the list of retail store groups. All matching groups are returned in a single page (see **Pagination**).\n* Filter by `name`; order with the `sort` parameter.\n\n**2. Group Lifecycle Management**\n* Create a group and assign its stores in the same request.\n* Retrieve a single group.\n* Fully (`PUT`) or partially (`PATCH`) update a group, including its store membership (see **Store Membership**).\n* Delete a group that has no stores (see **Deleting a Retail Store Group**).\n\n## Retail Store Group Fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `pk` | integer | The unique identifier of the group. Read-only. |\n| `name` | string (max 255) | The group name. Required on create and full update. Not unique. |\n| `slug` | string (max 64) | The unique identifier of the group, made of letters, numbers, underscores, or hyphens. Required on create and full update; it is not generated from `name`. Referenced by slot suspender rules. |\n| `is_active` | boolean | Whether the group is active. Defaults to `true` (see **Form-Encoded Requests** for an exception). Stored and returned only — it is not checked when schedules or slot suspender rules are matched to a group. |\n| `stores` | array of integer | The identifiers of the retail stores in the group. Required on create and full update; an empty list is accepted. |\n| `schedules` | array of integer | Read-only. The identifiers of the schedules assigned to the group. Schedules are assigned through the `schedules` endpoints; a value sent here is ignored. |\n\n## Store Membership\n\nStore membership is stored on the store (each store has a single `group`), so writing `stores` changes the stores themselves:\n* **Create** assigns every listed store to the new group.\n* **Update** (`PUT`, or `PATCH` with `stores`) makes the listed stores the group's exact members — listed stores are assigned to the group, and stores of the group that are not listed are detached from it (their `group` becomes `null`). A `PATCH` without `stores` leaves the membership unchanged.\n* A store that already belongs to **another** group is moved to this group and silently leaves its previous group.\n* Every identifier must belong to an existing retail store; an unknown identifier is rejected with `400`.\n\n## Form-Encoded Requests\n\nThe write operations also accept `multipart/form-data` and `application/x-www-form-urlencoded` bodies. In a form-encoded **create** or **full update** (`PUT`), fields that are left out are not treated as missing:\n* A missing `stores` is read as an empty list instead of being rejected — on `PUT` this detaches every store from the group.\n* A missing `is_active` is read as `false`.\n\nA form-encoded `PATCH` keeps the stored value of every field it leaves out. Send `stores` and `is_active` explicitly, or use JSON.\n\n## Pagination\n\nThis endpoint returns **all** matching groups in a single page; the `page` and `limit` parameters are accepted for envelope consistency but do not paginate the result. The response keeps the standard `{count, next, previous, results}` shape, with `next` and `previous` always `null`.\n\n## Deleting a Retail Store Group\n\n> **Important:** `DELETE /retailstoregroups/{id}/` is a **hard delete**. A group that still has at least one store is rejected with `400`; the response body is a plain list of messages (`[\"Retail store group has at least one retail store.\"]`), not a field-keyed object. Remove the stores first — for example with a `PATCH` that sends `\"stores\": []`. Deleting a group also removes it from every schedule it was assigned to.\n\n## Filtering & Ordering\n\n| Parameter | Match |\n|-----------|-------|\n| `name` | Exact, case-sensitive match on the group name. |\n\nNo default ordering is applied. Use the `sort` parameter to order the results (for example `sort=name` or `sort=-pk`); prefix a field with a hyphen for descending order.\n\n## Dynamic Settings & Environment Variables\n\nNo dynamic setting changes the request or response schema of these endpoints, and no environment variables are read directly. The setting below affects their side effects. It is referenced again in the description of the operation it affects.\n\n| Key | Type | Default | Effect |\n|-----|------|---------|--------|\n| `IGNORE_DELETED_ITEMS_SIGNAL` | array of strings | `[\"django_audit_events.AuditEvent\", \"django_audit_events.ArchivedAuditEvent\", \"sessions.Session\", \"datawarehouse.DeletedItem\"]` | The model labels excluded from delete tracking. Affects **delete**: unless `address.RetailStoreGroup` is added to this list, deleting a group also records a deleted-item entry, which is exposed through the data-warehouse `deleted-items` endpoint. The API response is identical either way. |"}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/v1/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"parameters":{"sort":{"name":"sort","in":"query","required":false,"description":"Orders the results by one or more fields. Separate multiple fields with commas. Prefix a field with a hyphen (`-`) for descending order.","schema":{"type":"string"}},"retailStoreGroupNameFilter":{"name":"name","in":"query","required":false,"description":"Filter by name. Exact, case-sensitive match.","schema":{"type":"string"}}},"schemas":{"PaginatedRetailStoreGroupList":{"type":"object","description":"A list of retail store groups. This endpoint returns all matching groups in a single page, so `next` and `previous` are always `null`.","properties":{"count":{"type":"integer","description":"Total number of groups matching the request."},"next":{"type":["string","null"],"format":"uri","description":"Always `null` — the endpoint is not paginated."},"previous":{"type":["string","null"],"format":"uri","description":"Always `null` — the endpoint is not paginated."},"results":{"type":"array","description":"The retail store groups.","items":{"$ref":"#/components/schemas/RetailStoreGroup"}}}},"RetailStoreGroup":{"type":"object","description":"A retail store group — a named group of retail stores, used by schedules and slot suspender rules.","properties":{"pk":{"type":"integer","readOnly":true,"description":"The unique identifier of the group."},"is_active":{"type":"boolean","description":"Whether the group is active. Not checked when schedules or slot suspender rules are matched to a group.","default":true},"name":{"type":"string","maxLength":255,"description":"The group name."},"stores":{"type":"array","description":"The identifiers of the retail stores in the group.","items":{"type":"integer"}},"slug":{"type":"string","maxLength":64,"pattern":"^[-a-zA-Z0-9_]+$","description":"The unique identifier of the group. Referenced by slot suspender rules."},"schedules":{"type":"array","readOnly":true,"description":"The identifiers of the schedules assigned to the group.","items":{"type":"integer"}}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/retailstoregroups/":{"get":{"tags":["Retail Store Groups"],"operationId":"listRetailStoreGroups","summary":"List retail store groups","description":"Returns the retail store groups. All matching groups are returned in a single page (see **Pagination** in the section description). No default ordering is applied; use `sort` to order the results.","parameters":[{"$ref":"#/components/parameters/sort"},{"$ref":"#/components/parameters/retailStoreGroupNameFilter"}],"responses":{"200":{"description":"The retail store groups.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRetailStoreGroupList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/retail-stores/retail-store-groups/list-retail-store-groups.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
