Packaging
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 packagings
GET/admin/api/v1/products/packagingsRetrieve a paginated list of packagings with filtering and sorting
🔒 Requires a valid Bearer token.
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: product, creator, company | product,creator |
filter[id] | string | No | Comma-separated list of IDs to filter by | |
filter[name] | string | No | Filter by packaging name (partial match) | |
filter[product_id] | string | No | Comma-separated list of product IDs to filter by | |
sort | string | Yes | Sort field | sort |
page | integer | Yes | Page number | 1 |
bash
curl -X GET "https://your-domain.com/admin/api/v1/products/packagings?include=product%2Ccreator&sort=sort&page=1" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"javascript
const response = await fetch("https://your-domain.com/admin/api/v1/products/packagings?include=product%2Ccreator&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
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/products/packagings?include=product%2Ccreator&sort=sort&page=1', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/products/packagings?include=product%2Ccreator&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
json
{
"data": [
{
"id": null,
"name": "Alene Lebsack",
"barcode": null,
"qty": 1,
"sort": 1,
"product_id": 19,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
{
"id": null,
"name": "Dolores Pollich",
"barcode": null,
"qty": 1,
"sort": 1,
"product_id": 20,
"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
json
{
"message": "Unauthenticated."
}Create packaging
POST/admin/api/v1/products/packagingsCreate a new product packaging
🔒 Requires a valid Bearer token.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Packaging name (max 255 characters). Must not be greater than 255 characters. |
barcode | string | No | Packaging barcode (max 255 characters). Must not be greater than 255 characters. |
qty | number | Yes | Quantity per package (minimum 0). Must be at least 0. |
sort | integer | No | Sort order. |
product_id | integer | Yes | Product ID that this packaging belongs to. Must match an existing stored value. |
company_id | integer | No | Company ID associated with this packaging. Must match an existing stored value. |
bash
curl -X POST "https://your-domain.com/admin/api/v1/products/packagings" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Box of 12",
"barcode": "5901234123457",
"qty": 12,
"sort": 1,
"product_id": 1,
"company_id": 1
}'javascript
const response = await fetch("https://your-domain.com/admin/api/v1/products/packagings", {
method: "POST",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Box of 12",
"barcode": "5901234123457",
"qty": 12,
"sort": 1,
"product_id": 1,
"company_id": 1
}),
});
const data = await response.json();
console.log(data);php
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-domain.com/admin/api/v1/products/packagings', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Box of 12',
'barcode' => '5901234123457',
'qty' => 12,
'sort' => 1,
'product_id' => 1,
'company_id' => 1,
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/products/packagings"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"name": "Box of 12",
"barcode": "5901234123457",
"qty": 12,
"sort": 1,
"product_id": 1,
"company_id": 1,
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 201
json
{
"data": {
"id": null,
"name": "Ms. Audra Crooks II",
"barcode": null,
"qty": 1,
"sort": 1,
"product_id": 21,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Packaging created successfully."
}Error response — 401
json
{
"message": "Unauthenticated."
}Show packaging
GET/admin/api/v1/products/packagings/{id}Retrieve a specific packaging by its ID
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The packaging ID |
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: product, creator, company | product,creator |
bash
curl -X GET "https://your-domain.com/admin/api/v1/products/packagings/{id}?include=product%2Ccreator" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"javascript
const response = await fetch("https://your-domain.com/admin/api/v1/products/packagings/{id}?include=product%2Ccreator", {
method: "GET",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);php
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/products/packagings/{id}?include=product%2Ccreator', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/products/packagings/{id}?include=product%2Ccreator"
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
json
{
"data": {
"id": null,
"name": "Morgan Hirthe",
"barcode": null,
"qty": 1,
"sort": 1,
"product_id": 22,
"creator_id": 1,
"created_at": null,
"updated_at": null
}
}Error response — 401
json
{
"message": "Unauthenticated."
}Update packaging
PUT/admin/api/v1/products/packagings/{id}Update an existing packaging
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The packaging ID |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Packaging name (max 255 characters). Must not be greater than 255 characters. |
barcode | string | No | Packaging barcode (max 255 characters). Must not be greater than 255 characters. |
qty | number | No | Quantity per package (minimum 0). Must be at least 0. |
sort | integer | No | Sort order. |
product_id | integer | No | Product ID that this packaging belongs to. Must match an existing stored value. |
company_id | integer | No | Company ID associated with this packaging. Must match an existing stored value. |
bash
curl -X PUT "https://your-domain.com/admin/api/v1/products/packagings/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Box of 12",
"barcode": "5901234123457",
"qty": 12,
"sort": 1,
"product_id": 1,
"company_id": 1
}'javascript
const response = await fetch("https://your-domain.com/admin/api/v1/products/packagings/{id}", {
method: "PUT",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Box of 12",
"barcode": "5901234123457",
"qty": 12,
"sort": 1,
"product_id": 1,
"company_id": 1
}),
});
const data = await response.json();
console.log(data);php
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://your-domain.com/admin/api/v1/products/packagings/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Box of 12',
'barcode' => '5901234123457',
'qty' => 12,
'sort' => 1,
'product_id' => 1,
'company_id' => 1,
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/products/packagings/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"name": "Box of 12",
"barcode": "5901234123457",
"qty": 12,
"sort": 1,
"product_id": 1,
"company_id": 1,
}
response = requests.put(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 200
json
{
"data": {
"id": null,
"name": "Ms. Audra Crooks II",
"barcode": null,
"qty": 1,
"sort": 1,
"product_id": 23,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Packaging updated successfully."
}Error response — 401
json
{
"message": "Unauthenticated."
}Delete packaging
DELETE/admin/api/v1/products/packagings/{id}Delete a packaging
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The packaging ID |
bash
curl -X DELETE "https://your-domain.com/admin/api/v1/products/packagings/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"javascript
const response = await fetch("https://your-domain.com/admin/api/v1/products/packagings/{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
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-domain.com/admin/api/v1/products/packagings/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/products/packagings/{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
json
{
"message": "Packaging deleted successfully."
}Error response — 401
json
{
"message": "Unauthenticated."
}