Product Catalogue
Manage product catalogue

List catalogues

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

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/list/catalogue/',
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/catalogue/",
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;
24
​
Copied!

Create Catalogue

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

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/create/catalogue/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
},
9
formData: {
10
'name ': '<catalogue_name>',
11
'parent_id': '<parent_id>'
12
}
13
};
14
request(options, function (error, response) {
15
if (error) throw new Error(error);
16
console.log(response.body);
17
});
18
​
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/catalogue/",
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 => array('name ' => '<catalogue_name>','parent_id' => '<parent_name>'),
15
CURLOPT_HTTPHEADER => array(
16
"apikey: <apikey>",
17
"Authorization: Bearer <access token>",
18
),
19
));
20
​
21
$response = curl_exec($curl);
22
​
23
curl_close($curl);
24
echo $response;
Copied!

Error Responses

Status Code
Error Type
Field
Description
400
Validation Error
name
This field is required.
This field may not be blank.
Ensure this field has no more than 200 characters.
"\"Catalogue name already selected. Please choose different name !"
400
Validation Error
parent_id
Parent id is required
This field may not be blank
Incorrect type. Expected pk value, received str.
Invalid pk \"parent_id\" - object does not exist.

Update Catalogue

post
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/update/catalogue/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/update/catalogue/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
},
9
formData: {
10
'id': '<catalogue_id>',
11
'name': '<name>',
12
'parent_id': '<parent_catalogue_id>'
13
}
14
};
15
request(options, function (error, response) {
16
if (error) throw new Error(error);
17
console.log(response.body);
18
});
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/catalogue/",
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 => array('id' => '<catalogue_id>','name' => '<name>','parent_id' => '<parent_catalogue_id>'),
15
CURLOPT_HTTPHEADER => array(
16
"apikey: <apikey>",
17
"Authorization: Bearer <access token>",
18
),
19
));
20
​
21
$response = curl_exec($curl);
22
​
23
curl_close($curl);
24
echo $response;
Copied!

Error Responses

Status Code
Error Type
Field
Description
400
Invalid Input
id
Catalogue id is required.
This field may not be blank.
Catalogue id is not valid.
Catalogue does not exist.
All other error responses of create catalogue.
​
​
​

Delete Catalogue

delete
β€Ž
https://<domain>/<api prefix>/<version>/commerce/product/delete/catalogue/?id=<id>

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'DELETE',
4
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/delete/catalogue/?id=<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/catalogue/?id=<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;
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
401
Request Failed
​
Catalogue can't delete or remove
400
Invalid Input
id
Catalogue id is not valid.
Catalogue does not exist. This field may not be blank Catalogue id is required.
​
​
Last modified 2mo ago