Product
Manage Product

Create Product

post
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/create/
Note:-
By using this API endpoint you can create a product under product type external-api-product.
Body Parameters are JSON.stringify, Refer below block for the body parameter structure, and also refer sample code.
1
{
2
"bundle_id":"<bundle_id>",
3
"name":"<bundle_name>",
4
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
5
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
6
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
7
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
8
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
9
}
Copied!

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/create/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
'Content-Type': 'application/json'
9
},
10
body: JSON.stringify({
11
"bundle_id":"<bundle_id>",
12
"name":"<bundle_name>",
13
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
14
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
15
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
16
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
17
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
18
})
19
​
20
};
21
request(options, function (error, response) {
22
if (error) throw new Error(error);
23
console.log(response.body);
24
});
25
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/create/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"bundle_id":"<bundle_id>",
16
"name":"<bundle_name>",
17
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
18
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
19
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
20
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
21
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
22
}',
23
CURLOPT_HTTPHEADER => array(
24
'apikey: <apikey>',
25
'Authorization: Bearer <access token>',
26
'Content-Type: application/json'
27
),
28
));
29
​
30
$response = curl_exec($curl);
31
​
32
curl_close($curl);
33
echo $response;
34
​
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
401
Request Failed
​
Required product type for creating product using api is not created.
400
Validation Error
bundle_id
Bundle id is required.
This field may not be blank.
Produt with same bundle id is already exist.
400
Validation Error
name
This field is required.
This field may not be blank.
Ensure this field has no more than 200 characters.
400
Validation Error
bundle_name_translations
This field is required.
Bundle Name for en language is required.
400
Validation Error
description_translations
This field is required.
Description of en language is required.
400
Validation Error
short_description_translations
This field is required.
A short description of en language is required.
400
Validation Error
varients
This field is required.
You can't possible add a product under the requested product type. Select a product type have only Price, Whole sale price and Product name as varients.
One of the varient object is not valid, check each varient objects contains price,product-name,whole-sale-price and product-sku.
At least one varient is required.
Product id should be a unique value.
Product id may not be a null value. Same product id's recieved.
400
Validation Error
attributes
This field is required.
You cant possible to add product under the requested product type. Select a product type have only Business-volume, Pointes and Cumulative-volume as attributes.
Attribute should contains Business-volume, Points and Cumulative-volume, not include another attributes.
Business-volume is required.
Points is required.
Cumulative-volume is required.
Attribute must contains Business-volume, Points and Cumulative-volume.

Update Product

post
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/update/
Note:-
By using this API endpoint you can update a product that is under external-api-product.
Additionally, add a key product-sku with a existing id as a value if you want to update the existing varient. Give new id as a value of product-sku for adding a new product varient.
Body Parameters are JSON.stringify, Refer below block for the body parameter structure, and also refer sample code.
1
{
2
"bundle_id":"<bundle_id>",
3
"name":"<bundle_name>",
4
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
5
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
6
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
7
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>}],
8
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
9
}
Copied!

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/update/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
'Content-Type': 'application/json'
9
},
10
body: JSON.stringify({
11
"bundle_id":"<bundle_id>",
12
"name":"<bundle_name>",
13
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
14
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
15
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
16
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>}],
17
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
18
})
19
​
20
};
21
request(options, function (error, response) {
22
if (error) throw new Error(error);
23
console.log(response.body);
24
});
25
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/update/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"bundle_id":"<bundle_id>",
16
"name":"<bundle_name>",
17
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
18
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
19
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
20
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>}],
21
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
22
}',
23
CURLOPT_HTTPHEADER => array(
24
'apikey: <apikey>',
25
'Authorization: Bearer <access token>',
26
'Content-Type: application/json',
27
),
28
));
29
​
30
$response = curl_exec($curl);
31
​
32
curl_close($curl);
33
echo $response;
34
​
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
400
Invalid Input
bundle_id
Bundle id is required.
This field may not be blank.
Bundle does not exist.
Requested bundle is not under the external api product category.
400
Validation Error
name
This field is required.
This field may not be blank.
Ensure this field has no more than 200 characters.
400
Validation Error
description_translations
This field is required.
Description of en language is required.
400
Validation Error
short_description_translations
This field is required.
A short description of en language is required.
400
Validation Error
varients
You can't possible add a product under the requested product type. Select a product type have only Price, Whole sale price and Product name as varients.
One of the varient object is not valid, check each varient objects contains price,product-name,whole-sale-price and product-sku.
At least one varient is required.
Product sku should be a unique value. Product sku may not be a null value. Same product sku's recieved.
400
Validation Error
attributes
You cant possible to add product under the requested product type. Select a product type have only Business-volume, Pointes and Cumulative-volume as attributes.
Attribute should contains Business-volume, Points and Cumulative-volume, not include another attributes.
Business-volume is required.
Points is required.
Cumulative-volume is required.
Attribute must contains Business-volume, Points and Cumulative-volume.

Delete Product Bundle

delete
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/delete/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'DELETE',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/delete/?bundle_id=<bundle_id>',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>'
8
}
9
};
10
request(options, function (error, response) {
11
if (error) throw new Error(error);
12
console.log(response.body);
13
});
14
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/delete/?bundle_id=<bundle_id>',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'DELETE',
14
CURLOPT_HTTPHEADER => array(
15
'apikey: <apikey>',
16
'Authorization: Bearer <access token>'
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
24
​
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
400
Invalid Input
bundle_id
Bundle id is required.
This field may not be blank.
Product Bundle does not exist.
Product Bundle is not a external-api-product type.
401
Request Failed
​
The product contains in a order that is not completed yet.
The package purchased by some users.

Delete Product Varient

delete
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/delete/product-varient/

Sample Code

Node

1
var request = require('request');
2
var options = {
3
'method': 'DELETE',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/delete/product-varient/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>'
8
}
9
};
10
request(options, function (error, response) {
11
if (error) throw new Error(error);
12
console.log(response.body);
13
});
14
​
Copied!

PHP

1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/delete/product-varient/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'DELETE',
14
CURLOPT_HTTPHEADER => array(
15
'apikey: <apikey>',
16
'Authorization: Bearer <access token>',
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
24
​
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
400
Validation Error
product_sku
This field is required.
This field may not be blank.
Product sku is not valid.
Product does not exist.
400
Validation Error
bundle_id
This field is required.
This field may not be blank.
401
Request Failed
​
Only one varient left under the product bundle, can't delete it.
You can delete a product under the external-api-product not athor category product.
Only one varient left under the prouct bundle, can't delete it.
​

List Products

get
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/list/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/list/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>'
8
}
9
};
10
request(options, function (error, response) {
11
if (error) throw new Error(error);
12
console.log(response.body);
13
});
14
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/list/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'apikey: <apikey>',
16
'Authorization: Bearer <access token>'
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
Copied!

Create Bulk Products

post
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/bulk/create/

Body params :- JSON.stringify

1
[
2
{
3
"bundle_id":"<bundle_id>",
4
"name":"<bundle_name>",
5
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
6
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
7
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
8
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sk>"}],
9
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
10
},
11
{
12
"bundle_id":"<bundle_id>",
13
"name":"<bundle_name>",
14
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
15
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
16
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
17
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sju>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
18
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
19
},
20
...
21
]
Copied!

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/bulk/create/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
'Content-Type': 'application/json',
9
},
10
body: JSON.stringify([{
11
"bundle_id":"<bundle_id>",
12
"name":"<bundle_name>",
13
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
14
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
15
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
16
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
17
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
18
},
19
{
20
"bundle_id":"<bundle_id>",
21
"name":"<bundle_name>",
22
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
23
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
24
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
25
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
26
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
27
},
28
...
29
])
30
​
31
};
32
request(options, function (error, response) {
33
if (error) throw new Error(error);
34
console.log(response.body);
35
});
36
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/bulk/create/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'[
15
{
16
"bundle_id":"<bundle_id>",
17
"name":"<bundle_name>",
18
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
19
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
20
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
21
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
22
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
23
},
24
{
25
"bundle_id":"<bundle_id>",
26
"name":"<bundle_name>",
27
"bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
28
"description_translations":{"en": "<description_en>","de": "<description_dn>"},
29
"short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
30
"varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
31
"attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
32
},
33
...
34
]',
35
CURLOPT_HTTPHEADER => array(
36
'apikey: <apikey>',
37
'Authorization: Bearer <access token>',
38
'Content-Type: application/json'
39
),
40
));
41
​
42
$response = curl_exec($curl);
43
​
44
curl_close($curl);
45
echo $response;
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
400
Request Failed
​
Required product type for creating product using api is not created.
Maximum bulk create product count is 50.
Check error responses of the create product endpoint.

List API Product

get
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/list/api-products/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/list/api-products/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
}
9
};
10
request(options, function (error, response) {
11
if (error) throw new Error(error);
12
console.log(response.body);
13
});
14
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/list/api-products/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'apikey: <apikey>',
16
'Authorization: Bearer <access token>',
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
Copied!
​
​
Last modified 2mo ago