Product Attributes
Part of the Products API. Base URL https://your-domain.com/admin/api/v1 — replace the host with your own installation and the token placeholder with a real Bearer token (see Authentication).
List product attributes
GET/admin/api/v1/products/products/{product_id}/attributesRetrieve a paginated list of attributes for a specific product
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | integer | Yes | The product ID |
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: attribute, values, creator, values.attributeOption | attribute,values |
filter[id] | string | No | Comma-separated list of IDs to filter by | |
filter[attribute_id] | string | No | Comma-separated list of attribute IDs to filter by | |
sort | string | Yes | Sort field | sort |
page | integer | Yes | Page number | 1 |
curl -X GET "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes?include=attribute%2Cvalues&sort=sort&page=1" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes?include=attribute%2Cvalues&sort=sort&page=1", {
method: "GET",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes?include=attribute%2Cvalues&sort=sort&page=1', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes?include=attribute%2Cvalues&sort=sort&page=1"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)Example response 200
{
"data": [
{
"id": null,
"sort": 215,
"product_id": 14,
"attribute_id": 6,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
{
"id": null,
"sort": 66904,
"product_id": 15,
"attribute_id": 7,
"creator_id": 1,
"created_at": null,
"updated_at": null
}
],
"links": {
"first": "/?page=1",
"last": "/?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"page": null,
"active": false
},
{
"url": "/?page=1",
"label": "1",
"page": 1,
"active": true
},
{
"url": null,
"label": "Next »",
"page": null,
"active": false
}
],
"path": "/",
"per_page": 10,
"to": 2,
"total": 2
}
}Error response — 401
{
"message": "Unauthenticated."
}Create product attribute
POST/admin/api/v1/products/products/{product_id}/attributesCreate a new attribute for a specific product
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | integer | Yes | The product ID |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
attribute_id | integer | Yes | The ID of the attribute to link to this product. Must match an existing stored value. |
sort | integer | No | Sort order (minimum 0). Must be at least 0. |
options | integer[] | No | Must match an existing stored value. |
curl -X POST "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"attribute_id": 1,
"sort": 0,
"options": [
16
]
}'const response = await fetch("https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes", {
method: "POST",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"attribute_id": 1,
"sort": 0,
"options": [
16
]
}),
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'attribute_id' => 1,
'sort' => 0,
'options' => [
16,
],
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"attribute_id": 1,
"sort": 0,
"options": [
16,
],
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 201
{
"data": {
"id": null,
"sort": 6806,
"product_id": 16,
"attribute_id": 8,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Product attribute created successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Show product attribute
GET/admin/api/v1/products/products/{product_id}/attributes/{id}Retrieve a specific product attribute by its ID
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | integer | Yes | The product ID |
id | integer | Yes | The product attribute ID |
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: attribute, values, creator, values.attributeOption | attribute,values |
curl -X GET "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}?include=attribute%2Cvalues" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}?include=attribute%2Cvalues", {
method: "GET",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}?include=attribute%2Cvalues', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}?include=attribute%2Cvalues"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)Example response 200
{
"data": {
"id": null,
"sort": 933724,
"product_id": 17,
"attribute_id": 9,
"creator_id": 1,
"created_at": null,
"updated_at": null
}
}Error response — 401
{
"message": "Unauthenticated."
}Update product attribute
PUT/admin/api/v1/products/products/{product_id}/attributes/{id}Update an existing product attribute
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | integer | Yes | The product ID |
id | integer | Yes | The product attribute ID |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
attribute_id | integer | No | The ID of the attribute to link to this product. Must match an existing stored value. |
sort | integer | No | Sort order (minimum 0). Must be at least 0. |
options | integer[] | No | Must match an existing stored value. |
curl -X PUT "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"attribute_id": 1,
"sort": 0,
"options": [
16
]
}'const response = await fetch("https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}", {
method: "PUT",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"attribute_id": 1,
"sort": 0,
"options": [
16
]
}),
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'attribute_id' => 1,
'sort' => 0,
'options' => [
16,
],
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"attribute_id": 1,
"sort": 0,
"options": [
16,
],
}
response = requests.put(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 200
{
"data": {
"id": null,
"sort": 6806,
"product_id": 18,
"attribute_id": 10,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Product attribute updated successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Delete product attribute
DELETE/admin/api/v1/products/products/{product_id}/attributes/{id}Delete a product attribute
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | integer | Yes | The product ID |
id | integer | Yes | The product attribute ID |
curl -X DELETE "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}", {
method: "DELETE",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/products/products/{product_id}/attributes/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.delete(url, headers=headers)
data = response.json()
print(data)Example response 200
{
"message": "Product attribute deleted successfully."
}Error response — 401
{
"message": "Unauthenticated."
}