# ProductMedia

ProductMedia

## List product media

> List media (images, videos) for a given product.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ProductMedia","description":"ProductMedia"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"ProductMediaListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProductMediaSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"]}}}}},"schemas":{"ProductMediaSchema":{"title":"ProductMediaSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/UID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"isCoverImage":{"type":"boolean"},"source":{"$ref":"#/components/schemas/ProductMediaSourceENUM"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl","position","width","height","isCoverImage","source","createdAt","createdBy","lastModifiedAt","lastModifiedBy"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ProductMediaSourceENUM":{"title":"ProductMediaSourceENUM","enum":["FLOW","URL"],"description":"","type":"string"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/media":{"get":{"summary":"List product media","operationId":"get-products-media-list","responses":{"200":{"$ref":"#/components/responses/ProductMediaListResponse"}},"description":"List media (images, videos) for a given product.","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"}],"tags":["ProductMedia"]}}}}
```

## Create new product media

> When you already have the images that you want to use, add them as the URL. Note that the URLs must be publicly accessible.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ProductMedia","description":"ProductMedia"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"ProductMediaResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaSchema"}}}}},"schemas":{"ProductMediaSchema":{"title":"ProductMediaSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/UID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"isCoverImage":{"type":"boolean"},"source":{"$ref":"#/components/schemas/ProductMediaSourceENUM"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl","position","width","height","isCoverImage","source","createdAt","createdBy","lastModifiedAt","lastModifiedBy"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ProductMediaSourceENUM":{"title":"ProductMediaSourceENUM","enum":["FLOW","URL"],"description":"","type":"string"},"ProductMediaCreateSchema":{"title":"ProductMediaCreateSchema","type":"object","properties":{"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"setAsCoverImage":{"type":"boolean"},"productMediaUid":{"$ref":"#/components/schemas/OptionalUID"}},"required":["mainUrl"]},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}},"requestBodies":{"ProductMediaCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaCreateSchema"}}}}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/media":{"post":{"summary":"Create new product media","operationId":"post-products-media","responses":{"201":{"$ref":"#/components/responses/ProductMediaResponse"}},"tags":["ProductMedia"],"description":"When you already have the images that you want to use, add them as the URL. Note that the URLs must be publicly accessible.","requestBody":{"$ref":"#/components/requestBodies/ProductMediaCreateRequest"}}}}}
```

## Get a product media record

> Retrieve the data record for the given product media.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ProductMedia","description":"ProductMedia"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"ProductMediaResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaSchema"}}}}},"schemas":{"ProductMediaSchema":{"title":"ProductMediaSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/UID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"isCoverImage":{"type":"boolean"},"source":{"$ref":"#/components/schemas/ProductMediaSourceENUM"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl","position","width","height","isCoverImage","source","createdAt","createdBy","lastModifiedAt","lastModifiedBy"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ProductMediaSourceENUM":{"title":"ProductMediaSourceENUM","enum":["FLOW","URL"],"description":"","type":"string"}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/media/{productMediaUid}":{"get":{"summary":"Get a product media record","tags":["ProductMedia"],"responses":{"200":{"$ref":"#/components/responses/ProductMediaResponse"}},"operationId":"get-products-media","description":"Retrieve the data record for the given product media."}}}}
```

## Update a product media record

> Update a product media record.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ProductMedia","description":"ProductMedia"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"ProductMediaResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaSchema"}}}}},"schemas":{"ProductMediaSchema":{"title":"ProductMediaSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/UID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"isCoverImage":{"type":"boolean"},"source":{"$ref":"#/components/schemas/ProductMediaSourceENUM"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl","position","width","height","isCoverImage","source","createdAt","createdBy","lastModifiedAt","lastModifiedBy"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ProductMediaSourceENUM":{"title":"ProductMediaSourceENUM","enum":["FLOW","URL"],"description":"","type":"string"},"ProductMediaUpdateSchema":{"title":"ProductMediaUpdateSchema","type":"object","properties":{"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"setAsCoverImage":{"type":"boolean"}}}},"requestBodies":{"ProductMediaUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaUpdateSchema"}}}}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/media/{productMediaUid}":{"put":{"summary":"Update a product media record","operationId":"put-products-media","responses":{"200":{"$ref":"#/components/responses/ProductMediaResponse"}},"description":"Update a product media record.","tags":["ProductMedia"],"requestBody":{"$ref":"#/components/requestBodies/ProductMediaUpdateRequest"}}}}}
```

## Delete a product media record.

> Delete a product media record.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ProductMedia","description":"ProductMedia"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/media/{productMediaUid}":{"delete":{"summary":"Delete a product media record.","operationId":"delete-products-media","responses":{"204":{"description":"No Content"}},"tags":["ProductMedia"],"description":"Delete a product media record."}}}}
```

## Upload product media

> Upload a new image or video. We accept two kinds of values in the file field, either  \
> \`\`base64\`\` a Base64 encoded string of the file content, or  \
> \`\`URL\`\` a URL of the file from where to download the content (make sure that the URL is accessible).\
> \
> Filename is the name with which the file will be uploaded, e.g. "new-image.jpg".

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ProductMedia","description":"ProductMedia"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"ProductMediaResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaSchema"}}}}},"schemas":{"ProductMediaSchema":{"title":"ProductMediaSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/UID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"isCoverImage":{"type":"boolean"},"source":{"$ref":"#/components/schemas/ProductMediaSourceENUM"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl","position","width","height","isCoverImage","source","createdAt","createdBy","lastModifiedAt","lastModifiedBy"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ProductMediaSourceENUM":{"title":"ProductMediaSourceENUM","enum":["FLOW","URL"],"description":"","type":"string"},"ProductMediaUploadSchema":{"title":"ProductMediaUploadSchema","type":"object","properties":{"media":{"type":"string","description":"The file content as base64 or source URL."},"filename":{"type":"string"},"position":{"type":"integer"},"productMediaUid":{"$ref":"#/components/schemas/UID"},"setAsCoverImage":{"type":"boolean"}},"required":["media","filename"]}},"requestBodies":{"ProductMediaUploadRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaUploadSchema"}}}}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/media/upload":{"post":{"summary":"Upload product media","operationId":"post-product-media-upload","responses":{"201":{"$ref":"#/components/responses/ProductMediaResponse"}},"description":"Upload a new image or video. We accept two kinds of values in the file field, either  \n``base64`` a Base64 encoded string of the file content, or  \n``URL`` a URL of the file from where to download the content (make sure that the URL is accessible).\n\nFilename is the name with which the file will be uploaded, e.g. \"new-image.jpg\".","tags":["ProductMedia"],"requestBody":{"$ref":"#/components/requestBodies/ProductMediaUploadRequest"}}}}}
```

## Set all media for a product

> Set all the media items for a product in one go. The payload is an array refelecting all the media on the given product. In addition to adding the new entries, this will also remove any exising entries that are not in the payload. So an empty array will delete all the product media on the product.\
> \
> If no media is set as cover image, the first media added will be used. Only one image can be set as the cover image.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ProductMedia","description":"ProductMedia"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"ProductMediaBatchRequest":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProductMediaCreateSchema"}}},"required":["items"]}}}}},"schemas":{"ProductMediaCreateSchema":{"title":"ProductMediaCreateSchema","type":"object","properties":{"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"setAsCoverImage":{"type":"boolean"},"productMediaUid":{"$ref":"#/components/schemas/OptionalUID"}},"required":["mainUrl"]},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/media/batch":{"post":{"summary":"Set all media for a product","operationId":"post-product-media-batch","responses":{"204":{"description":"No Content"}},"description":"Set all the media items for a product in one go. The payload is an array refelecting all the media on the given product. In addition to adding the new entries, this will also remove any exising entries that are not in the payload. So an empty array will delete all the product media on the product.\n\nIf no media is set as cover image, the first media added will be used. Only one image can be set as the cover image.","requestBody":{"$ref":"#/components/requestBodies/ProductMediaBatchRequest"},"tags":["ProductMedia"]}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/productmedia.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
