Product Image Resource

Product Image Resource

Product Image Resource

  1. Bulk Create Or Update
  2. Delete Product Images



Bulk Create or Update

PUT /api/products/1/.json
  • PUT /api/products/1.json will create or update the product images from the parameters passed.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X PUT \
-d \
'{
"product": {
"image_url_1": "http://placehold.it/300x200/F0F0F0/0287CD&text=Image%201",
"image_url_2": "http://placehold.it/300x200/F0F0F0/0287CD&text=Image%202",
"image_url_3": "http://placehold.it/300x200/F0F0F0/0287CD&text=Image%203",
"image_url_15": "http://placehold.it/300x200/F0F0F0/0287CD&text=Image%2015"
}
}' \
http://shop_subdomain.versacommerce.de/api/products/1.json

Status: 201 Created

{
  "product": {
    "image_url_1": "http://placehold.it/300x200/F0F0F0/0287CD&text=Image%201",
    "image_url_2": "http://placehold.it/300x200/F0F0F0/0287CD&text=Image%202",
    "image_url_3": "http://placehold.it/300x200/F0F0F0/0287CD&text=Image%203",
    "image_url_15": "http://placehold.it/300x200/F0F0F0/0287CD&text=Image%2015"
  }
}

See the Get Product endpoint for more info about the output.



Delete Product Images

DELETE /api/products/1/product_images/100.json

  • DELETE /api/products/1/product_images/100.json will delete the product image specified and return 200 OK if that was successful.

An alternative via PUT:

  • PUT /api/products/1.json will delete the product images from the parameters passed.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X PUT \
-d \
'{
"product": {
"image_url_1": "",
"image_url_2": "",
"image_url_3": "",
"image_url_15": ""
}
}' \
http://shop_subdomain.versacommerce.de/api/products/1.json

Status: 200 OK

{
  "product": {
    "image_url_1": null,
    "image_url_2": null,
    "image_url_3": null,
    "image_url_15": null
  }
}

See the Get Product endpoint for more info about the output.


    • Related Articles

    • Image

      canvas Der Filter canvas erweitert eine Bild-URL um einen Skalierungsparameter, der den VersaCommerce-Assetserver veranlasst, die Bildfläche des in der URL angegebenen Bildes auf das in size angegebene Maß zu erweitern bzw. zu reduzieren. Dabei wird ...
    • Product Resource

      Product Associations Product Properties Product Recommendations Create Product POST /api/products.json POST /api/products.json will create a new product from the parameters passed. Example: $ curl -s \ -H 'Accept: application/json' \ -H ...
    • Product

      product.asin_code {{ product.asin_code }} product.availableGibt true zurück, wenn ein Produkt zum Ankauf angeboten wird. Gibt false zurück, wenn alle inventar_quantity-Werte der Produktvarianten Null oder weniger sind und die inventar_policy nicht ...
    • Image-Objects

      Image-Objects {% for image in product.images %} {{ image.url | refit: '200x300' | img_tag }} {% endfor %} image.content_type Gibt den Typ des Bildes zurück. Für ein jpg ist es zum Beispiel image/jpeg. image.description Gibt die Bildbeschreibung ...
    • Metafield Resource

      Metafield Resource Get Metafields Get Metafield Create Metafield Update Metafield Delete Metafield Get Metafield Count Filter Metafields Get Metfields GET /api/metafields.json GET /api/metafields.json will return all Metafields. See the Filter ...