Skip to content

Product

Request

Actualiza un producto buscado su id.
Envía máximo 3 opciones.

Comportamiento de actualización parcial

Este endpoint soporta actualizaciones parciales (partial updates):

  • Si no envías los keys "options" ni "variants", las variantes existentes se preservan.
  • Si envías "options": [] o "variants": [], las variantes existentes también se preservan (no se eliminan por omisión).
  • Si envías nuevas opciones o variantes, estas se agregan a las existentes sin eliminar las anteriores.

Ejemplos

Actualizar solo precio y título (preserva variantes):

{ "product": { "title": "Nuevo título", "price": 29.99 } } Agregar nueva opción sin eliminar existentes: { "product": { "options": [ { "name": "Material", "values": ["Algodón", "Poliéster"] } ] } } Ejemplo completo de options: "options": [ { "name": "Talla", "values": ["SM", "LG", "XL", "MD"] }, { "name": "Color", "values": ["Red", "Blue"] } ] Para las variantes, combina los valores de las opciones.

Ejemplo completo de variants:

"variants": [ { "price": 12, "wholesale_price": 10, "sku": "VAR-001", "option1": "SM", "option2": "Red" }, { "price": 14, "wholesale_price": 10, "sku": "VAR-002", "option1": "LG", "option2": "Red" }, { "price": 25, "wholesale_price": 13, "sku": "VAR-003", "option1": "XL", "option2": "Blue" } ] Agregar nueva combinación sin eliminar existentes: { "product": { "options": [ { "name": "Talla", "values": ["SM", "LG", "XL", "XXL"] } ], "variants": [ { "option1": "XXL", "sku": "VAR-XXL", "price": 35, "quantity": 10 } ] } } operationId: updateProduct

Security
api-key
Bodyapplication/json
productobject
curl -i -X PUT \
  https://mercately.shop/api/v1/products/web_id \
  -H 'Content-Type: application/json' \
  -H 'api-key: YOUR_API_KEY_HERE' \
  -d '{
    "product": {
      "title": "string",
      "description": "string",
      "sku": "string",
      "quantity": 0,
      "active": true,
      "price": 0,
      "subcategory_id": "string",
      "image_urls": [
        "string"
      ],
      "options": [
        {
          "name": "string",
          "values": [
            "string"
          ]
        }
      ],
      "variants": [
        {
          "price": 0,
          "wholesale_price": 0,
          "sku": "string",
          "quantity": 0,
          "image": "string",
          "variant_url": "string",
          "option1": "string",
          "option2": "string",
          "option3": "string"
        }
      ]
    }
  }'

Responses

OK

Bodyapplication/json
object
Response
{ "message": "Producto actualizado con éxito", "product": { "web_id": "FzOWVvUwbC", "title": "Product 001", "description": "Product 001", "quantity": 20, "price": "1.5", "active": true, "url": null, "sku": "p004", "wholesale_price": "0.0", "images": [ … ], "subcategory": { … }, "category": { … }, "product_variants": [ … ], "product_variant_combinations": [ … ] } }