> 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/product-images/partially-update-a-product-image.md).

# Partially update a product image

Updates one or more fields of an existing product image. Only the fields you send are changed, and sending no changeable field leaves the record untouched.

The same restrictions as the full update apply: `product` and `image` are ignored if sent, and only the display order, the stored dimensions and the file referenced through `image_path` can be changed. Offer propagation behaves as described under **Marketplace Offer Propagation**, and no listability recalculation is triggered.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Product Images","description":"Administrative endpoints for **product images** — the image records attached to a catalog product, the order in which they are shown, and their promotion to a special role such as the product's main image.\n\n## Core Capabilities\n\n**1. Image Listing & Filtering**\n* Retrieve a paginated list of product images.\n* Filter by the product an image belongs to, or by the exact stored path of an image.\n* Results are ordered by display order ascending by default; use the `sort` query parameter to order by another of the returned fields.\n\n**2. Image Creation**\n* Add an image to a product either by sending the file content itself, or by referencing a file that is already present in the platform's media storage.\n* Place the image within the product's gallery through its display order, which is required on create.\n\n**3. Image Maintenance**\n* Retrieve a single image, change its display order or the stored file it points to, or delete it.\n\n**4. Special Image Assignment**\n* Promote an existing image to one of the roles listed under **Special Image Types**. A product holds at most one image per role, so assigning a role replaces the image that previously held it for that product.\n\n## Supplying the Image\n\nA create request supplies the image in one of two ways.\n\n| Field | When to use it | Additional requirements |\n|-------|----------------|-------------------------|\n| `image` | You are sending the file content itself, as text, in the request. | None, but the stored record will carry no dimensions. The file name and storage location are generated by the platform, and `height` and `width` are always taken from the stored file rather than from the request — see the caveat below. |\n| `image_path` | The file is already present in the platform's media storage and you only want to reference it. | `height` and `width` must both be sent in the same request, because they cannot be derived from a file that is only referenced. |\n\nIf neither field is supplied, or `image_path` is supplied without both `height` and `width`, the request is rejected with the business error `product_image_500_1`.\n\nSending both fields is not an error, but it is not useful either: `image` takes precedence and `image_path` is ignored. The `height` and `width` requirement still applies in that case, because `image_path` is present — so a request carrying both fields without dimensions is rejected even though the path would have been ignored. Send only the field you mean to use.\n\n> **Caveat on `image`.** This field is a **text** field, not a binary file upload: its value is written to storage verbatim as the file's content. Because such content is not a decodable image, the platform cannot measure it, and the created record is stored with `height` and `width` set to `null` — any dimensions you send alongside `image` are discarded. To register an image whose dimensions are recorded, upload the file to the media storage by other means and reference it with `image_path`, supplying `height` and `width` yourself.\n\nStored files are placed under a dated, per-product location in the configured media storage. The stored file name is generated by the platform and is never taken from the request.\n\n`image_path` is accepted in requests only. It is never returned in a response — responses report the resulting stored path in `image`.\n\n## Display Order\n\n`order` positions the image within the product's gallery; lower values are shown first. It is **required on create** — there is no default to fall back on, so send it with every create request. On update it is optional: an omitted field is left unchanged.\n\n## Special Image Types\n\n| Value | Description |\n|-------|-------------|\n| `base` | The product's main image. |\n| `swatch` | The color or pattern swatch shown in variant selection. |\n| `listing` | The image used on listing and category pages. |\n| `picto` | A pictogram or badge shown alongside the product. |\n\n## Marketplace Offer Propagation\n\nWhen an image belongs to a **seller product**, changes are mirrored onto that product's offers automatically:\n\n* **Creating** an image copies it to every offer of the product.\n* **Updating** an image applies the same changes to the matching offer image, and creates a copy for any offer that does not have one yet.\n* **Deleting** an image removes the matching image from every offer of the product.\n\nNo propagation takes place for products that are not seller products.\n\n## Listability Side Effects\n\nWhether a product has an **active** image is one of the inputs to its listability. Two operations therefore trigger a listability recalculation across the product's variant group:\n\n* **Creating** an image for a product that had no active image before.\n* **Deleting** an image when the product is left with no active image.\n\nAdding or removing an image while the product still has other active images does not trigger a recalculation. When a recalculation runs, the product's last-modified timestamp is also refreshed unless it was already updated within the last minute.\n\nWhen `omnishop.products.listable_rules.all_variants_have_image_rule` is the **first** entry of `LISTABLE_PRODUCT_RULES`, the recalculation is evaluated for the variant group as a whole: deleting the last active image of one variant leaves the **entire** group without a listable product, and creating that missing image again makes the group listable. Under the default rules a single variant with an image is enough to keep the group listable.\n\nEvery image created through these endpoints is active — the status of an image is not part of this API and cannot be set or changed here. A product may still carry images that were disabled elsewhere in the platform; those do not count towards the checks above.\n\n## Dynamic Settings & Environment Variables\n\nThe behavior of these endpoints is influenced by the following dynamic settings, configured in the management panel. Each is referenced again in the description of the operations it affects.\n\n| Key | Type | Default | Effect |\n|-----|------|---------|--------|\n| `LISTABLE_PRODUCT_RULES` | array of strings | `[\"omnishop.products.listable_rules.image_rule\", \"omnishop.products.listable_rules.is_listable_rule\"]` | The ordered list of rules that decide which variant becomes the listable product within a group. Affects the listability recalculation triggered by **create** (`POST /product_image/`) and **delete** (`DELETE /product_image/{id}/`) described under **Listability Side Effects**. Each entry must be one of the exact values listed below, and the list cannot be empty. |\n| `LIST_SIMPLE_INSTEAD_OF_META` | boolean | `false` | When enabled, an individual simple variant is exposed as the listable product for its group instead of the parent product meta. Affects the same listability recalculation triggered by **create** and **delete**. When unset, its value falls back to the corresponding server configuration value, and to `false` if that is also unset. |\n\nThese are the only values `LISTABLE_PRODUCT_RULES` accepts. Each must be given in full, exactly as written; abbreviated names such as `image_rule` are rejected.\n\n| Value | Chooses the variant that |\n|-------|--------------------------|\n| `omnishop.products.listable_rules.image_rule` | has an image |\n| `omnishop.products.listable_rules.is_listable_rule` | is already listable |\n| `omnishop.products.listable_rules.stock_rule` | has stock, in its own or an additional stock list |\n| `omnishop.products.listable_rules.all_stock_rule` | has stock in every stock list |\n| `omnishop.products.listable_rules.all_variants_have_image_rule` | belongs to a group in which **every** active variant has an image; if a single one has none, no variant of the group is chosen. Place it as the first entry of the list for it to take effect |\n| `omnishop.products.listable_rules.max_price_rule` | has the highest price |\n| `omnishop.products.listable_rules.min_price_rule` | has the lowest price |\n\n**Environment variables:** No environment variables are read directly by these endpoints. The only related server configuration values are the platform's media storage configuration, which determines where uploaded image files are stored, and the fallback value of `LIST_SIMPLE_INSTEAD_OF_META` described above."}],"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":{"ProductImagePatchRequest":{"type":"object","description":"The fields to change on an existing product image. Every field is optional; only the fields you send are applied. `product` and `image` are accepted but ignored — see the operation description.","properties":{"product":{"type":"integer","description":"Accepted but ignored. An image cannot be moved to a different product."},"image":{"type":"string","description":"Accepted but ignored. The stored file content cannot be replaced; use `image_path` to reference a different stored file."},"image_path":{"type":"string","description":"Path of a file already present in the platform's media storage, to be referenced by this record instead of its current file. Accepted in requests only; never returned in a response."},"order":{"type":"integer","description":"Position of the image within the product's gallery. Lower values are shown first.","minimum":0,"maximum":32767},"height":{"type":["integer","null"],"description":"Height of the image in pixels.","minimum":0,"maximum":2147483647},"width":{"type":["integer","null"],"description":"Width of the image in pixels.","minimum":0,"maximum":2147483647}}},"ProductImageDetail":{"type":"object","description":"An image attached to a product, together with its display order and stored dimensions.","properties":{"pk":{"type":"integer","description":"Unique identifier of the product image."},"product":{"type":"integer","description":"Identifier of the product the image belongs to."},"image":{"type":"string","description":"Path of the stored image file within the platform's media storage. Generated by the platform when the file content is sent in `image`, or the value supplied in `image_path` when an already stored file is referenced."},"order":{"type":"integer","description":"Position of the image within the product's gallery. Lower values are shown first."},"height":{"type":["integer","null"],"description":"Height of the image in pixels. `null` when the record was created by sending the file content in `image`, or when no dimension was ever recorded for it."},"width":{"type":["integer","null"],"description":"Width of the image in pixels. `null` when the record was created by sending the file content in `image`, or when no dimension was ever recorded for it."}},"required":["pk","product","image","order","height","width"]},"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"}}}},"ProductImageNotFound":{"description":"The requested product image does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/product_image/{id}/":{"patch":{"tags":["Product Images"],"operationId":"partialUpdateProductImage","summary":"Partially update a product image","description":"Updates one or more fields of an existing product image. Only the fields you send are changed, and sending no changeable field leaves the record untouched.\n\nThe same restrictions as the full update apply: `product` and `image` are ignored if sent, and only the display order, the stored dimensions and the file referenced through `image_path` can be changed. Offer propagation behaves as described under **Marketplace Offer Propagation**, and no listability recalculation is triggered.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImagePatchRequest"}}}},"responses":{"200":{"description":"The updated product image.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImageDetail"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProductImageNotFound"}}}}}}
```


---

# 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/product-images/partially-update-a-product-image.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.
