Mercado Envíos Flex
Contents
→Set up a test user →Consult seller settings →Determine delivery time and shipping limit →Expand your coverage area →Consult Flex in the item →Activate Flex in the item →Deactivate Flex in the item
Set up a test user
To configure test users you must activate it internally using the cust_id. The cust_id has to be configured with the shipping address according to the coverage areas in the countries:
- To MLC: you must configure a city, for example: Lo Barnechea.
- To MLA: you must configure an address of the Buenos Aires city (CABA).
- To MCO: you must configure an Bogota´s neighborhood.
- To MLB: you must configure for an address with Flex coverage, according to some examples of CEPs: São Paulo Central: 01401000 Oeste: 05002070 Este: 03424010 Norte: 02308000 Sur1: 04342011 Sur2: 04866100
- To MLU: you must configure for an address to Montevideo or Canelones.
Consult seller settings
Through this endpoint you can request the seller's configuration to verify if it is active with Mercado Envíos Flex. It is a GET (to obtain the information) but it ends up being a POST because it requires a query with the cust_id.
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/shipping/selfservice/configuration
Example:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/shipping/selfservice/configuration
{
"query": "{ configuration(user_id: 534720659){ adoption{ service_id status creation_date last_update penalty_status recover_date delivery_window } address{ id address_line zip_code city{ id name } } capacity{ availables selected current_count } cutoff{ availables{ value unit } selected{ value unit } } training_time{ activation_date offset{ value unit } } zones{ id label price{ cents currency_id decimal_separator fraction symbol } is_mandatory selected } }}"
}
Response:
{
"configuration": {
"address": {
"address_line": "Avenida Brigadeiro Luís Antônio - de 2253 a 3139 - lado ímpar 50",
"city": {
"id": "BR-SP-44",
"name": "São Paulo"
},
"id": 1091302682,
"zip_code": "01401000"
},
"adoption": {
"creation_date": "2020-03-10T15:43:36-03:00",
"delivery_window": "same_day",
"last_update": "2020-03-11T09:43:38-03:00",
"penalty_status": "",
"recover_date": "0001-01-01T00:00:00Z",
"service_id": 214241,
"status": "in"
},
"capacity": {
"availables": [
0,
10,
20,
30,
40,
60,
80,
100
],
"current_count": 0,
"selected": 100
},
"cutoff": {
"availables": [
{
"unit": "HOUR",
"value": 12
},
{
"unit": "HOUR",
"value": 13
},
{
"unit": "HOUR",
"value": 14
},
{
"unit": "HOUR",
"value": 15
},
{
"unit": "HOUR",
"value": 16
},
{
"unit": "HOUR",
"value": 17
},
{
"unit": "HOUR",
"value": 18
}
],
"selected": {
"unit": "HOUR",
"value": 18
}
},
"training_time": {
"activation_date": "2020-03-10T00:00:00.000Z",
"unit": "DAY",
"value": 7
},
"zones": [
{
"id": "BR-SP-Centro",
"is_mandatory": false,
"label": "Centro",
"polygon": {
"properties": {
"name": "Centro"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "8",
"symbol": "R$"
},
"selected": true
},
{
"id": "BR-SP-Leste-1",
"is_mandatory": false,
"label": "Leste 1",
"polygon": {
"properties": {
"name": "Leste 1"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "13",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Leste-2",
"is_mandatory": false,
"label": "Leste 2",
"polygon": {
"properties": {
"name": "Leste 2"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "15",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Leste-3",
"is_mandatory": false,
"label": "Leste 3",
"polygon": {
"properties": {
"name": "Leste 3"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "15",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Leste-4",
"is_mandatory": false,
"label": "Leste 4",
"polygon": {
"properties": {
"name": "Leste 4"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "15",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Leste-5",
"is_mandatory": false,
"label": "Leste 5",
"polygon": {
"properties": {
"name": "Leste 5"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "15",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Norte-1",
"is_mandatory": false,
"label": "Norte 1",
"polygon": {
"properties": {
"name": "Norte 1"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "13",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Norte-2",
"is_mandatory": false,
"label": "Norte 2",
"polygon": {
"properties": {
"name": "Norte 2"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "13",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Norte-3",
"is_mandatory": false,
"label": "Norte 3",
"polygon": {
"properties": {
"name": "Norte 3"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "15",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Oeste-1",
"is_mandatory": false,
"label": "Oeste 1",
"polygon": {
"properties": {
"name": "Oeste 1"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "13",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Oeste-2",
"is_mandatory": false,
"label": "Oeste 2",
"polygon": {
"properties": {
"name": "Oeste 2"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "15",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Oeste-3",
"is_mandatory": false,
"label": "Oeste 3",
"polygon": {
"properties": {
"name": "Oeste 3"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "13",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Sul-1",
"is_mandatory": false,
"label": "Sul 1",
"polygon": {
"properties": {
"name": "Sul 1"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "13",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Sul-2",
"is_mandatory": false,
"label": "Sul 2",
"polygon": {
"properties": {
"name": "Sul 2"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "13",
"symbol": "R$"
},
"selected": false
},
{
"id": "BR-SP-Sul-3",
"is_mandatory": false,
"label": "Sul 3",
"polygon": {
"properties": {
"name": "Sul 3"
}
},
"price": {
"cents": "90",
"currency_id": "BRL",
"decimal_separator": ".",
"fraction": "15",
"symbol": "R$"
},
"selected": false
}
]
}
}
You can also check the coordinate locations of the map through a geojson. In this case, the query could be executed like this in the zones attribute:
zones{ id label polygon{ type geometry{ type coordinates } properties{ name } }
Response:
{
"id": "BR-SP-Sul-1",
"is_mandatory": false,
"label": "Sul 1",
"polygon": {
"geometry": {
"coordinates": [
[
[
-46.687368,
-23.6263235
],
]
…………..
Determine delivery time and shipping limit
This feature allows you to configure up to what time you offer same day shipments. You can also choose to offer shipments only the next day. After the configured time, you will offer shipments on the next business day.
Set the number of shipments with Mercado Envíos Flex that the seller can offer per day in their listings. Upon reaching the limit, fast shipments will not be visible in your posts.
Expected parameters:
delivery_window (required): determines if the user chose to make deliveries on the day (we consider business days) or not, it can be one of the following:
- same_day: the user chooses to deliver on the day.
- next_day: the user chooses to deliver the next day.
cutoff: indicates the time limit for receiving orders to be shipped on the same day. If the user chose "next_day" in delivery_window, the cutoff may be not empty. Possible values: 12 / 13 / 14 / 15 / 16 / 17 / 18.
capacity: maximum capacity per day selected by the seller, it can be empty since there is no need to update. Possible values: 10 / 20 / 30 / 40 / 60 / 80 / 100 / 0 (indicates that "more than 100").
Request:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$USER_ID/shipping/selfservice/adoption
Example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/534720659/shipping/selfservice/adoption
{
"delivery_window": "same_day",
"cutoff": 12,
"capacity": 20
}
Response:
{
"user_id": 534720659,
"service_id": 214241,
"status": "pending",
"penalty_status": null,
"delivery_window": "same_day",
"cutoff": 12,
"capacity": 20,
"training_time": {
"offset": {
"value": 0,
"unit": "DAY"
},
"activation_date": "2020-03-10T00:00:00.000Z"
},
"creation_date": "2020-03-10T15:43:36-03:00",
"last_update": "2020-03-10T15:44:36-03:00",
"recover_date": null,
"site_id": "MLB",
"is_test": true
}
Expand your coverage area
This endpoint allows you to configure the regions where the seller wants to deliver with Mercado Envíos Flex.
Here it is necessary to send the zones that you want to add and also those that were already there, otherwise they will be eliminated.
By consulting the seller configuration, it is possible to obtain the zones released by Mercado Libre to be chosen by the seller.
Request:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$user_id/shipping/selfservice/coverage/zones
Example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/534720659/shipping/selfservice/coverage/zones
["BR-SP-Sul-2"]
Response:
[
{
"service_id": 214241,
"zones": [
"BR-SP-Sul-2"
]
}
]
Consult Flex in the item
This endpoint allows you to see if the item is enabled for Mercado Envíos Flex or not.
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/sites/$SITE_ID/shipping/selfservice/items/$ITEM_ID
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/sites/MLB/shipping/selfservice/items/MLB1493119403
Response:
Status: 204 No Content
Possible responses:
204 - No Content: the item offers Flex.
403 - Forbidden: the site is disabled for Flex.
404 - Not Found: the item does not offer Flex or not exist.
message: item down: the item does not offer Flex.
message: item not found: the item was not found.
It is also possible to verify if the item is activated with Flex or not through the /items resource, in the tags:
self_service_out: ítem not active
self_service_in: ítem active
Activate Flex in the item
This endpoint allows activating the Flex option in the item.
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/sites/$SITE_ID/shipping/selfservice/items/$ITEM_ID
Example:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/sites/MLB/shipping/selfservice/items/MLB1493119403
Response:
Status: 204 No Content
Possible responses;
204 - No Content: the item was successfully updated to offer Flex.
400 - Bad Request: item is already in Flex.
403 - Forbidden: the site is disabled for Flex.
404 - Not Found: the item does not exist.
Deactivate Flex in the item
This endpoint allows you to deactivate the Flex option in the item.
Request:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/sites/$SITE_ID/shipping/selfservice/items/$ITEM_ID
Example:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/sites/MLB/shipping/selfservice/items/MLB1493119403
Response:
Status: 204 No Content
Possible responses:
204 - No Content: the item was successfully updated to stop offering Flex.
400 - Bad Request: item is not in Flex.
403 - Forbidden: the site is disabled for Flex.
404 - Not Found: the item does not exist.