New improvement: Bulk sale to “ceramicas” and “porcelanatos” categories! – Only for MLA

2 January 2016


Introduction

We are working to improve the publications in “ceramicas” and “porcelanatos” categories (only MLA for now). To accomplish that now we allow Bulk sale in those categories.

¿What we change?

  • You can specify if your product is sold by boxes, packages, pallets, units or m2 through SALES_UNIT attribute, and what it’s their yield with YIELD_OF_SALES_UNIT.
  • We add a new section to you can add more detail for products. You can add measures, thicknesses, model and other features.
  • All those information is exhibited in your Item publication and your customers can know what they will buy exactly.

Those attributes will be NOT REQUIRED! You can publish normally without them but we recommend you to use those attributes to improve the functionality of bulk sale inside your items.

Before to continue check the new attribute type number_unit which is mostly used in bulk sale.

¿How to create or update an item with those attributes?

Simply, you have to add the attributes into a common POST or PUT call. Here some examples:

Possible values to bulk feature

Possible values are displayed into category through the following call:

curl https://api.mercadolibre.com/categories/$category_id/attributes

Example:

curl https://api.mercadolibre.com/categories/MLA321215/attributes

Response:

[
  …
{
    "id": "SALES_UNIT",
    "name": "Unidad de venta",
    "value_type": "list",
    "tags": {
    },
    "values": [
      {
        "id": "121602",
        "name": "Unidad"
      },
      {
        "id": "121604",
        "name": "Caja"
      },
      {
        "id": "121605",
        "name": "Pallet"
      },
      {
        "id": "145190",
        "name": "m²"
      }
    ],
    "attribute_group_id": "DFLT",
    "attribute_group_name": "Otros"
  },
  {
    "id": "YIELD_OF_SALES_UNIT",
    "name": "Rendimiento",
    "value_type": "number_unit",
    "tags": {
    },
    "allowed_units": [
      {
        "id": "m²",
        "name": "m²"
      }
    ],
    "attribute_group_id": "DFLT",
    "attribute_group_name": "Otros"
  },
  {
    "id": "WEIGHT_OF_SALES_UNIT",
    "name": "Peso",
    "value_type": "number_unit",
    "tags": {
    },
    "allowed_units": [
      {
        "id": "g",
        "name": "g"
      },
      {
        "id": "kg",
        "name": "kg"
      }
    ],
    "attribute_group_id": "DFLT",
    "attribute_group_name": "Otros"
  },
    ...
]


Attribute example – POST item with bulk attributes

 curl -X POST 'https://api.mercadolibre.com/items?access_token=$access_token' -d '
{
	"site_id": "MLA",
	"title": "test bulk item",
	"seller_custom_field": null,
	"category_id": "MLA14559",
	"price": 100,
	"currency_id": "ARS",
	"buying_mode": "buy_it_now",
	"listing_type_id": "free",
	"condition": "new",
	"warranty": null,
	"available_quantity": 1,
	"video_id": null,
	"pictures": [],
	"accepts_mercadopago": false,
	"official_store_id": null,
	"non_mercado_pago_payment_methods": [],
	"shipping": {
		"local_pick_up": true,
		"free_shipping": false,
		"costs": []
	},
	"attributes": [{
		"id": "SALES_UNIT",
		"value_id": "121604"
	}, {
		"id": "YIELD_OF_SALES_UNIT",
		"value_name": "4 m²"
	}, {
		"id": "SIDE_A",
		"value_name": "12 cm"
	}, {
		"id": "SIDE_B",
		"value_name": "12 cm"
	}, {
		"id": "THICKNESS",
		"value_name": "2 mm"
	}, {
		"id": "WEIGHT_OF_SALES_UNIT",
		"value_name": "3 kg"
	}, {
		"id": "FINISH",
		"value_name": "bicelado"
	}],
	"automatic_relist": false,
	"description": {
		"text": "

item de test<\/p>", "plain_text": null } }'


Attributes type: number_unit

There is a new attribute called “number_unit”. The “value_name” of the attribute must be a number followed by the corresponding unit. For example “1.33 cm”.
This attribute type has the field “allowed_units” which enumerate the units that are allowed.

Example:

Attribute example – PUT item

curl -X PUT 'https://api.mercadolibre.com/items/$item_id?access_token=$access_token' -d '
{"attributes" : [{"id": "YIELD_OF_SALES_UNIT", "value_name": "5.34 cm"}]}'


Add invalid attribute example – PUT item

In case we add an invalid “value_name” the attribute is discarded and a error message is shown inside “warnings” but doesn’t interrupt the creation or modification of the item.

Example:

curl -X PUT 'https://api.mercadolibre.com/items/$item_id?access_token=$access_token' -d '{"attributes" : [{"id": "YIELD_OF_SALES_UNIT", "value_name": "2.22 z"}, {"id": "SALES_UNIT", "value_id": "121604"}]}'

Response:

{
	"id": "MLA604016753",
	...
	"attributes": [{ "id": "SALES_UNIT", "name": "Unidad de venta", "value_id": "121604", "value_name": "Caja", "attribute_group_id": "DFLT", "attribute_group_name": "Otros" }],
	"warnings": [{
		"code": "item.attributes.omitted",
		"message": "Attribute YIELD_OF_SALES_UNIT with value 2.22 z was omitted. You can use a number followed by one of these valid units: [m2]."
	}],
	...
}


Empty value example – PUT item

curl -X PUT 'https://api.mercadolibre.com/items/$item_id?access_token=$access_token' -d '{"attributes" : [{"id": "YIELD_OF_SALES_UNIT", "value_name": ""}]}'