Variantes

Es la entidad que almacena la información de precios e inventario. Cada producto contiene 1 variante master, y, opcionalmente, otras variantes dependiendo de su configuración.

Por ejemplo: una camiseta (producto) puede tener múltiples “tallas” (variantes) y cada variante puede tener un precio, inventario o imagen específica, aunque pertenezcan al mismo producto.

A través del uso de variantes se puede presentar a nivel visual (en la misma ficha de un producto) todas las opciones que tenga (los distintos colores, sabores, fragancias, etc. del mismo producto) para una experiencia de compra mejorada.

Importante: Para actualizar precio y cantidad disponible de un producto existente, es necesario hacerlo a través del endpoint de variantes, y no de productos.

Listado de variantes

GET https://tiendagoshop.com/api/v1/variants

Este endpoint permite obtener un listado de todas las variantes.

Query Parameters

NameTypeDescription

q[sku_cont]

string

Código del producto

q[stock_items_count_on_hand_gteq]

integer

Cantidad disponible desde.

q[stock_items_count_on_hand_lteq]

string

Cantidad disponible hasta.

q[prices_amount_gteq]

string

Precio desde.

q[prices_amount_lteq]

string

Precio hasta.

Headers

NameTypeDescription

X-Spree-Token

string

Token generado desde el CMS de GS

{
   "variants":[
      {
         "id":1,
         "name":"Falda",
         "sku":"8989",
         "price":"75.0",
         "weight":"0.0",
         "height":null,
         "width":null,
         "depth":null,
         "is_master":true,
         "slug":"falda",
         "description":"",
         "track_inventory":false,
         "cost_price":null,
         "gd_size_reference":"document",
         "decimal_quantity_step":"1.0",
         "option_values":[
            
         ],
         "images":[
            {
               "id":3,
               "position":1,
               "attachment_content_type":null,
               "attachment_file_name":null,
               "type":null,
               "attachment_updated_at":null,
               "attachment_width":null,
               "attachment_height":null,
               "alt":null,
               "viewable_type":"Spree::Variant",
               "viewable_id":1,
               "mini_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0c8e7cd4b909bdf46254222f7f97b497a258c4b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lMTkRoNE5EZytCam9HUlZRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--287509bb5ece367f385619285bf36046286f36c5/descarga%20(1).jpeg",
               "small_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0c8e7cd4b909bdf46254222f7f97b497a258c4b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTVRBd2VERXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--3c7340f630c4255b69a66e96d065d51f2542ab94/descarga%20(1).jpeg",
               "product_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0c8e7cd4b909bdf46254222f7f97b497a258c4b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpRd2VESTBNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--167c716279a1ce250cdc04c898a6a657d44fe6e1/descarga%20(1).jpeg",
               "large_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0c8e7cd4b909bdf46254222f7f97b497a258c4b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTmpBd2VEWXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--356569db9f82f37a355e1d956e758d6335fcb5fd/descarga%20(1).jpeg"
            }
         ],
         "display_price":"RD$ 75.00",
         "options_text":"",
         "in_stock":true,
         "is_backorderable":false,
         "is_orderable":true,
         "total_on_hand":null,
         "is_destroyed":false,
         "stock_items":[
            {
               "id":1,
               "count_on_hand":"0.0",
               "stock_location_id":1,
               "backorderable":false,
               "available":false,
               "stock_location_name":"Almacen 1"
            }
         ]
      },
      {
         "id":2,
         "name":"Zapatos",
         "sku":"8980",
         "price":"10.0",
         "weight":"0.0",
         "height":null,
         "width":null,
         "depth":null,
         "is_master":true,
         "slug":"zapatos",
         "description":"",
         "track_inventory":true,
         "cost_price":"100.0",
         "gd_size_reference":"document",
         "decimal_quantity_step":"1.0",
         "option_values":[
            
         ],
         "images":[
            {
               "id":4,
               "position":1,
               "attachment_content_type":null,
               "attachment_file_name":null,
               "type":null,
               "attachment_updated_at":null,
               "attachment_width":null,
               "attachment_height":null,
               "alt":null,
               "viewable_type":"Spree::Variant",
               "viewable_id":2,
               "mini_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--d30f2656c314b564cd6c1c51abb100e138bd25b5/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lMTkRoNE5EZytCam9HUlZRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--287509bb5ece367f385619285bf36046286f36c5/descarga.jpeg",
               "small_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--d30f2656c314b564cd6c1c51abb100e138bd25b5/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTVRBd2VERXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--3c7340f630c4255b69a66e96d065d51f2542ab94/descarga.jpeg",
               "product_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--d30f2656c314b564cd6c1c51abb100e138bd25b5/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpRd2VESTBNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--167c716279a1ce250cdc04c898a6a657d44fe6e1/descarga.jpeg",
               "large_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--d30f2656c314b564cd6c1c51abb100e138bd25b5/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTmpBd2VEWXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--356569db9f82f37a355e1d956e758d6335fcb5fd/descarga.jpeg"
            },
            {
               "id":5,
               "position":2,
               "attachment_content_type":null,
               "attachment_file_name":null,
               "type":null,
               "attachment_updated_at":null,
               "attachment_width":null,
               "attachment_height":null,
               "alt":null,
               "viewable_type":"Spree::Variant",
               "viewable_id":2,
               "mini_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bb8a4e61ac05d72b62b74f09c3808465f67a37b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lMTkRoNE5EZytCam9HUlZRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--287509bb5ece367f385619285bf36046286f36c5/descarga.jpeg",
               "small_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bb8a4e61ac05d72b62b74f09c3808465f67a37b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTVRBd2VERXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--3c7340f630c4255b69a66e96d065d51f2542ab94/descarga.jpeg",
               "product_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bb8a4e61ac05d72b62b74f09c3808465f67a37b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpRd2VESTBNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--167c716279a1ce250cdc04c898a6a657d44fe6e1/descarga.jpeg",
               "large_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bb8a4e61ac05d72b62b74f09c3808465f67a37b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTmpBd2VEWXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--356569db9f82f37a355e1d956e758d6335fcb5fd/descarga.jpeg"
            }
         ],
         "display_price":"RD$ 10.00",
         "options_text":"",
         "in_stock":false,
         "is_backorderable":false,
         "is_orderable":false,
         "total_on_hand":"0.0",
         "is_destroyed":false,
         "stock_items":[
            {
               "id":2,
               "count_on_hand":"0.0",
               "stock_location_id":1,
               "backorderable":false,
               "available":false,
               "stock_location_name":"Almacen 1"
            }
         ]
      },
      {
         "id":7,
         "name":"Camiseta 123",
         "sku":"DELETED_AT:1608209079:0589asd",
         "price":"500.0",
         "weight":"0.0",
         "height":null,
         "width":null,
         "depth":null,
         "is_master":false,
         "slug":"camiseta-123",
         "description":"Camiset 123 desc larga",
         "track_inventory":true,
         "cost_price":null,
         "gd_size_reference":"document",
         "decimal_quantity_step":"1.0",
         "option_values":[
            {
               "id":7,
               "name":"Rojo",
               "presentation":"Rojo",
               "option_type_name":"Color",
               "option_type_id":2,
               "option_type_presentation":"Color"
            },
            {
               "id":8,
               "name":"S",
               "presentation":"S",
               "option_type_name":"Talla",
               "option_type_id":1,
               "option_type_presentation":"Talla"
            }
         ],
         "images":[
            {
               "id":11,
               "position":1,
               "attachment_content_type":null,
               "attachment_file_name":null,
               "type":null,
               "attachment_updated_at":null,
               "attachment_width":null,
               "attachment_height":null,
               "alt":null,
               "viewable_type":"Spree::Variant",
               "viewable_id":7,
               "mini_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBHUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e60b1ca456c43b7087755408b22474752ae59a5c/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lMTkRoNE5EZytCam9HUlZRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--287509bb5ece367f385619285bf36046286f36c5/1a.jpg",
               "small_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBHUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e60b1ca456c43b7087755408b22474752ae59a5c/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTVRBd2VERXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--3c7340f630c4255b69a66e96d065d51f2542ab94/1a.jpg",
               "product_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBHUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e60b1ca456c43b7087755408b22474752ae59a5c/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpRd2VESTBNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--167c716279a1ce250cdc04c898a6a657d44fe6e1/1a.jpg",
               "large_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBHUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e60b1ca456c43b7087755408b22474752ae59a5c/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTmpBd2VEWXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--356569db9f82f37a355e1d956e758d6335fcb5fd/1a.jpg"
            },
            {
               "id":12,
               "position":2,
               "attachment_content_type":null,
               "attachment_file_name":null,
               "type":null,
               "attachment_updated_at":null,
               "attachment_width":null,
               "attachment_height":null,
               "alt":null,
               "viewable_type":"Spree::Variant",
               "viewable_id":7,
               "mini_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBHZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--f4de7f69e9ce6616d370f74d89490a41b3fbc340/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lMTkRoNE5EZytCam9HUlZRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--287509bb5ece367f385619285bf36046286f36c5/2a.jpg",
               "small_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBHZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--f4de7f69e9ce6616d370f74d89490a41b3fbc340/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTVRBd2VERXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--3c7340f630c4255b69a66e96d065d51f2542ab94/2a.jpg",
               "product_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBHZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--f4de7f69e9ce6616d370f74d89490a41b3fbc340/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpRd2VESTBNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--167c716279a1ce250cdc04c898a6a657d44fe6e1/2a.jpg",
               "large_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBHZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--f4de7f69e9ce6616d370f74d89490a41b3fbc340/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTmpBd2VEWXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--356569db9f82f37a355e1d956e758d6335fcb5fd/2a.jpg"
            }
         ],
         "display_price":"RD$ 500.00",
         "options_text":"S, Rojo",
         "in_stock":true,
         "is_backorderable":false,
         "is_orderable":true,
         "total_on_hand":"8.0",
         "is_destroyed":false,
         "stock_items":[
            {
               "id":7,
               "count_on_hand":"8.0",
               "stock_location_id":1,
               "backorderable":false,
               "available":true,
               "stock_location_name":"Almacen 1"
            }
         ]
   ],
   "count":3,
   "total_count":210,
   "current_page":1,
   "pages":1
}

Obtener una variante

GET https://tiendagoshop.com/api/v1/variants/:id

Este endpoint permite obtener una variante en específico.

Path Parameters

NameTypeDescription

id

integer

ID de la variante.

Headers

NameTypeDescription

X-Spree-Token

string

Token generado desde el CMS de GS

{
   "id":1,
   "name":"Falda",
   "sku":"8989",
   "price":"75.0",
   "weight":"0.0",
   "height":null,
   "width":null,
   "depth":null,
   "is_master":true,
   "slug":"falda",
   "description":"",
   "track_inventory":false,
   "cost_price":null,
   "gd_size_reference":"document",
   "decimal_quantity_step":"1.0",
   "option_values":[
      
   ],
   "images":[
      {
         "id":3,
         "position":1,
         "attachment_content_type":null,
         "attachment_file_name":null,
         "type":null,
         "attachment_updated_at":null,
         "attachment_width":null,
         "attachment_height":null,
         "alt":null,
         "viewable_type":"Spree::Variant",
         "viewable_id":1,
         "mini_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0c8e7cd4b909bdf46254222f7f97b497a258c4b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lMTkRoNE5EZytCam9HUlZRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--287509bb5ece367f385619285bf36046286f36c5/descarga%20(1).jpeg",
         "small_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0c8e7cd4b909bdf46254222f7f97b497a258c4b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTVRBd2VERXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--3c7340f630c4255b69a66e96d065d51f2542ab94/descarga%20(1).jpeg",
         "product_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0c8e7cd4b909bdf46254222f7f97b497a258c4b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpRd2VESTBNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--167c716279a1ce250cdc04c898a6a657d44fe6e1/descarga%20(1).jpeg",
         "large_url":"https://demonew.tiendagoshop.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0c8e7cd4b909bdf46254222f7f97b497a258c4b6/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTmpBd2VEWXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--356569db9f82f37a355e1d956e758d6335fcb5fd/descarga%20(1).jpeg"
      }
   ],
   "display_price":"RD$ 75.00",
   "options_text":"",
   "in_stock":true,
   "is_backorderable":false,
   "is_orderable":true,
   "total_on_hand":null,
   "is_destroyed":false,
   "stock_items":[
      {
         "id":1,
         "count_on_hand":"0.0",
         "stock_location_id":1,
         "backorderable":false,
         "available":false,
         "stock_location_name":"Almacen 1"
      }
   ]
}

Crear una variante

POST https://tiendagoshop.com/api/v1/variants

Este endpoint permite crear una variante nueva.

Headers

NameTypeDescription

X-Spree-Token

string

Token generado desde el CMS de GS

Request Body

NameTypeDescription

stock_items_attributes

array

Array de objetos con los siguientes parametros, stock_location_id(id del stock, integer), count_on_hand(cantidad del producto, integer) Ej. stock_items_attributes:[ { "stock_location_id": 1, "count_on_hand": 99 } ]

product_id

integer

ID del producto al que pertenece la variante.

options

array

Opciones de la variante. Por ejemplo: Color rojo. Los nombres de las opciones deben coincidir con las definidas en el producto (option_types). Array de objetos JSON con la siguiente estructura: [ { "name": "Talla", "value": "small" }, { "name": "Color", "value": "rojo" } ]

sku

string

Referencia / código interno único.

price

number

Precio. Si no se especifica, coge el precio del producto al que pertenece.

cost_price

number

Precio de lista.

gd_size_reference

string

Referencia de tamaño del paquete (para GoDelivery):

track_inventory

boolean

Controlar inventario.

fixed_stock

integer

Cantidad disponible en inventario. (deprecated) Ver stock_items_attributes

images

array

Imágenes de la variante. Array de objetos JSON con la siguiente estructura: [ { "remote_url": "http://dominio.com/images/1.png" } ]

tax_category_id

integer

ID del tipo de impuesto. 1 = ITBIS 18% 2 = ITBIS 16% 3 = Exento de ITBIS

prices_attributes

array

Array de objetos, donde cada objeto debe estar compuesto por : 1- amount, (Precio) 2- compare_at_amount, (Precio de lista) 3- currency, (Moneda) Ej: "prices_attributes": [ { "amount": 25, "compare_at_amount": 30, "currency": "USD" }, { "amount": 35, "compare_at_amount": 45, "currency": "DOP" } ] Observación: Solo aplica a multitiendas.

{
  "id": 76,
  "name": "Pantalón Slim Fit",
  "sku": "123ref",
  "price": "450.0",
  "weight": "0.0",
  "height": null,
  "width": null,
  "depth": null,
  "is_master": true,
  "slug": "pantalon-slim-fit",
  "description": null,
  "track_inventory": true,
  "cost_price": null,
  "gd_size_reference": "document",
  "option_values": [],
  "images": [],
  "display_price": "RD$ 450.00",
  "options_text": "",
  "in_stock": true,
  "is_backorderable": false,
  "is_orderable": true,
  "total_on_hand": "25.0",
  "is_destroyed": false,
  "stock_items": [
    {
      "id": 76,
      "count_on_hand": "25.0",
      "stock_location_id": 1,
      "backorderable": false,
      "available": true,
      "stock_location_name": "ramoncorripio"
    }
  ]
}

fixed_stock se encuentra obsoleto, favor utilizar stock_items_attributes

Modificar una variante

PUT https://tiendagoshop.com/api/v1/variants/:id

Este endpoint permite modificar una variante en específico.

Path Parameters

NameTypeDescription

id

integer

ID de la variante.

Headers

NameTypeDescription

X-Spree-Token

string

Token generado desde el CMS de GS

Request Body

NameTypeDescription

stock_items_attributes

array

Array de objetos con los siguientes parametros, stock_location_id(id del stock, integer), count_on_hand(cantidad del producto, integer) Ej. stock_items_attributes:[ { "stock_location_id": 1, "count_on_hand": 99 } ]

tax_category_id

integer

product_id

integer

ID del producto al que pertenece la variante.

options

array

Opciones de la variante. Por ejemplo: Color rojo. Los nombres de las opciones deben coincidir con las definidas en el producto (option_types). Array de objetos JSON con la siguiente estructura: [ { "name": "Talla", "value": "small" }, { "name": "Color", "value": "rojo" } ]

sku

string

Referencia / código interno único.

price

number

Precio. Si no se especifica, coge el precio del producto al que pertenece.

cost_price

number

Precio de lista.

gd_size_reference

string

Referencia de tamaño del paquete (para GoDelivery):

track_inventory

boolean

Controlar inventario.

fixed_stock

integer

Cantidad disponible en inventario. (Deprecated). Ver stock_items_attributes.

images

array

Imágenes de la variante.Array de objetos JSON con la siguiente estructura:[ { "remote_url": "http://dominio.com/images/1.png" } ]

{
  "id": 76,
  "name": "Pantalón Slim Fit",
  "sku": "123ref",
  "price": "450.0",
  "weight": "0.0",
  "height": null,
  "width": null,
  "depth": null,
  "is_master": true,
  "slug": "pantalon-slim-fit",
  "description": null,
  "track_inventory": true,
  "cost_price": null,
  "gd_size_reference": "document",
  "option_values": [],
  "images": [],
  "display_price": "RD$ 450.00",
  "options_text": "",
  "in_stock": true,
  "is_backorderable": false,
  "is_orderable": true,
  "total_on_hand": "25.0",
  "is_destroyed": false,
  "stock_items": [
    {
      "id": 76,
      "count_on_hand": "25.0",
      "stock_location_id": 1,
      "backorderable": false,
      "available": true,
      "stock_location_name": "ramoncorripio"
    }
  ]
}

fixed_stock se encuentra obsoleto, favor utiliza stock_items_attributes

Eliminar una variante

DELETE https://tiendagoshop.com/api/v1/variants/:id

Este endpoint permite eliminar una variante específico.

Path Parameters

NameTypeDescription

id

integer

ID de la variante

Headers

NameTypeDescription

X-Spree-Token

string

Token generado desde el CMS de GS

Última actualización