Skip to main content
Inventory locations represent physical or logical zones within an operating unit where stock is stored (e.g., main warehouse, kitchen, bar, temporary storage).

List Inventory Locations

curl -X GET "https://api.sushigo.com/api/v1/inventory-locations?operating_unit_id=1" \
  -H "Authorization: Bearer YOUR_TOKEN"

Query Parameters

operating_unit_id
integer
Filter by operating unit (branch or temporary unit)
type
string
Filter by location type: MAIN, TEMP, KITCHEN, BAR, or RETURN
is_active
boolean
Filter by active status
per_page
integer
default:"15"
Items per page

Response

data
array
meta
object
Pagination metadata

Example Response

{
  "status": 200,
  "data": [
    {
      "id": 1,
      "operating_unit_id": 1,
      "name": "Almacén Principal",
      "type": "MAIN",
      "priority": 100,
      "is_primary": true,
      "is_active": true
    },
    {
      "id": 2,
      "operating_unit_id": 1,
      "name": "Cocina",
      "type": "KITCHEN",
      "priority": 50,
      "is_primary": false,
      "is_active": true
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 15,
    "total": 2
  }
}

Create Inventory Location

curl -X POST "https://api.sushigo.com/api/v1/inventory-locations" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "operating_unit_id": 1,
    "name": "Bodega Temporal",
    "type": "TEMP",
    "priority": 75,
    "is_primary": false,
    "is_active": true,
    "notes": "Almacén para eventos especiales"
  }'

Request Body

operating_unit_id
integer
required
Operating unit ID (must exist)
name
string
required
Location name
type
string
required
Location type: MAIN, TEMP, KITCHEN, BAR, or RETURN
priority
integer
default:"100"
Priority for stock picking (1-999, higher picked first)
is_primary
boolean
default:"false"
Primary location for the operating unit
is_active
boolean
default:"true"
Active status
notes
string
Additional notes about this location

Response

Returns the created location with operating unit and branch details. Status 201.
{
  "status": 201,
  "data": {
    "id": 3,
    "operating_unit_id": 1,
    "name": "Bodega Temporal",
    "type": "TEMP",
    "priority": 75,
    "is_primary": false,
    "is_active": true,
    "notes": "Almacén para eventos especiales",
    "operating_unit": {
      "id": 1,
      "name": "Sucursal Centro",
      "type": "BRANCH",
      "branch": {
        "id": 1,
        "code": "SUC-001",
        "name": "Centro"
      }
    },
    "created_at": "2026-03-06T14:30:00+00:00"
  }
}

Errors

  • 422 - Validation error (invalid operating_unit_id, invalid type)
  • 403 - Insufficient permissions

Get Inventory Location

curl -X GET "https://api.sushigo.com/api/v1/inventory-locations/1" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
integer
required
Inventory location ID

Response

data
object

Example Response

{
  "status": 200,
  "data": {
    "id": 1,
    "operating_unit_id": 1,
    "name": "Almacén Principal",
    "type": "MAIN",
    "priority": 100,
    "is_primary": true,
    "is_active": true,
    "notes": null,
    "operating_unit": {
      "id": 1,
      "name": "Sucursal Centro",
      "type": "BRANCH",
      "branch": {
        "id": 1,
        "code": "SUC-001",
        "name": "Centro"
      }
    },
    "stock_summary": {
      "variant_count": 42,
      "total_on_hand": 3520.5,
      "total_reserved": 125.0,
      "total_available": 3395.5
    },
    "created_at": "2026-01-10T08:00:00+00:00",
    "updated_at": "2026-01-10T08:00:00+00:00"
  }
}

Errors

  • 404 - Location not found

Update Inventory Location

curl -X PUT "https://api.sushigo.com/api/v1/inventory-locations/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "priority": 120,
    "notes": "Prioridad aumentada"
  }'

Path Parameters

id
integer
required
Inventory location ID

Request Body

All fields are optional. operating_unit_id cannot be changed after creation.
name
string
Location name
type
string
Location type
priority
integer
Priority (1-999)
is_primary
boolean
Primary location
is_active
boolean
Active status
notes
string
Notes

Response

Returns the updated location object with status 200.

Errors

  • 404 - Location not found
  • 422 - Validation error
  • 403 - Insufficient permissions

Delete Inventory Location

curl -X DELETE "https://api.sushigo.com/api/v1/inventory-locations/3" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
integer
required
Inventory location ID

Response

{
  "status": 200,
  "data": {
    "message": "Inventory location deleted successfully"
  }
}

Errors

  • 404 - Location not found
  • 409 - Cannot delete - location has stock on hand. Move or consume stock first.
  • 403 - Insufficient permissions
Locations with stock on hand cannot be deleted. Transfer all stock to other locations or consume it before deletion.

Build docs developers (and LLMs) love