product

product.image.add

Add image to product

post/product.image.add.json

Request

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

Request body

type'small' | 'base' | 'additional' | 'thumbnail' required

Defines image's types that are specified by comma-separated list

image_namestring required

Defines image's name

product_idstring

Defines product id where the image should be added

product_variant_idstring

Defines product's variants specified by variant id

variant_idsstring

Defines product's variants ids

option_value_idsstring

Defines product's option values ids

store_idstring

Store Id

lang_idstring

Add product image on specified language id

urlstring

Defines URL of the image that has to be added

contentstring

Content(body) encoded in base64 of image file

labelstring

Defines alternative text that has to be attached to the picture

positioninteger

Defines image’s position in the list

use_latest_api_versionboolean

Use the latest platform API version

idempotency_keystring

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>

Example request

{
  "type": "base,small",
  "image_name": "bag-gray.png",
  "variant_ids": "1,2,3,4,5",
  "option_value_ids": "1,2,3,4,5",
  "store_id": "1",
  "url": "http://docs.api2cart.com/img/logo.png",
  "content": "/9j/4AAQSkZ...gD/2Q==",
  "label": "This cool image",
  "mime": "image/jpeg",
  "position": 5,
  "use_latest_api_version": true,
  "idempotency_key": "098f6bcd4621d373cade4e832627b4f6"
}

Response

successful operation

return_codeinteger
return_messagestring

Changes

No recorded changes to this operation across all 1 revision of this API.