Upload Product Image
curl --request POST \
--url https://omnicommerce.sg/api/v1/products/{productId}/images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://omnicommerce.sg/api/v1/products/{productId}/images', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/products/{productId}/images"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"ok": true,
"apiVersion": "developer_v1",
"operationId": "<string>",
"status": "accepted",
"warnings": [
"<string>"
],
"recommendations": [
"<string>"
],
"links": {},
"data": {
"image": {
"url": "<string>",
"position": 0
},
"images": [
{
"url": "<string>",
"position": 0
}
]
},
"jobId": "<string>",
"productId": "<string>"
}Products
Upload Product Image
Upload one image to a product’s or variant’s gallery as multipart/form-data. Requires catalog:write.
JPEG, PNG, WebP, AVIF, or HEIC up to 8 MB; WebP, AVIF, and HEIC are stored as JPEG. The image is added at position, or at the end. Publish the product to send the new gallery to marketplaces.
POST
/
api
/
v1
/
products
/
{productId}
/
images
Upload Product Image
curl --request POST \
--url https://omnicommerce.sg/api/v1/products/{productId}/images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://omnicommerce.sg/api/v1/products/{productId}/images', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/products/{productId}/images"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"ok": true,
"apiVersion": "developer_v1",
"operationId": "<string>",
"status": "accepted",
"warnings": [
"<string>"
],
"recommendations": [
"<string>"
],
"links": {},
"data": {
"image": {
"url": "<string>",
"position": 0
},
"images": [
{
"url": "<string>",
"position": 0
}
]
},
"jobId": "<string>",
"productId": "<string>"
}Authorizations
Bearer API key for server-to-server access. Session auth is also supported in first-party UI flows.
Path Parameters
Body
multipart/form-data
Response
The image was added to the gallery.
Allowed value:
"developer_v1"Available options:
accepted, completed, failed Show child attributes
Show child attributes
Show child attributes
Show child attributes