---
search:
  tags:
    - Products
    - POST
seo:
  description: >-
    Upload a product image (multipart field file) and set imageUrl. Replaces…
    Reference for the POST /products/{productId}/image endpoint in the scango.ch
    API.
sidebar:
  label: Upload product image
  badge: POST
title: Upload product image
type: openapi-operation
---
Upload a product image (multipart field `file`) and set `imageUrl`. Replaces any previous image. Requires a Write key. Max. 10 MiB (10,485,760 bytes). The type is taken from the part's `Content-Type` header: jpeg, png, webp or gif.

`POST /products/{productId}/image`

**Request body** (`multipart/form-data`, required)

- `file` (any, required) — Image file (jpeg, png, webp or gif), max. 10 MiB.

Request body example:

```json
{
  "file": null
}
```

**Responses**

- `200` — Uploaded
- `400` — Invalid parameters or body.
- `403` — Missing, unknown or inactive API key, or a Read key on a write operation.
- `404` — No item with this id.
- `413` — File too large

Response example, 200:

```json
{
  "data": {
    "url": "https://firebasestorage.googleapis.com/v0/b/example/o/instance%2Forg%2Fproducts%2Fprod%2Fphoto.jpg?alt=media&token=abc",
    "imageUrl": "https://firebasestorage.googleapis.com/v0/b/example/o/instance%2Forg%2Fproducts%2Fprod%2Fphoto.jpg?alt=media&token=abc"
  }
}
```

Response example, 400:

```json
{
  "statusCode": 400,
  "message": "Validation failed for Field: name, Error: Required",
  "timestamp": "2024-04-20T12:00:00.000Z",
  "path": "/api/v1/suppliers"
}
```

Response example, 403:

```json
{
  "statusCode": 403,
  "message": "Unknown Error",
  "timestamp": "2024-04-20T12:00:00.000Z",
  "path": "/api/v1/products"
}
```
