Skip to content

Package Types ​

Part of the Inventory 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 package types ​

GET /admin/api/v1/inventories/package-types

Retrieve a paginated list of package types with filtering and sorting

🔒 Requires a valid Bearer token.

Query parameters

ParameterTypeRequiredDescriptionExample
includestringNoComma-separated list of relationships to include. Available options: company, creatorcompany
filter[id]stringNoComma-separated list of IDs to filter byarchitecto
filter[name]stringNoFilter by package type nameBox
filter[barcode]stringNoFilter by barcodePKG
filter[company_id]stringNoFilter by company IDsarchitecto
sortstringNoSort field-created_at
bash
curl -X GET "https://your-domain.com/admin/api/v1/inventories/package-types?include=company&filter%5Bid%5D=architecto&filter%5Bname%5D=Box&filter%5Bbarcode%5D=PKG&filter%5Bcompany_id%5D=architecto&sort=-created_at" \
  -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/inventories/package-types?include=company&filter%5Bid%5D=architecto&filter%5Bname%5D=Box&filter%5Bbarcode%5D=PKG&filter%5Bcompany_id%5D=architecto&sort=-created_at", {
  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/inventories/package-types?include=company&filter%5Bid%5D=architecto&filter%5Bname%5D=Box&filter%5Bbarcode%5D=PKG&filter%5Bcompany_id%5D=architecto&sort=-created_at', [
    '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/inventories/package-types?include=company&filter%5Bid%5D=architecto&filter%5Bname%5D=Box&filter%5Bbarcode%5D=PKG&filter%5Bcompany_id%5D=architecto&sort=-created_at"

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": "eius et",
      "sort": 0,
      "barcode": null,
      "height": null,
      "width": null,
      "length": null,
      "base_weight": null,
      "max_weight": null,
      "shipper_package_code": null,
      "package_carrier_type": null,
      "created_at": null,
      "updated_at": null
    },
    {
      "id": null,
      "name": "animi quos",
      "sort": 0,
      "barcode": null,
      "height": null,
      "width": null,
      "length": null,
      "base_weight": null,
      "max_weight": null,
      "shipper_package_code": null,
      "package_carrier_type": null,
      "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": "&laquo; Previous",
        "page": null,
        "active": false
      },
      {
        "url": "/?page=1",
        "label": "1",
        "page": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "page": null,
        "active": false
      }
    ],
    "path": "/",
    "per_page": 10,
    "to": 2,
    "total": 2
  }
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Create package type ​

POST /admin/api/v1/inventories/package-types

Create a new package type

🔒 Requires a valid Bearer token.

Body parameters

ParameterTypeRequiredDescription
namestringYesPackage type name. Must not be greater than 255 characters.
lengthnumberYesLength. Must be at least 0. Must not be greater than 99999999999.
widthnumberYesWidth. Must be at least 0. Must not be greater than 99999999999.
heightnumberYesHeight. Must be at least 0. Must not be greater than 99999999999.
base_weightnumberYesBase package weight. Must be at least 0. Must not be greater than 99999999999.
max_weightnumberYesMaximum package weight. Must be at least 0. Must not be greater than 99999999999.
barcodestringNoPackage type barcode. Must not be greater than 255 characters.
company_idintegerNoCompany ID. Must match an existing stored value.
bash
curl -X POST "https://your-domain.com/admin/api/v1/inventories/package-types" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Box L",
  "length": 40,
  "width": 30,
  "height": 20,
  "base_weight": 1.5,
  "max_weight": 25,
  "barcode": "PKG-TYPE-001",
  "company_id": 1
}'
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/package-types", {
  method: "POST",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "name": "Box L",
  "length": 40,
  "width": 30,
  "height": 20,
  "base_weight": 1.5,
  "max_weight": 25,
  "barcode": "PKG-TYPE-001",
  "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/inventories/package-types', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
    'json' => [
    'name' => 'Box L',
    'length' => 40,
    'width' => 30,
    'height' => 20,
    'base_weight' => 1.5,
    'max_weight' => 25,
    'barcode' => 'PKG-TYPE-001',
    'company_id' => 1,
  ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/package-types"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

payload = {
    "name": "Box L",
    "length": 40,
    "width": 30,
    "height": 20,
    "base_weight": 1.5,
    "max_weight": 25,
    "barcode": "PKG-TYPE-001",
    "company_id": 1,
}

response = requests.post(url, headers=headers, json=payload)

data = response.json()
print(data)

Example response 201

json
{
  "data": {
    "id": null,
    "name": "architecto eius",
    "sort": 0,
    "barcode": null,
    "height": null,
    "width": null,
    "length": null,
    "base_weight": null,
    "max_weight": null,
    "shipper_package_code": null,
    "package_carrier_type": null,
    "created_at": null,
    "updated_at": null
  },
  "message": "Package type created successfully."
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Show package type ​

GET /admin/api/v1/inventories/package-types/{id}

Retrieve a specific package type by ID

🔒 Requires a valid Bearer token.

Path parameters

ParameterTypeRequiredDescription
idintegerYesThe package type ID

Query parameters

ParameterTypeRequiredDescriptionExample
includestringNoComma-separated list of relationships to include. Available options: company, creatorcompany
bash
curl -X GET "https://your-domain.com/admin/api/v1/inventories/package-types/{id}?include=company" \
  -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/inventories/package-types/{id}?include=company", {
  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/inventories/package-types/{id}?include=company', [
    '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/inventories/package-types/{id}?include=company"

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": "aut adipisci",
    "sort": 0,
    "barcode": null,
    "height": null,
    "width": null,
    "length": null,
    "base_weight": null,
    "max_weight": null,
    "shipper_package_code": null,
    "package_carrier_type": null,
    "created_at": null,
    "updated_at": null
  }
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Update package type ​

PUT /admin/api/v1/inventories/package-types/{id}

Update an existing package type

🔒 Requires a valid Bearer token.

Path parameters

ParameterTypeRequiredDescription
idintegerYesThe package type ID

Body parameters

ParameterTypeRequiredDescription
namestringNoPackage type name. Must not be greater than 255 characters.
lengthnumberNoLength. Must be at least 0. Must not be greater than 99999999999.
widthnumberNoWidth. Must be at least 0. Must not be greater than 99999999999.
heightnumberNoHeight. Must be at least 0. Must not be greater than 99999999999.
base_weightnumberNoBase package weight. Must be at least 0. Must not be greater than 99999999999.
max_weightnumberNoMaximum package weight. Must be at least 0. Must not be greater than 99999999999.
barcodestringNoPackage type barcode. Must not be greater than 255 characters.
company_idintegerNoCompany ID. Must match an existing stored value.
bash
curl -X PUT "https://your-domain.com/admin/api/v1/inventories/package-types/{id}" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Box L",
  "length": 40,
  "width": 30,
  "height": 20,
  "base_weight": 1.5,
  "max_weight": 25,
  "barcode": "PKG-TYPE-001",
  "company_id": 1
}'
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/package-types/{id}", {
  method: "PUT",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "name": "Box L",
  "length": 40,
  "width": 30,
  "height": 20,
  "base_weight": 1.5,
  "max_weight": 25,
  "barcode": "PKG-TYPE-001",
  "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/inventories/package-types/{id}', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
    'json' => [
    'name' => 'Box L',
    'length' => 40,
    'width' => 30,
    'height' => 20,
    'base_weight' => 1.5,
    'max_weight' => 25,
    'barcode' => 'PKG-TYPE-001',
    'company_id' => 1,
  ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/package-types/{id}"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

payload = {
    "name": "Box L",
    "length": 40,
    "width": 30,
    "height": 20,
    "base_weight": 1.5,
    "max_weight": 25,
    "barcode": "PKG-TYPE-001",
    "company_id": 1,
}

response = requests.put(url, headers=headers, json=payload)

data = response.json()
print(data)

Example response 200

json
{
  "data": {
    "id": null,
    "name": "architecto eius",
    "sort": 0,
    "barcode": null,
    "height": null,
    "width": null,
    "length": null,
    "base_weight": null,
    "max_weight": null,
    "shipper_package_code": null,
    "package_carrier_type": null,
    "created_at": null,
    "updated_at": null
  },
  "message": "Package type updated successfully."
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Delete package type ​

DELETE /admin/api/v1/inventories/package-types/{id}

Delete a package type

🔒 Requires a valid Bearer token.

Path parameters

ParameterTypeRequiredDescription
idintegerYesThe package type ID
bash
curl -X DELETE "https://your-domain.com/admin/api/v1/inventories/package-types/{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/inventories/package-types/{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/inventories/package-types/{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/inventories/package-types/{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": "Package type deleted successfully."
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Released under the MIT License.