> 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-chapter-products/update-a-bundle-chapter-product.md).

# Update a bundle chapter product

Repoints an existing association at a different chapter, a different product, or both. Send both fields as identifiers.

The same rules as on create apply: `product` must be a Miscellaneous (`4`) product, and the resulting `bundle_chapter` / `product` pair must not duplicate another association.

This is the only supported way to change an association — `PATCH` cannot be used for it. The response uses the **flat** representation.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Bundle Chapter Products","description":"Administrative endpoints for **bundle chapter products** — the association records that define which miscellaneous products (`product_type` `4`) a customer can choose from inside a single chapter of a **Bundle** product. Each record links exactly one **bundle chapter** to exactly one **product**; together, the records of a chapter form its set of selectable options. See the **Bundle Chapters** section for the chapters themselves and the **Products** section for the shared product-type table.\n\n## Core Capabilities\n\n**1. Association Listing & Filtering**\n* Retrieve a paginated list of chapter–product associations, each expanded with the full bundle chapter and the full product record.\n* Filter by chapter or by product, negate either filter, and order the results with `sort`.\n* The same data is also reachable under the `/detailed/` aliases (`/bundle_chapter_products/detailed/` and `/bundle_chapter_products/{id}/detailed/`), which return exactly the same payloads as the plain list and retrieve operations.\n\n**2. Association Lifecycle Management**\n* Add a miscellaneous product to a chapter's selectable options.\n* Repoint an existing association at a different chapter or product.\n* Remove an association, taking the product out of the chapter's options.\n\n## Payload Shapes\n\nThis resource returns two different representations, selected by the operation. Plan client code accordingly — the object returned by **create** is not shaped like the object returned by **retrieve**.\n\n| Operation | Representation |\n|-----------|----------------|\n| list, retrieve, `/detailed/` aliases, partial update (`PATCH`) | **Expanded** — `bundle_chapter` and `product` are full nested objects. |\n| create (`POST`), update (`PUT`) | **Flat** — `bundle_chapter` and `product` are identifiers, in both the request and the response. |\n\nBecause every row of the expanded representation carries a complete product and a complete chapter (including their attribute data and images), listing is comparatively expensive. Filter by `bundle_chapter` and keep `limit` modest rather than paging through the unfiltered list.\n\n## Filtering & Ordering\n\n| Query parameter | Effect |\n|-----------------|--------|\n| `bundle_chapter` | Keeps only the associations of the given chapter. |\n| `product` | Keeps only the associations of the given product. |\n| `bundle_chapter!` | Negated form — excludes the associations of the given chapter. |\n| `product!` | Negated form — excludes the associations of the given product. |\n\nAny other query parameter is ignored; related lookups such as `product__sku` are not supported. A non-numeric value for any of the four is rejected with a `400` validation error.\n\nThe stored records carry no ordering of their own, so results are returned **ordered by `id` ascending** by default. `sort` accepts only `pk`, `bundle_chapter`, and `product`, each optionally prefixed with `-` for descending order; ordering by `bundle_chapter` or `product` sorts by the related record's identifier. **Any other value — including `id`, `created_date`, and `modified_date` — is silently ignored** and the default ordering applies, so a client cannot tell an unsupported sort key from a supported one by the response alone.\n\n## Validation Rules\n\n* `product` must reference a product whose `product_type` is **Miscellaneous** (`4`). Any other product type (or a non-existent id) is rejected as an invalid identifier — a standard `400` validation error, not a business-rule error.\n* `bundle_chapter` must reference an existing chapter; a bad id is likewise a `400` validation error.\n* The combination of `bundle_chapter` and `product` must be **unique**. Adding a product that is already among the chapter's options fails with a `400` validation error rather than silently returning the existing association, so create is not idempotent.\n* **`PATCH` cannot change an association — use `PUT`.** Partial update is served by the expanded representation, in which `bundle_chapter` and `product` are nested objects rather than identifiers. Sending either as an id fails validation with `400`; sending either as an object passes validation but is not supported by the endpoint and fails as a server error. Only an empty body (`{}`) succeeds, and it leaves the record unchanged.\n* **Deleting an association is not blocked when the product is the chapter's `default_product`.** The record is removed and the chapter keeps pointing at a default product that is no longer among its selectable options. Verify the chapter's `default_product` before deleting, and update the chapter first if needed.\n* Deletion is a **hard delete** — the association row is removed from the database. The product and the chapter themselves are untouched.\n\n## Dynamic Settings & Environment Variables\n\nNo dynamic setting changes the request or response schema of these endpoints, but the two below affect their behavior. Each is referenced again in the description of the operations it affects.\n\n| Key | Type | Default | Effect |\n|-----|------|---------|--------|\n| `IGNORE_ACCEPT_LANGUAGE_HEADER` | boolean | `true` | Whether the `Accept-Language` header is discarded before the request is processed. Affects every operation that returns the **expanded** representation (**list**, **retrieve**, the `/detailed/` aliases, **partial update**): the nested chapter and product are translated records, so this setting decides whether their translated fields follow `Accept-Language` or the server's default language. While it is `true` (the default), the header is honored only when the request also carries an `X-Omnitron-Session` header. |\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 `products.BundleChapterProduct` is added to this list, removing an association also records a tombstone entry that the data-warehouse export consumes. The API response is identical either way; only the downstream export is affected. |\n\n**Environment variables and server settings**\n\n| Setting | Default | Effect |\n|---------|---------|--------|\n| `LANGUAGE_CODE` | `tr-tr` | The server's default language. Applied to the translated fields of the nested chapter and product (names, attribute labels) and to the nested product's `absolute_url` whenever the request language is not resolved to something else — see `IGNORE_ACCEPT_LANGUAGE_HEADER` above. |\n| `CDN_DOMAIN` | — | Set only where object storage is configured. It determines the form of the image URLs inside the nested product (`productimage_set`, image-valued attributes): absolute URLs on this domain when object storage is in use, relative `/media/...` paths otherwise. |"}],"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."}},"schemas":{"BundleChapterProductWriteRequest":{"type":"object","description":"The payload for creating an association or repointing an existing one. Both sides are sent as identifiers.","required":["bundle_chapter","product"],"properties":{"bundle_chapter":{"type":"integer","description":"The identifier of the bundle chapter the product is offered in."},"product":{"type":"integer","description":"The identifier of the product to offer. Must reference a product whose `product_type` is Miscellaneous (`4`); any other product type is rejected as an invalid identifier. The `bundle_chapter` / `product` pair must be unique."}}},"BundleChapterProductReference":{"type":"object","description":"The flat representation of a chapter–product association, with both sides given as identifiers. Returned by **create** and **update**.","properties":{"pk":{"type":"integer","description":"The unique identifier of the association.","readOnly":true},"bundle_chapter":{"type":"integer","description":"The identifier of the bundle chapter."},"product":{"type":"integer","description":"The identifier of the associated miscellaneous product."}}},"ValidationError":{"type":"object","description":"Returned when the request contains invalid or missing data. Errors are grouped by the field they apply to: each key is the name of a field from the request and its value is a list of one or more messages describing what is wrong with that field. Messages that do not belong to any single field are grouped under `non_field_errors`.","properties":{"non_field_errors":{"type":"array","description":"Error messages that apply to the request as a whole rather than to a specific field.","items":{"type":"string"}}},"additionalProperties":{"type":"array","description":"The list of error messages for the field named by the key.","items":{"type":"string"}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"ValidationError":{"description":"The request contains invalid or missing data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"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"}}}},"BundleChapterProductNotFound":{"description":"The requested bundle chapter product association does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/bundle_chapter_products/{id}/":{"put":{"tags":["Bundle Chapter Products"],"operationId":"updateBundleChapterProduct","summary":"Update a bundle chapter product","description":"Repoints an existing association at a different chapter, a different product, or both. Send both fields as identifiers.\n\nThe same rules as on create apply: `product` must be a Miscellaneous (`4`) product, and the resulting `bundle_chapter` / `product` pair must not duplicate another association.\n\nThis is the only supported way to change an association — `PATCH` cannot be used for it. The response uses the **flat** representation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleChapterProductWriteRequest"}}}},"responses":{"200":{"description":"The updated bundle chapter product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleChapterProductReference"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/BundleChapterProductNotFound"}}}}}}
```


---

# 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-chapter-products/update-a-bundle-chapter-product.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.
