Product Image Resource

Content


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": "https://placehold.it/300x200/F0F0F0/0287CD&text=Image%201",
"image_url_2": "https://placehold.it/300x200/F0F0F0/0287CD&text=Image%202",
"image_url_3": "https://placehold.it/300x200/F0F0F0/0287CD&text=Image%203",
"image_url_15": "https://placehold.it/300x200/F0F0F0/0287CD&text=Image%2015"
}
}' \
https://shop_subdomain.versacommerce.de/api/products/1.json
Status: 201 Created

{
  "product": {
    "image_url_1": "https://placehold.it/300x200/F0F0F0/0287CD&text=Image%201",
    "image_url_2": "https://placehold.it/300x200/F0F0F0/0287CD&text=Image%202",
    "image_url_3": "https://placehold.it/300x200/F0F0F0/0287CD&text=Image%203",
    "image_url_15": "https://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": ""
}
}' \
https://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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.