Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
products.read_write - Products Read & Write{
"variants": [
{
"id": "ebd067c3-6c51-4692-9cac-e43118930ec2",
"is_deleted": false,
"sku": "Z.6.1905460000038147819",
"price": 144,
"sale_price": null,
"cost": null,
"barcode": null,
"attributes": [
{
"slug": "ุงูููู",
"value": {
"ar": "ุงุจูุถ",
"en": "White"
}
}
],
"stocks": [
{
"available_quantity": 44,
"is_infinite": false,
"location": "e2629f14-12ad-4ee4-8103-9db7290c4ccc"
}
],
"weight": {
"unit": "kg",
"value": null
}
},
{
"is_deleted": false,
"sku": "Z.6.1905460000038147869",
"price": 144,
"sale_price": 122,
"cost": null,
"barcode": null,
"attributes": [
{
"slug": "ุงูููู",
"value": {
"ar": "ุงุณูุฏ",
"en": "Black"
}
}
],
"stocks": [
{
"available_quantity": 77,
"is_infinite": false,
"location": "e2629f14-12ad-4ee4-8103-9db7290c4ccc"
}
],
"weight": {
"unit": "kg",
"value": null
}
}
]
}curl --location --request POST 'https://api.zid.sa/v1/products//variants/' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMTciLCJqdGkiOiJhMTg5ZTg3MmYxMzhkMWVhYjU5MjVkMDkyMGE5NmI0YjliNjg0Y2E2ZTdmM2M2MjljZWYxNmQ4NDJjMmJlYmVhMjI4YTdmMTA0ZWQ4NWE5NCIsImlhdCI6MTY3OTU3Njk5OS41NjY4NzcsIm5iZiI6MTY3OTU3Njk5OS41NjY4OCwiZXhwIjoxNzExMTk5Mzk5LjQ4NjE1Mywic3ViIjoiMTgyNDc1Iiwic2NvcGVzIjpbInRoaXJkLXBhcnRpZXMtYXBpcyJdfQ.i07ef09nVNXGZF-g-QXpNoS2vlFQK_zntAqAMS4Az2XD2EyMLhxLZZRL-QlR11zUPqMmXjMAl_4ooKa3M3zkfZQ6Ga6qStvamk8RnC_39VUx0lfN2A4k65ERZpqwrMy6-t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
--header 'Content-Type: application/json' \
--data-raw '{
"variants": [
{
"id": "ebd067c3-6c51-4692-9cac-e43118930ec2",
"is_deleted": false,
"sku": "Z.6.1905460000038147819",
"price": 144,
"sale_price": null,
"cost": null,
"barcode": null,
"attributes": [
{
"slug": "ุงูููู",
"value": {
"ar": "ุงุจูุถ",
"en": "White"
}
}
],
"stocks": [
{
"available_quantity": 44,
"is_infinite": false,
"location": "e2629f14-12ad-4ee4-8103-9db7290c4ccc"
}
],
"weight": {
"unit": "kg",
"value": null
}
},
{
"is_deleted": false,
"sku": "Z.6.1905460000038147869",
"price": 144,
"sale_price": 122,
"cost": null,
"barcode": null,
"attributes": [
{
"slug": "ุงูููู",
"value": {
"ar": "ุงุณูุฏ",
"en": "Black"
}
}
],
"stocks": [
{
"available_quantity": 77,
"is_infinite": false,
"location": "e2629f14-12ad-4ee4-8103-9db7290c4ccc"
}
],
"weight": {
"unit": "kg",
"value": null
}
}
]
}'{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Add or Create Product Variants Response",
"type": "object",
"description": "Full product object returned after successfully adding or creating variants. Includes parent product and all associated variants.",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the product.",
"example": "3c58afbb-7b07-4859-b653-b52242a33bb7"
},
"name": {
"type": "object",
"description": "Localized product name. Supports both Arabic and English.",
"properties": {
"ar": { "type": "string", "example": "" },
"en": { "type": "string", "example": "" }
}
},
"sku": {
"type": "string",
"description": "SKU (Stock Keeping Unit) identifier for the product.",
"example": "Z.1762848292350157"
},
"slug": {
"type": "string",
"description": "Unique slug (URL-friendly identifier) for the product.",
"example": "3c58afbb-7b07-4859-b653-b52242a33bb7"
},
"currency": {
"type": "string",
"description": "Currency code used for pricing.",
"example": "SAR"
},
"currency_symbol": {
"type": "string",
"description": "Symbol representation of the currency.",
"example": " SAR "
},
"price": {
"type": "number",
"description": "Base price of the product.",
"example": 0
},
"sale_price": {
"type": ["number", "null"],
"description": "Sale or discounted price, if applicable.",
"example": null
},
"formatted_price": {
"type": "string",
"description": "Formatted price string including currency symbol.",
"example": " SAR 0.00"
},
"formatted_sale_price": {
"type": ["string", "null"],
"description": "Formatted sale price, if applicable.",
"example": null
},
"description": {
"type": "object",
"description": "Localized long product description.",
"example": {}
},
"short_description": {
"type": "object",
"description": "Localized short description.",
"example": {}
},
"categories": {
"type": "array",
"description": "List of categories the product belongs to.",
"items": { "type": "string" },
"example": []
},
"images": {
"type": "array",
"description": "List of product image objects or URLs.",
"items": { "type": "string" },
"example": []
},
"videos": {
"type": "array",
"description": "List of product video URLs or metadata objects.",
"example": []
},
"is_draft": {
"type": "boolean",
"description": "Indicates whether the product is in draft mode.",
"example": true
},
"is_infinite": {
"type": "boolean",
"description": "Indicates if product has infinite stock availability.",
"example": false
},
"is_taxable": {
"type": "boolean",
"description": "Indicates whether the product is taxable.",
"example": true
},
"requires_shipping": {
"type": "boolean",
"description": "Whether the product requires shipping.",
"example": true
},
"group_products": {
"type": ["array", "null"],
"description": "Array of grouped product references, if applicable.",
"example": null
},
"custom_option_fields": {
"type": "array",
"description": "Custom option fields associated with the product.",
"example": []
},
"custom_user_input_fields": {
"type": "array",
"description": "Custom input fields for user-provided data.",
"example": []
},
"options": {
"type": "array",
"description": "Array of option definitions such as color, size, etc.",
"items": {
"type": "object",
"properties": {
"id": { "type": "string", "example": "518fe604-8642-4032-b967-0be821ae235d" },
"name": { "type": "string", "example": "Color" },
"slug": { "type": "string", "example": "ุงูููู" },
"choices": {
"type": "array",
"description": "List of available choices for the option.",
"items": { "type": "string" },
"example": ["Black", "White"]
}
},
"required": ["id", "name", "slug"]
},
"example": [
{
"id": "518fe604-8642-4032-b967-0be821ae235d",
"name": "Color",
"slug": "ุงูููู",
"choices": ["Black", "White"]
}
]
},
"related_products": {
"type": "array",
"description": "List of related products (auto-generated or manual).",
"example": []
},
"related_products_settings": {
"type": "string",
"description": "Defines how related products are determined (AUTO_GENERATED or MANUAL).",
"example": "AUTO_GENERATED"
},
"related_products_title": {
"type": "object",
"description": "Localized title for related products section.",
"example": {}
},
"badge": {
"type": ["string", "null"],
"description": "Badge label or icon associated with the product.",
"example": null
},
"html_url": {
"type": "string",
"description": "Public product URL in the storefront.",
"example": "https://mustafastore.localhost:8084/products/3c58afbb-7b07-4859-b653-b52242a33bb7"
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the product was created.",
"example": "2025-11-11T08:04:52.363138Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the product was last updated.",
"example": "2025-11-11T08:05:16.595741Z"
},
"store_id": {
"type": "integer",
"description": "Unique identifier of the store to which the product belongs.",
"example": 6
},
"structure": {
"type": "string",
"description": "Defines the product hierarchy type (e.g., parent, child).",
"example": "parent"
},
"stocks": {
"type": "array",
"description": "Array of stock objects showing availability across locations.",
"example": []
},
"variants": {
"type": "array",
"description": "List of variants under this product. Each variant represents a unique combination of attributes.",
"items": {
"type": "object",
"description": "Variant object with similar structure to a standalone product but linked via parent_id.",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier of the variant.",
"example": "22a32ae6-6c6c-4904-9e2f-9c3a9373f8f1"
},
"parent_id": {
"type": "string",
"description": "Parent product ID this variant belongs to.",
"example": "3c58afbb-7b07-4859-b653-b52242a33bb7"
},
"name": {
"type": "object",
"description": "Localized name of the variant.",
"properties": {
"en": { "type": "string", "example": " - Black" }
}
},
"slug": {
"type": "string",
"description": "URL slug for the variant.",
"example": "en-black"
},
"sku": {
"type": "string",
"description": "SKU for this variant.",
"example": "Z.6.7228299999713898900"
},
"price": {
"type": "number",
"description": "Base price for this variant.",
"example": 0
},
"sale_price": {
"type": ["number", "null"],
"description": "Sale or promotional price.",
"example": null
},
"is_published": {
"type": "boolean",
"description": "Indicates whether the variant is published and visible.",
"example": false
},
"is_draft": {
"type": "boolean",
"description": "Indicates whether the variant is in draft mode.",
"example": true
},
"is_infinite": {
"type": "boolean",
"description": "Indicates infinite stock availability for this variant.",
"example": false
},
"is_taxable": {
"type": "boolean",
"description": "Whether the variant is taxable.",
"example": true
},
"has_fields": {
"type": "boolean",
"description": "Indicates if the variant has any custom option fields.",
"example": false
},
"has_options": {
"type": "boolean",
"description": "Indicates if this variant has options.",
"example": false
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2025-11-11T08:05:16.588385Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2025-11-11T08:05:16.588397Z"
},
"currency": {
"type": "string",
"example": "SAR"
},
"currency_symbol": {
"type": "string",
"example": " SAR "
},
"html_url": {
"type": "string",
"description": "Public URL for the variant in the storefront.",
"example": "https://mustafastore.localhost:8084/products/en-black"
},
"structure": {
"type": "string",
"description": "Indicates if the variant is a 'child' product.",
"example": "child"
},
"weight": {
"type": "object",
"description": "Weight details for the variant.",
"example": {}
},
"stocks": {
"type": "array",
"description": "List of stock details for this variant.",
"example": []
}
},
"required": ["id", "sku", "slug", "parent_id"]
}
},
"weight": {
"type": "object",
"description": "Product weight information.",
"example": {}
}
},
"required": ["id", "sku", "name", "variants", "structure", "price"]
}