Variations let shoppers select a specific option (e.g., Color = Red, Size = XL) before adding a product to their cart. The system is built on two lookup tables and one variation table:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSCaicedo/Api-Ecommerce/llms.txt
Use this file to discover all available pages before exploring further.
- Attributes — the type of option (e.g., Color, Size, Material). Each attribute has a
type_attributethat governs how its values are rendered and which contexts it can be used in. - Properties — the values belonging to an attribute (e.g., Red, Blue for Color; S, M, L for Size). A
codefield stores hex color codes for color-type attributes. - Product Variations — link a product to a specific attribute + property combination, with optional stock allocation and price adjustment. Variations can be nested (anidado) to model multi-dimensional options such as Color → Size.
Mutating operations on attributes (
store, store_propertie, update, destroy, destroy_propertie) and variations (store, update, destroy) are throttled at 10 requests per minute per token.Authentication
All/api/admin/ endpoints require:
Attributes
List Attributes
id descending. Each attribute includes its full list of properties.
Query parameters
Filter by attribute
name (SQL LIKE %value%).Total matching attributes.
Array of attribute objects (plain array, not wrapped in a
data key), each with an embedded properties array.Create Attribute
Attribute name (e.g.,
"Color", "Size", "Material"). Must be unique.1 = active, 0 = inactive.Controls how the attribute is rendered on the storefront and which contexts it can be used in.
| Value | Meaning |
|---|---|
1 | Color swatch — property code holds a hex color value |
2 | Free-text input — no predefined properties needed |
3 | Select / dropdown from predefined properties |
Only attributes with
type_attribute 1 (color) or 3 (select) are available for product variations (returned by GET /api/admin/variations/config as attributes_variations). All type_attribute values are available for product specifications.200 on success, 403 on duplicate name.The created attribute including its (initially empty)
properties array.Update Attribute
Attribute ID to update.
Delete Attribute
Attribute ID to delete.
Properties
Properties are the individual values that belong to an attribute (e.g., Red/Blue for Color; S/M/L for Size).Add Property to Attribute
The parent attribute ID this property belongs to.
Property display name (e.g.,
"Red", "XL", "Cotton").For color attributes (
type_attribute = 1), supply the hex color code (e.g., "#FF5733"). Leave empty for non-color attributes.200 on success, 403 on duplicate name within the same attribute.The created property record.
Delete Property
Property ID to delete.
Variation Config
Returns the attribute lists for use in variation and specification form dropdowns.All active attributes (any
type_attribute value) with their properties. Used to populate specification forms.Active attributes with
type_attribute 1 (color swatch) or 3 (select/dropdown) only. Used to populate variation forms. Free-text (type_attribute = 2) attributes are excluded because variations require selecting from a finite list of predefined properties.Product Variations (First Level)
List Variations for a Product
product_variation_id IS NULL) for the given product, ordered by id descending.
Query parameters
The product ID whose variations to retrieve.
Array of variation objects. Each includes the resolved
attribute and propertie nested objects.Create Variation
The product this variation belongs to.
The attribute type for this variation (e.g., Color attribute ID, Size attribute ID). Must be
type_attribute 1 or 3 (color or select) — only those are included in attributes_variations from the config endpoint.The specific property value (e.g., Red ID, XL ID). Use for
type_attribute = 1 (color) and type_attribute = 3 (select). Either propertie_id or value_add should be supplied.Free-text value for attributes without predefined properties. Either
propertie_id or value_add should be supplied.Price adjustment added on top of the base product price when this variation is selected.
Stock units reserved for this specific variation.
1 = active, 0 = inactive.200 on success, 403 on validation error.The newly created variation object with resolved
attribute and propertie.Update Variation
Variation ID to update.
{"message": 403} on conflict.
Response
Delete Variation
Variation ID to delete.
Nested (Anidado) Variations
Nested variations model multi-dimensional option combinations, for example: a parent variation of Color = Red with child variations Size = S, Size = M, Size = L. Endpoints mirror the standard variations resource but operate on rows scoped to a specificproduct_variation_id (the parent variation).
List Nested Variations
The product ID.
The parent (first-level) variation ID whose children to retrieve.
Array of nested variation objects, each including a
product_variation_id field pointing back to the parent.Create Nested Variation
The product ID.
The parent first-level variation ID. This links the nested variation as a child.
The attribute for this dimension (e.g., Size attribute ID).
The property value (e.g., Size = M).
Free-text value for attributes without predefined properties.
Additional price adjustment for this specific combination.
Stock units for this combination. The sum of all sibling nested variations’ stock must not exceed the parent’s stock.
1 = active, 0 = inactive.Update Nested Variation
Delete Nested Variation
Nested variation ID to delete.
Example: Building a Color + Size Variation Tree
The following walkthrough creates a Color → Size variation tree for product ID42, which has a base stock of 50 units total.
Create the first-level Color variations
Create one first-level variation for each color. The total stock across colors represents the available inventory per color.
Create nested Size variations under Red (id=5)
The sum of nested stock must not exceed the parent’s stock (30).