---
title: "product.variant.image.add"
method: POST
path: "/product.variant.image.add.json"
tags: ["product"]
---

# product.variant.image.add

`POST /product.variant.image.add.json`

## Request

- Base URL: `https://api.api2cart.com/v1.1`
- URL: `https://api.api2cart.com/v1.1/product.variant.image.add.json`
- Auth: API key in header `x-api-key` and API key in header `x-store-key`

Add image to product

## Request body

- ProductVariantImageAdd
  - `product_id` string: Defines product id where the variant image has to be added
  - `product_variant_id` string, required: Defines product's variants specified by variant id
  - `store_id` string: Store Id
  - `image_name` string, required: Defines image's name
  - `type` 'small' | 'base' | 'additional' | 'thumbnail', required: Defines image's types that are specified by comma-separated list
  - `url` string: Defines URL of the image that has to be added
  - `content` string: Content(body) encoded in base64 of image file
  - `label` string: Defines alternative text that has to be attached to the picture
  - `mime` string: Mime type of image http://en.wikipedia.org/wiki/Internet_media_type.
  - `position` integer: Defines image’s position in the list
  - `option_id` string: Defines option id of the product variant for which the image will be added
  - `idempotency_key` string: A unique identifier associated with a specific request. Repeated requests with the same <strong>idempotency_key</strong> return a cached response without re-executing the business logic. <strong>Please note that the cache lifetime is 15 minutes.</strong>

## Response `200`

successful operation

- object
  - `return_code` integer
  - `return_message` string
  - `result` object
    - `id` string, nullable
    - `image_path` string

---

[API](https://skmtc.dev/api2cart/apis/api2cart-openapi.md) · [All operations](https://skmtc.dev/api2cart/apis/api2cart-openapi/llms.txt) · [OpenAPI document](https://skmtc.dev/api2cart/apis/api2cart-openapi/revisions/c34440741693?raw)
