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
Campo
| Campo | Tipo | Flags | Notas |
|---|---|---|---|
id | string | 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). | |
name | string | requerido | Display name of the variant. |
code | string | Option-level SKU. | |
price | number | Absolute unit price (≥ 0). Required on at least one option per product. | |
stock | integer | Available units. Optional. | |
image_id | string|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. |
