Product Image
Product images could well be the single most important design aspect of any store. Without the ability to touch, hold, smell, taste or otherwise handle the products they are interested in, potential customers have only images to interact with.
The product images have the following restrictions:
- Must weight less than 10MB
- Must be in one of the following formats: .gif, .jpg, .png, .webp
Properties
| Property | Explanation |
|---|---|
| id | The unique numeric identifier for the Product Image |
| product_id | The id of the product associated with the image |
| src | URL of the product image |
| position | Number indicating the position of the image in the product's image list. 1 is the first and the main product image |
| created_at | Date when the Product Image was created in ISO 8601 format |
| updated_at | Date when the Product Image was last updated in ISO 8601 format |
| alt | Image alt text helps search engines like Google understand when to show the image in a search result |
Endpoints
GET /products/{product_id}/images
Receive a list of all Product Images for a given product.
| Parameter | Explanation |
|---|---|
| since_id | Restrict results to after the specified ID |
| src | Show Product Images with a given URL |
| position | Show Product Images at a given position |
| page | Page to show |
| per_page | Amount of results |
| fields | Comma-separated list of fields to include in the response |
GET /products/1234/images
HTTP/1.1 200 OK
[
{
"id": 101,
"src": "http://d26lpennugtm8s.cloudfront.net/stores/001/234/products/servine-640-0.jpg",
"position": 1,
"product_id": 1234,
"created_at": "2013-01-03T09:11:51-03:00",
"updated_at": "2013-03-11T09:14:11-03:00"
},
{
"id": 112,
"src": "http://d26lpennugtm8s.cloudfront.net/stores/001/234/products/onyx-640-0.jpg",
"position": 2,
"product_id": 1234,
"created_at": "2013-01-03T09:11:51-03:00",
"updated_at": "2013-03-11T09:14:11-03:00"
},
{
"id": 123,
"src": "http://d26lpennugtm8s.cloudfront.net/stores/001/234/products/stoutland-640-0.jpg",
"position": 3,
"product_id": 1234,
"created_at": "2013-01-03T09:11:51-03:00",
"updated_at": "2013-03-11T09:14:11-03:00"
}
]
GET /product/1234/images?since_id=105
HTTP/1.1 200 OK
[
{
"id": 112,
"src": "http://d26lpennugtm8s.cloudfront.net/stores/001/234/products/onyx-640-0.jpg",
"position": 2,
"product_id": 1234,
"created_at": "2013-01-03T09:11:51-03:00",
"updated_at": "2013-03-11T09:14:11-03:00"
},
{
"id": 123,
"src": "http://d26lpennugtm8s.cloudfront.net/stores/001/234/products/stoutland-640-0.jpg",
"position": 3,
"product_id": 1234,
"created_at": "2013-01-03T09:11:51-03:00",
"updated_at": "2013-03-11T09:14:11-03:00"
}
]
GET /products/{product_id}/images/{image_id}}
Receive a single Product Image
| Parameter | Explanation |
|---|---|
| fields | Comma-separated list of fields to include in the response |
GET /products/1234/images/112
HTTP/1.1 200 OK
{
"id": 112,
"src": "http://d26lpennugtm8s.cloudfront.net/stores/001/234/products/onyx-640-0.jpg",
"position": 2,
"product_id": 1234,
"created_at": "2013-01-03T09:11:51-03:00",
"updated_at": "2013-03-11T09:14:11-03:00"
}