Group Attributes

Manage Group Attributes Filter

List attributes group

get
‎ https://<domain>/<api prefix>/<version>/commerce/product/list/attribute-groups/

Sample Code

Node
var request = require('request');
var options = {
'method': 'GET',
'url': '‎https://<domain>/<api prefix>/<version>/commerce/product/list/attribute-groups/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "‎https://<domain>/<api prefix>/<version>/commerce/product/list/attribute-groups/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>",
"Authorization: Bearer <access token>",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Create attributes group

post
‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎https://<domain>/<api prefix>/<version>/commerce/product/create/attribute-groups/

Sample Code

Node
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/commerce/product/create/attribute-groups/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>',
},
body: JSON.stringify({"name":"<name>","attribute_id":["<attribute_id>","<attribute_id>",...]})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/create/attribute-groups/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name":"<name>",
"attribute_id": ["<attribute_id>","<attribute_id>"]
}',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

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 20 characters.
400
Validation Error
attribute_id
Attribute id is required.
attribute_id is not valid or This field may not be blank.
attribute_id is not exist.

Update attributes group

post
‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎https://<domain>/<api prefix>/<version>/commerce/product/update/attribute-groups/

Sample Code

Node
var request = require('request');
var options = {
'method': 'POST',
'url': '‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎https://<domain>/<api prefix>/<version>/commerce/product/update/attribute-groups/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>',
},
body: JSON.stringify({"attrgroup_id":"<attrgroup_id>","name":"<name>","add_attr":["<attr_id>","<attr_id>",...],"remove_attr":["<attr_id>","<attr_id>",...]})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎https://<domain>/<api prefix>/<version>/commerce/product/update/attribute-groups/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"attrgroup_id":"<attrgroup_id>",
"name":"<name>",
"add_attr": ["<attr_id>","<attr_id>",...],
"remove_attr": ["<attr_id>","<attr_id>",...]
}',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Error Responses

Status Code
Error Type
Field
Description
400
Invalid Input
attrgroup_id
This field is required.
attrgroup_id is not valid or This field may not be blank
400
Validation Error
name
This field is required.
This field may not be blank.
Ensure this field has no more than 20 characters.
400
Validation Error
attribute_id
<attribute_id> is not valid or This field may not be blank.
<attribute_id> is not exist.
<attribute_id> is already exist in group.