Compatibility between items and vehicle accessories
Contents
→Check cross domain compatibility
→Count products from a domain
→Associate compatibilities
↳By product
↳By product domain
↳By product and domain product
→List compatibilities
↳Get all compatibilities for an item
↳Get a specific compatibility of an item by its id
→Delete compatibilities
Check cross domain compatibility
Before creating compatibility between items and products, you should check that the item and product domains are compatible.
By consulting the next dump, you obtain compatibility for each domain per site.
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' http://api.mercadolibre.com/catalog/dumps/domains/$SITE_ID/compatibilities
Response:
[
{
"domain_id":"$domain_id",
"compatibilities":[
{
"compatible_domain_id":"$domain_id"
},
{
"compatible_domain_id":"$domain_id"
}
]
},
{
"domain_id":"$domain_id",
"compatibilities":[
{
"compatible_domain_id":"$domain_id"
},
{
"compatible_domain_id":"$domain_id"
}
]
}
]
Request example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog/dumps/domains/MLA/compatibilities
Response example:
[
{
"domain_id": "MLA-AUTOMOTIVE_SHOCK_ABSORBERS",
"compatibilities": [
{
"compatible_domain_id": "MLA-CARS_AND_VANS"
}
]
}
]
Get more information about Domains, products and attributes vehicle accessories references.
Count products from a domain
To check the number of existing products per domain (product family) that meet certain attributes and values, you can perform the following POST. This will allow you to validate, prior to associating the compatibilities, the number of products and avoid errors in the assignment of compatibilities.
This is important as only a maximum of 200 products can be assigned per request.
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_compatibilities/products_search/count_family_products
{
"domain_id": "$domainId",
"attributes": [{
"id": "$attributeId1",
"value_id": "$valueId1"
}, {
"id": "$attributeId2",
"value_name": "$valueName2"
}]
}
Example:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_compatibilities/products_search/count_family_products
{
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"attributes": [{
"id": "BRAND",
"value_name": "Volkswagen"
},
{
"id": "CAR_AND_VAN_MODEL",
"value_name": "VENTO"
}
]
}
Response:
{
"count":141
}
Associate compatibilities
To associate compatibility of an item with a product and / or domain, you can check up to a maximum of 200 products per request (including those defined in the domains) and do it in 3 different ways:
- By product: To add new compatibility to an item, you must send the compatibility you want to add. It is not necessary to send existing ones to keep current ones.
- By product domain: you can specify a set of attributes that define the product domain. For each domain, you must specify its domain and for each attribute, a value made up of id and / or name.
- By product and domain: You can associate compatibility with a published item of another product and a product domain, that is, it allows you to associate the first 2 together.
Associate by product
To associate compatibility with one or more individual products, you can use the Catalog product search.
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$ITEM_ID/compatibilities
{
"products":[
{
"id":"$productId1"
},
{
"id":"$productId2"
}
]
}
Example:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLM794706391/compatibilities
{
"products":[
{
"id":"MLM15847274"
}
]
}
Response:
{
"products": [{
"id": "d8b9af3b-1b36-096d-a0bf-4b0fb19085f8",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"catalog_product_id": "MLM15847274",
"catalog_product_name": "Ford Crown Victoria 2001 Police Interceptor",
"source": "SELLER",
"restrictions": []
}],
"items": []
}
Associate by product domain
To associate compatibilities defined by a group of attributes that determine a domain, learn more about vehicle accessories domains and attributes.
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$item_id/compatibilities
{
"products_families": [{
"domain_id": "$domainId",
"attributes": [{
"id": "$attributeId1",
"value_id": "$valueId1"
}, {
"id": "$attributeId2",
"value_name": "$valueName2"
}]
}]
}
Example (except MLM):
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLA794706391/compatibilities
{
"products_families": [{
"domain_id": "MLA-CARS_AND_VANS",
"attributes": [{
"id": "BRAND",
"value_id": "60249"
},
{
"id": "VEHICLE_YEAR",
"value_id": "6730991"
},
{
"id": "MODEL",
"value_id": "1252874"
},
{
"id": "TRIM",
"value_id": "2228234"
}
]
}]
}
Response:
{
"products": [{
"id": "4cb9af35-8e9b-ebfd-9e7f-2245ac363d10",
"domain_id": "MLA-CARS_AND_VANS",
"catalog_product_id": "MLA15863808",
"catalog_product_name": "Volkswagen Gol Sedan 2010 Comfortline",
"source": "SELLER",
"restrictions": []
},
{
"id": "c2b9af35-8e78-f34f-ef71-30bb11af0742",
"domain_id": "MLA-CARS_AND_VANS",
"catalog_product_id": "MLA15856472",
"catalog_product_name": "Chrysler Cirrus 2010 Touring",
"source": "SELLER",
"restrictions": []
}
],
"items": []
}
Example MLM:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLM794706391/compatibilities
{
"products_families": [
{
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"attributes": [
{
"id": "DRIVE_TYPE",
"value_id": "8182649"
},
{
"id": "CAR_AND_VAN_BODY_TYPE",
"value_id": "8183109"
},
{
"id": "YEAR",
"value_name": "2010"
}
]
}
]
}
Response:
{
"products": [
{
"id": "4cb9af35-8e9b-ebfd-9e7f-2245ac363d10",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"catalog_product_id": "MLM15863808",
"catalog_product_name": "Volkswagen Gol Sedan 2010 Comfortline",
"source": "SELLER",
"restrictions": []
},
{
"id": "c2b9af35-8e78-f34f-ef71-30bb11af0742",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"catalog_product_id": "MLM15856472",
"catalog_product_name": "Chrysler Cirrus 2010 Touring",
"source": "SELLER",
"restrictions": []
}
],
"items": []
}
Associate by product and domain product
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$item_id/compatibilities
{
"products": [{
"id": "$productId1"
}, {
"id": "$productId2"
}],
"products_families": [{
"domain_id": "$domainId",
"attributes": [{
"id": "$attributeId1",
"value_id": "$valueId1"
},
{
"id": "$attributeId2",
"value_name": "$valueName2"
}
]
}]
}
Example:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLM794706391/compatibilities
{
"products": [{
"id": "MLM15847274"
}],
"products_families": [{
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"attributes": [{
"id": "DRIVE_TYPE",
"value_id": "8182649"
},
{
"id": "CAR_AND_VAN_BODY_TYPE",
"value_id": "8183109"
},
{
"id": "YEAR",
"value_name": "2010"
}
]
}]
}
Response:
{
"products": [{
"id": "48af8178-50ce-971a-fc41-8c9a954cea62",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"catalog_product_id": "MLA123254432",
"catalog_product_name": "Producto 1",
"source": "SELLER",
"restrictions": [
]
},
{
"id": "8abae1a7-9ced-411e-93d6-df6173c7f5fe",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"catalog_product_id": "MLA123254551",
"catalog_product_name": "Producto 2",
"source": "SELLER",
"restrictions": [
]
}
]
}
Possible errors
400: consistency validations:
- Required fields are incomplete.
- The format of the ids is wrong.
- More than 200 products were found and / or specified for the product domains.
- More than 10 product domains were specified.
- The products and / or domains do not belong to the same site as the item.
- The products must all be children.
- The item's domain is compatible with the specified product domains and / or with the specified domains in the specified product domains.
403: Invalid token or lack of permissions on the item.
404: the specified item, products or domains do not exist.
List compatibilities
With this resource, you can list all the compatibilities for a particular item, where the products attribute contains the seller´s compatibilities and the catalog_compatibilities_count attribute has the number of compatibilities from the Mercado Libre catalog, that is, the latter compatibility will not be listed due to limitations in intellectual property licenses.
Get all compatibilities for an item
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$ITEM_ID/compatibilities
Request example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLM794706391/compatibilities
Response example:
{
"products": [{
"id": "48af8178-50ce-971a-fc41-8c9a954cea62",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"catalog_product_id": "MLA123254432",
"catalog_product_name": "Producto 1",
"source": "SELLER",
"restrictions": []
},
{
"id": "8abae1a7-9ced-411e-93d6-df6173c7f5fe",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"catalog_product_id": "MLA123254551",
"catalog_product_name": "Producto 2",
"source": "SELLER",
"restrictions": [
]
}
],
"catalog_compatibilities_count": 15
}
Get a specific compatibility of an item by its id
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$ITEM_ID/compatibilities/$compatibility_id
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLM794706391/compatibilities/$compatibility_id
Response:
{
"id": "8abae1a7-9ced-411e-93d6-df6173c7f5fe",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"catalog_product_id": "MLM123254551",
"catalog_product_name": "Producto 2",
"source": "SELLER",
"restrictions": []
}
A 404 error means that the item does not exist.
Delete compatibilities
In case of having associated an incorrect compatibility with the item, you can eliminate it as long as it has been made by the seller.
Delete a specific compatibility for the indicated item
Request:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$ITEM_ID/compatibilities/$COMPATIBILITY_ID
Example:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLM794706391/compatibilities/4cb9af35-8e9b-ebfd-9e7f-2245ac363d10
La respuesta será un http 200.
Delete compatibilities for an item
Request:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$ITEM_ID/compatibilities
Example:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLM794706391/compatibilities
Response:
{
"deleted_compatibilities": [
"d0ba2aeb-7409-0037-7b23-0b91266fd00e",
"72ba233d-16d8-218b-4062-7a97dab166c8"
]
}
Delete compatibilities by product domain for an item
Request:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$ITEM_ID/compatibilities
{
"products_families": [{
"domain_id": "$domain_id",
"attributes": [{
"id": "$attribute_id1",
"values":[{
"id": "$value_id1",
"name": "$value_name1"
}]
},{
"id": "$attribute_id2",
"values":[{
"id": "$value_id1",
"name": "$value_name1"
}]
}]
}]
}
Example:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MLM794706391/compatibilities
{
"products_families": [{
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"attributes": [{
"id": "DRIVE_TYPE",
"value_id": "8182649"
},
{
"id": "CAR_AND_VAN_BODY_TYPE",
"value_id": "8183109"
},
{
"id": "YEAR",
"value_name": "2010"
}]
}]
}
Response:
{
"deleted_compatibilities": [
"d0ba2aeb-7409-0037-7b23-0b91266fd00e",
"72ba233d-16d8-218b-4062-7a97dab166c8"
]
}
Possible errors
400: Incorrect format / more than 200 products for the domain / more than 10 domains specified.
403: inválid token or lack of permits on the ítem.
404: the ítem or the compatibility not exist.