A product option (variant — size, color, etc.).

API
Schema

Option

A product option (variant — size, color, etc.). EVERY product is option-based: a product without explicit variants is exposed as a single implicit option whose :id is the producto/id (alias). :price is always the absolute effective unit price for this option. `image_id` is a POINTER into the parent product's `images[]`. Two options may share the same `image_id`. Today the underlying storage clones the referenced file per option; the wire surface hides that detail. After the upcoming schema migration shared `image_id`s will resolve to a single underlying entity — wire shape unchanged.

Ejemplo

json
{
  "id": "87960930223204",
  "name": "Azul / M",
  "code": "REM-001-AZ-M",
  "price": 4500.0,
  "stock": 5,
  "image_id": "7001"
}

Campo

CampoTipoFlagsNotas
idstring
Required on PUT to keep an existing option; omit on POST to create a new one. On legacy single-option products :id equals the producto/id (alias).
namestring
requerido
Display name of the variant.
codestring
Option-level SKU.
pricenumber
Absolute unit price (≥ 0). Required on at least one option per product.
stockinteger
Available units. Optional.
image_idstring|null
Eid of one of the parent product's images[]. Pass null to clear; omit to keep the current value. Must be an id currently present in the product's images set (producto-uploaded images OR images attached to any option of the same product) — cross-product / unknown ids are rejected 422.