Coverage
Content
All the web services should be HTTP REST. It’s expected that the web service response uses the status codes specification depending if the request was successful or not.
POST service_url/coverageImportant:
OAuth 2.0 will be used for secure authorizations.
Formato Request
Inside the body of the request a JSON will be sent with the following attributes:
| Name | Data type | Description | Type |
|---|---|---|---|
| service_type | String | Identifier of the service for which coverage will be consulted. | Mandatory |
| direction | String | Indicates the direction in which the coverage will be consulted:
| Mandatory |
Formato Response
Zip_code
Inside the body, the system will return the list of all the zip_code ranges that it has as coverage for a service at a certain address:
Important:
The countries that must support the Zip_code coverage service are: Argentina, Brasil, Mexico.
| Name | Data type | Description | Type |
|---|---|---|---|
| service_type | String | Identifier of the service for which coverage will be consulted. | Mandatory |
| direction | String | Indicates the meaning to which the coverage refers | Mandatory |
| coverage | Array | Array containing n arrays with the zip_code coverage ranges, the first being the "from" range and the second being the "to" ranges corresponding to each array, both of type Numeric | Mandatory |
Cities
Inside the body, the system will return the list of all the cities with their respective data:
Important:
The countries that must support the CityCity coverage service are, Colombia, Ecuador, Perú, Uruguay.
| Name | Data type | Description | Type |
|---|---|---|---|
| service_type | String | Identifier of the service for which coverage will be consulted. | Mandatory |
| direction | String | Indicates the meaning to which the coverage refers | Mandatory |
| country_id | String | Unique identifier that Mercado Libre gives the country in ISO 3166 Format. | Mandatory |
| country_name | String | Country name. | Mandatory |
| coverage | Array | Contains information related to coverage by city. | Mandatory |
| coverage.city_id | String | Unique city identifier provided by Mercado Libre. | Mandatory |
| coverage.city_name | String | City name. | Mandatory |
| coverage.state.id | String | Unique state identifier provided by Mercado Libre. Format ISO 3166. | Mandatory |
| coverage.state.name | String | State name. | Mandatory |
Status Codes
| Status | HTTP code | Description |
|---|---|---|
| SUCCESS | 200 | The authorization was successfully processed. |
| FAILED | 400 | The authorization was not able to be processed due to an error on the request. It’s expected to return status=FAILED with the status_message specifying the error cause. |
| ERROR | 500 | Any server side error. In this case status and status_message are optional. |
Ejemplos
Request:
POST https://hostName/coverage{
"service_type": "a_domicilio",
"direction": "origin"
}Response:
Success Zip_code (200 OK)
{
"service_type": "heavy_and_bulky",
"direction": "origin",
"coverage": [
[
1000,
1001
],
[
2000,
2010
],
[
3000,
3002
],
[
4000,
4004
],
[
5000,
5001
]
]
}Success Cities (200 OK)
{
"service_type": "a_sucursal",
"direction": "destination",
"country_id": "AR",
"country_name": "Argentina",
"coverage": [
{
"city_id": "QVItWE9uY2F0aXZv",
"city_name": "Oncativo",
"state_id": "AR-X",
"state_name": "Córdoba"
},{
"city_id": "TUxBQ1LNTzc4N2Fm",
"city_name": "Río Cuarto",
"state_id": "AR-X",
"state_name": "Córdoba"
},{
"city_id": "QVItWEplc8O6cyBNYXLDrWE",
"city_name": "Jesús María",
"state_id": "AR-X",
"state_name": "Córdoba"
},{
"city_id": "QVItWExhIENhbGVyYQ",
"city_name": "La Calera",
"state_id": "AR-X",
"state_name": "Córdoba"
}
]
}Failed (400 FAILED)
{
"status": "FAILED",
"status_message":"Missing service_type"
}Error (500 ERROR)
{
"status": "ERROR",
"status_message":"Internal server error"
}