product

product.variant.image.add

Add image to product

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

Request body

product_idstring

Defines product id where the variant image has to be added

product_variant_idstring required

Defines product's variants specified by variant id

store_idstring

Store Id

image_namestring required

Defines image's name

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

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

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

option_idstring

Defines option id of the product variant for which the image will be added

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

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

Response

successful operation

return_codeinteger
return_messagestring

Changes

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