Upload product images

If you use the Product Library API to manage products, you can use the Zettle Image service to manage product images. All images have to be uploaded or imported into Zettle first through the Image API. Images can either be imported from existing URLs, or uploaded as image files.
After uploading, the Image API returns a URL and a lookup key. These are used to fetch the image and add it to a product through the Product Library API.

Prerequisites

  • Authorisation setup with a valid authorisation token and the access scope READ:PRODUCT.

Upload a single image as a file

The following request uploads an image file to the Zettle image service. Since the request sends a file, the content-type is multipart/form-data, instead of the usual application/json.
The response returns the URL and the imageLookupKey for the uploaded image.
1
POST /v2/images/organizations/self/products/upload
1
Content-Type: multipart/form-data; boundary=boundary_id
2
----boundary_id
3
Content-Disposition: form-data; name="file"; filename="<local_file_source_path>"
4
Content-Type: <Content-Type header here, depends on the type of image>
5
(data - actual file data)
6
----boundary_id
Example response:
1
{
2
"imageLookupKey": "SOuNiq6PSUCD6UhdgPIaoA-LBSCiJlfEeySah17rP0KvA",
3
"imageUrls": [
4
"https://image.izettle.com/product/SOuNiq6PSUCD6UhdgPIaoA-LBSCiJlfEeySah17rP0KvA.png"
5
]
6
}

Upload a single image from a URL

This request uploads an image using a URL. The response returns the Zettle imageUrl and imageLookupKey for the uploaded image.
1
POST /v2/images/organizations/self/products
2
{
3
"imageFormat": "{JPEG,PNG,GIF}",
4
"imageUrl": "https://example.com/image.png"
5
}
Example: This request uploads an image in PNG format with the URL https://some-image-source.com/id/300/320/240.png .
1
POST /v2/images/organizations/self/products
2
{
3
"imageFormat": "PNG",
4
"imageUrl": "https://some-image-source.com/id/300/320/240.png"
5
}
Example response:
1
{
2
"imageLookupKey": "SOuNiq6PSUCD6UhdgPIaoA-bqHhC5lKEeykLWwgyS48qw",
3
"imageUrls": [
4
"https://image.izettle.com/product/SOuNiq6PSUCD6UhdgPIaoA-bqHhC5lKEeykLWwgyS48qw.png"
5
]
6
}

Upload multiple image from URLs

You can upload multiple images in one request. To upload, define a list of objects and specify each image with imageFormat and the imageUrl. The response returns the Zettle imageUrl and imageLookupKey for the uploaded images.
1
POST /v2/images/organizations/self/products/bulk
2
{
3
"imageUploads":[
4
{
5
"imageFormat": "{JPEG,PNG,GIF}",
6
"imageUrl": "{https://exampleURL}"
7
},
8
{
9
"imageFormat": "{JPEG,PNG,GIF}",
10
"imageUrl": "{https://exampleURL}"
11
},
12
...
13
]
14
}
Example: This request uploads two images in PNG format with the URLs https://some-image-source.com/id/300/320/240.png and https://some-image-source.com/id/300/320/241.png.
1
POST /v2/images/organizations/self/products/bulk
2
{
3
"imageUploads":[
4
{
5
"imageFormat": "PNG",
6
"imageUrl": "https://some-image-source.com/id/300/320/240.png"
7
},
8
{
9
"imageFormat": "PNG",
10
"imageUrl": "https://some-image-source.com/id/300/320/241.png"
11
}
12
]
13
}
Example response: The response shows a successful upload with the generated lookup key and URLs for each image.
1
{
2
"uploaded": [
3
{
4
"imageLookupKey": "0SFJEEwSEeWvrfbcGP6Tdg--WCf87TFEeyLdOHux2SZ0A",
5
"imageUrls": [
6
"https://image.izettle.com/product/0SFJEEwSEeWvrfbcGP6Tdg--WCf87TFEeyLdOHux2SZ0A.png"
7
],
8
"source": "https://some-image-source.com/id/300/320/240.png"
9
},
10
{
11
"imageLookupKey": "0SFJEEwSEeWvrfbcGP6Tdg--WDRLrTFEey7Mv2FGpHyrg",
12
"imageUrls": [
13
"https://image.izettle.com/product/0SFJEEwSEeWvrfbcGP6Tdg--WDRLrTFEey7Mv2FGpHyrg.png"
14
],
15
"source": "https://some-image-source.com/id/300/320/241.png"
16
}
17
],
18
"invalid": []
19
}