{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xavio-in/json-schema/xavio-in-product-update-request-schema.json",
  "title": "ProductUpdateRequest",
  "description": "PATCH /api/v1/products/{id} body — every field optional; only fields present are written; null clears a nullable column.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xavio-in-openapi.json#/components/schemas/ProductUpdateRequest",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 5000
    },
    "price_cents": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000000000
    },
    "compare_at_price_cents": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 1000000000
    },
    "currency": {
      "type": "string",
      "pattern": "/^[A-Z]{3}$/"
    },
    "stock": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000000
    },
    "media_url": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2048
    },
    "is_active": {
      "type": "boolean"
    },
    "image_urls": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "maxLength": 2048
      }
    },
    "sku": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 60
    },
    "brand": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 60
    },
    "category": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 60
    },
    "gtin": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 40
    },
    "mpn": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 70
    },
    "hsn_code": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "/^[0-9]{4,8}$/"
        },
        {
          "const": "",
          "type": "string"
        }
      ],
      "nullable": true
    },
    "gst_rate_bps": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 10000
    },
    "sac_code": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "/^99[0-9]{2}([0-9]{2})?$/"
        },
        {
          "const": "",
          "type": "string"
        }
      ],
      "nullable": true
    },
    "weight_grams": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 500000
    },
    "ship_length_mm": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 5000000
    },
    "ship_width_mm": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 5000000
    },
    "ship_height_mm": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 5000000
    },
    "available_on_cod": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "returnable": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "return_window_days": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 365
    },
    "time_to_ship_hours": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 1440
    },
    "condition": {
      "type": "string",
      "enum": [
        "new",
        "refurbished",
        "used"
      ]
    },
    "age_group": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "newborn",
            "infant",
            "toddler",
            "kids",
            "adult"
          ]
        },
        {
          "const": "",
          "type": "string"
        }
      ],
      "nullable": true
    },
    "gender": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "male",
            "female",
            "unisex"
          ]
        },
        {
          "const": "",
          "type": "string"
        }
      ],
      "nullable": true
    },
    "country_of_origin": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "/^([A-Z]{2})?$/"
    },
    "legal_metrology_meta": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "manufacturer": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "address": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "required": [
            "name",
            "address"
          ]
        },
        "packer": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "address": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "required": [
            "name",
            "address"
          ]
        },
        "importer": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "address": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "required": [
            "name",
            "address"
          ]
        },
        "net_quantity": {
          "type": "object",
          "properties": {
            "value": {
              "type": "number",
              "minimum": 0,
              "maximum": 10000000
            },
            "unit": {
              "type": "string",
              "enum": [
                "g",
                "kg",
                "ml",
                "l",
                "pcs",
                "cm",
                "m",
                "pair",
                "set"
              ]
            }
          },
          "required": [
            "value",
            "unit"
          ]
        },
        "generic_name": {
          "type": "string",
          "minLength": 0,
          "maxLength": 120
        },
        "month_year_of_manufacture": {
          "type": "string",
          "minLength": 0,
          "maxLength": 20
        },
        "customer_care": {
          "type": "object",
          "properties": {
            "phone": {
              "type": "string",
              "maxLength": 20
            },
            "email": {
              "type": "string",
              "maxLength": 254
            }
          },
          "required": []
        }
      },
      "required": [
        "manufacturer",
        "net_quantity"
      ]
    },
    "min_order_qty": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 100000
    },
    "qty_price_breaks": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "min_qty": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "unit_price_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000
          }
        },
        "required": [
          "min_qty",
          "unit_price_cents"
        ]
      }
    },
    "sale_price_cents": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 1000000000
    },
    "sale_starts_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "sale_ends_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "is_tax_inclusive": {
      "type": "boolean"
    },
    "launch_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "visible_storefront": {
      "type": "boolean"
    },
    "visible_discovery": {
      "type": "boolean"
    },
    "visible_agent": {
      "type": "boolean"
    },
    "cost_cents": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 1000000000
    },
    "tags": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 30
      }
    },
    "safety_stock": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 1000000
    },
    "extra_categories": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 60
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "live",
        "hidden",
        "archived"
      ]
    },
    "video_url": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2048
    },
    "video_poster_url": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2048
    },
    "allow_backorder": {
      "type": "boolean"
    },
    "backorder_cap": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 100000
    },
    "restock_eta": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "/^\\d{4}-\\d{2}-\\d{2}$/"
        },
        {
          "const": "",
          "type": "string"
        }
      ],
      "nullable": true
    },
    "variants": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 120
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 60
          },
          "option_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "option_value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "option2_name": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 40
          },
          "option2_value": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 60
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1000000000
          },
          "compare_at_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1000000000
          },
          "stock": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "position": {
            "type": "integer",
            "minimum": -1000000,
            "maximum": 1000000
          },
          "is_active": {
            "type": "boolean"
          },
          "gtin": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 0,
            "maxLength": 40
          },
          "weight_grams": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 500000
          },
          "ship_length_mm": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 5000000
          },
          "ship_width_mm": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 5000000
          },
          "ship_height_mm": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 5000000
          }
        },
        "required": [
          "option_name",
          "option_value"
        ]
      }
    },
    "variants_mode": {
      "type": "string",
      "enum": [
        "merge",
        "replace"
      ]
    }
  },
  "required": []
}