> 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/products/bundle-chapters.md).

# Bundle Chapters

Administrative endpoints for **bundle chapters** — the configurable selection slots of a **Bundle** product (`product_type` `2`). Each chapter groups the attribute-set-driven set of choices a customer picks from when configuring the bundle on the storefront. A chapter belongs to exactly one bundle product and can be pre-populated with a default miscellaneous product (`product_type` `4`). See the **Products** section for the shared product-type table.

### Core Capabilities

**1. Chapter Listing & Filtering**

* Retrieve a paginated list of chapters, ordered by their `order` value unless a different order is requested. `order` is a single global ordering key, not grouped by bundle product — filter by `bundle_product` to see one product's chapters in sequence.
* Filter by the parent bundle product, or by a partial, case-insensitive match on slug.

**2. Chapter Lifecycle Management**

* Create a chapter under a bundle product, together with the attribute set and initial attribute values used to render its selection form.
* Update a chapter's name, slug, position, active state, requirement flags, and default product (see the restrictions below — some fields cannot be changed after creation, and `default_product` can only be set or replaced, not cleared).
* Permanently delete a chapter. This is a **hard delete** — unlike deactivating a product, the chapter record and its miscellaneous-product associations are removed from the database rather than merely deactivated.

### Validation Rules

* `bundle_product` must reference a product whose `product_type` is **Bundle** (`2`); a reference to a product of a different type (or to a non-existent id) is rejected as an invalid identifier, the same as any other bad foreign key — a standard `400` validation error, not a business-rule error.
* `default_product`, when provided, must reference a product whose `product_type` is **Miscellaneous** (`4`), rejected the same way (`400`) if it isn't. On create, it is automatically added to the chapter's set of selectable miscellaneous products.
* The combination of `bundle_product` and `slug` must be unique — a bundle product cannot have two chapters with the same slug. Violating this is also a standard `400` validation error.
* **`bundle_product` cannot be changed after creation.** It is accepted by the update operations but has no effect — a chapter always keeps the bundle product it was created under, even if a different `bundle_product` is sent and passes validation.
* **`default_product` can only be set or replaced, never cleared.** Sending `null` has no effect if a default product is already set — there is no way to remove it through these endpoints once set.
* **The attribute set and the chapter's attribute values can only be set at creation.** `attribute_set`, `attributes`, and `attributes_kwargs` are accepted by the update operations but have no effect on the stored chapter — they cannot be changed once the chapter exists. `attributes_kwargs` has no effect at creation either; it is always derived automatically from `attributes`.
* `attributes` must be included when creating a chapter (send an empty object if there are no values to set). It is not flagged as a required field, but omitting it causes the request to fail with a server error instead of a normal validation response.

### Dynamic Settings & Environment Variables

No dynamic settings or environment variables affect these endpoints.


---

# 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/products/bundle-chapters.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.
