Skip to main content
Item variants represent specific presentations of an item (e.g., 1kg bag, 5kg box). Each variant has its own unit of measure, pricing, and stock tracking.

List Item Variants

curl -X GET "https://api.sushigo.com/api/v1/item-variants?item_id=1&per_page=20" \
  -H "Authorization: Bearer YOUR_TOKEN"

Query Parameters

item_id
integer
Filter by parent item ID
is_active
boolean
Filter by active status
Search by code or name (case-insensitive partial match)
per_page
integer
default:"15"
Items per page

Response

data
array

Example Response

{
  "status": 200,
  "data": [
    {
      "id": 1,
      "item_id": 1,
      "uom_id": 3,
      "code": "ARR-KG",
      "name": "Arroz Premium 1kg",
      "description": "Presentación de 1 kilogramo",
      "track_lot": false,
      "track_serial": false,
      "last_unit_cost": 28.50,
      "avg_unit_cost": 27.80,
      "sale_price": 35.00,
      "min_stock": 10.0,
      "max_stock": 100.0,
      "is_active": true,
      "item": {
        "id": 1,
        "sku": "INS-001",
        "name": "Arroz Sushi Premium",
        "type": "INSUMO"
      },
      "uom": {
        "id": 3,
        "code": "KG",
        "name": "Kilogramo",
        "symbol": "kg"
      },
      "created_at": "2026-01-15T10:30:00+00:00",
      "updated_at": "2026-01-15T10:30:00+00:00"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 15,
    "total": 3
  }
}

Create Item Variant

curl -X POST "https://api.sushigo.com/api/v1/item-variants" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "item_id": 1,
    "uom_id": 3,
    "code": "ARR-KG",
    "name": "Arroz Premium 1kg",
    "description": "Presentación de 1 kilogramo",
    "sale_price": 35.00,
    "min_stock": 10,
    "max_stock": 100,
    "track_lot": false,
    "is_active": true
  }'

Request Body

item_id
integer
required
Parent item ID (must exist)
uom_id
integer
required
Base unit of measure ID
code
string
required
Unique variant code (auto-uppercased, max 100 chars)
name
string
required
Variant name (max 255 chars)
barcode
string
Product barcode (EAN, UPC, Code128, etc.) - cleaned and uppercased automatically
description
string
Variant description
track_lot
boolean
default:"false"
Track lot/batch numbers
track_serial
boolean
default:"false"
Track individual serial numbers
sale_price
number
Default sale price (≥ 0)
min_stock
number
default:"0"
Minimum stock level (≥ 0)
max_stock
number
default:"0"
Maximum stock level (≥ min_stock)
is_active
boolean
default:"true"
Active status

Response

Returns the created variant object with related item and UOM data. Status 201.

Errors

  • 422 - Validation error (duplicate code, invalid item/UOM, max_stock < min_stock)
  • 403 - Insufficient permissions

Get Item Variant

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

Path Parameters

id
integer
required
Item variant ID

Response

data
object

Example Response

{
  "status": 200,
  "data": {
    "id": 1,
    "code": "ARR-KG",
    "name": "Arroz Premium 1kg",
    "total_on_hand": 250.0,
    "total_reserved": 15.0,
    "total_available": 235.0,
    "avg_unit_cost": 27.80,
    "sale_price": 35.00,
    "item": {
      "id": 1,
      "sku": "INS-001",
      "name": "Arroz Sushi Premium",
      "type": "INSUMO"
    },
    "uom": {
      "id": 3,
      "code": "KG",
      "name": "Kilogramo",
      "symbol": "kg"
    }
  }
}

Errors

  • 404 - Variant not found

Update Item Variant

curl -X PUT "https://api.sushigo.com/api/v1/item-variants/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sale_price": 38.00,
    "min_stock": 15
  }'

Path Parameters

id
integer
required
Item variant ID

Request Body

All fields are optional. Only provided fields will be updated.
code
string
Variant code (must be unique)
barcode
string
Product barcode
name
string
Variant name
description
string
Description
sale_price
number
Sale price
min_stock
number
Minimum stock
max_stock
number
Maximum stock
is_active
boolean
Active status
item_id, uom_id, track_lot, and track_serial cannot be changed after creation.

Response

Returns the updated variant object with status 200.

Errors

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

Delete Item Variant

curl -X DELETE "https://api.sushigo.com/api/v1/item-variants/1" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
integer
required
Item variant ID

Response

{
  "status": 200,
  "message": "Item variant deleted successfully"
}

Errors

  • 404 - Variant not found
  • 409 - Cannot delete - variant has stock on hand. Clear inventory first.
  • 403 - Insufficient permissions
Variants with stock on hand cannot be deleted. You must first consume or move all stock to zero before deletion.

Build docs developers (and LLMs) love