Create attribute
Create a new product attribute
POST
/
admin
/
api
/
v1
/
products
/
attributes
Create attribute
curl --request POST \
--url https://erp.arukz.com/admin/api/v1/products/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Size",
"type": "select"
}
'import requests
url = "https://erp.arukz.com/admin/api/v1/products/attributes"
payload = {
"name": "Size",
"type": "select"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Size', type: 'select'})
};
fetch('https://erp.arukz.com/admin/api/v1/products/attributes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://erp.arukz.com/admin/api/v1/products/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Size',
'type' => 'select'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": 1,
"name": "Size",
"type": "select",
"sort": null,
"creator_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z",
"deleted_at": null,
"options": [
{
"id": 1,
"name": "Small",
"color": null,
"extra_price": "10.0000",
"sort": null,
"attribute_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z"
},
{
"id": 2,
"name": "Medium",
"color": null,
"extra_price": "20.0000",
"sort": null,
"attribute_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z"
},
{
"id": 3,
"name": "Large",
"color": null,
"extra_price": "30.0000",
"sort": null,
"attribute_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z"
},
{
"id": 4,
"name": "Extra Large",
"color": null,
"extra_price": "40.0000",
"sort": null,
"attribute_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z"
}
]
},
"message": "Attribute created successfully."
}{
"message": "Unauthenticated."
}{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"type": [
"The type field is required."
]
}
}Authorizations
An API token from Sign in, sent as Authorization: Bearer <token>. Tokens last 30 days.
Body
application/json
Response
Created
⌘I
Create attribute
curl --request POST \
--url https://erp.arukz.com/admin/api/v1/products/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Size",
"type": "select"
}
'import requests
url = "https://erp.arukz.com/admin/api/v1/products/attributes"
payload = {
"name": "Size",
"type": "select"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Size', type: 'select'})
};
fetch('https://erp.arukz.com/admin/api/v1/products/attributes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://erp.arukz.com/admin/api/v1/products/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Size',
'type' => 'select'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": 1,
"name": "Size",
"type": "select",
"sort": null,
"creator_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z",
"deleted_at": null,
"options": [
{
"id": 1,
"name": "Small",
"color": null,
"extra_price": "10.0000",
"sort": null,
"attribute_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z"
},
{
"id": 2,
"name": "Medium",
"color": null,
"extra_price": "20.0000",
"sort": null,
"attribute_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z"
},
{
"id": 3,
"name": "Large",
"color": null,
"extra_price": "30.0000",
"sort": null,
"attribute_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z"
},
{
"id": 4,
"name": "Extra Large",
"color": null,
"extra_price": "40.0000",
"sort": null,
"attribute_id": 1,
"created_at": "2025-04-08T03:29:17.000000Z",
"updated_at": "2025-04-08T03:29:17.000000Z"
}
]
},
"message": "Attribute created successfully."
}{
"message": "Unauthenticated."
}{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"type": [
"The type field is required."
]
}
}