Skip to main content

List Operating Units

Retrieves a paginated list of operating units with optional filtering by search term, type, active status, and branch.

Query Parameters

per_page
integer
default:"15"
Number of items per page (1-100)
Search by operating unit name (partial match, case-insensitive)
type
string
Filter by operating unit type. Valid values:
  • BRANCH_MAIN - Main branch operating unit
  • BRANCH_BUFFER - Branch buffer storage
  • BRANCH_RETURN - Branch return processing
  • EVENT_TEMP - Temporary event unit
is_active
boolean
Filter by active status (true or false)
branch_id
integer
Filter by branch ID

Response

data
array
Array of operating unit objects
id
integer
Operating unit ID
branch_id
integer
Associated branch ID
name
string
Operating unit name
type
string
Operating unit type (BRANCH_MAIN, BRANCH_BUFFER, BRANCH_RETURN, EVENT_TEMP)
start_date
string
Start date (YYYY-MM-DD format)
end_date
string
End date (YYYY-MM-DD format, null for permanent units)
is_active
boolean
Whether the operating unit is currently active
meta
object
Additional metadata (JSON object)
branch
object
Associated branch details
id
integer
Branch ID
name
string
Branch name
created_at
string
Creation timestamp (ISO 8601 UTC)
updated_at
string
Last update timestamp (ISO 8601 UTC)
current_page
integer
Current page number
per_page
integer
Items per page
total
integer
Total number of operating units
last_page
integer
Last page number

Example Request

curl -X GET "https://api.sushigo.local/api/v1/operating-units?per_page=10&type=BRANCH_MAIN&is_active=true" \
  -H "Accept: application/json"

Example Response

{
  "data": [
    {
      "id": 1,
      "branch_id": 1,
      "name": "Main Kitchen",
      "type": "BRANCH_MAIN",
      "start_date": "2025-01-01",
      "end_date": null,
      "is_active": true,
      "meta": null,
      "branch": {
        "id": 1,
        "name": "Downtown Branch"
      },
      "created_at": "2026-01-15T10:30:00+00:00",
      "updated_at": "2026-01-15T10:30:00+00:00"
    }
  ],
  "current_page": 1,
  "per_page": 10,
  "total": 1,
  "last_page": 1
}

Show Operating Unit

Retrieves a single operating unit by ID, including associated branch and inventory locations.

Path Parameters

id
integer
required
Operating unit ID

Response

data
object
Operating unit object
id
integer
Operating unit ID
branch_id
integer
Associated branch ID
name
string
Operating unit name
type
string
Operating unit type (BRANCH_MAIN, BRANCH_BUFFER, BRANCH_RETURN, EVENT_TEMP)
start_date
string
Start date (YYYY-MM-DD format)
end_date
string
End date (YYYY-MM-DD format, null for permanent units)
is_active
boolean
Whether the operating unit is currently active
meta
object
Additional metadata (JSON object)
branch
object
Associated branch details
id
integer
Branch ID
name
string
Branch name
inventory_locations
array
Array of inventory location objects associated with this operating unit
id
integer
Location ID
name
string
Location name
is_primary
boolean
Whether this is the primary location for the operating unit
created_at
string
Creation timestamp (ISO 8601 UTC)
updated_at
string
Last update timestamp (ISO 8601 UTC)

Example Request

curl -X GET "https://api.sushigo.local/api/v1/operating-units/1" \
  -H "Accept: application/json"

Example Response

{
  "data": {
    "id": 1,
    "branch_id": 1,
    "name": "Main Kitchen",
    "type": "BRANCH_MAIN",
    "start_date": "2025-01-01",
    "end_date": null,
    "is_active": true,
    "meta": null,
    "branch": {
      "id": 1,
      "name": "Downtown Branch"
    },
    "inventory_locations": [
      {
        "id": 1,
        "name": "Main Storage",
        "is_primary": true
      },
      {
        "id": 2,
        "name": "Cold Storage",
        "is_primary": false
      }
    ],
    "created_at": "2026-01-15T10:30:00+00:00",
    "updated_at": "2026-01-15T10:30:00+00:00"
  }
}

Error Responses

404
object
Operating unit not found
{
  "message": "Not found"
}

Build docs developers (and LLMs) love