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/coverage
Important:
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:

NameData typeDescriptionType
service_typeStringIdentifier of the service for which coverage will be consulted.Mandatory
directionStringIndicates the direction in which the coverage will be consulted:
  • origin
  • destination
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.
NameData typeDescriptionType
service_typeStringIdentifier of the service for which coverage will be consulted.Mandatory
directionStringIndicates the meaning to which the coverage refersMandatory
coverageArrayArray 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 NumericMandatory

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.
NameData typeDescriptionType
service_typeStringIdentifier of the service for which coverage will be consulted.Mandatory
directionStringIndicates the meaning to which the coverage refersMandatory
country_idStringUnique identifier that Mercado Libre gives the country in ISO 3166 Format.Mandatory
country_nameStringCountry name.Mandatory
coverageArrayContains information related to coverage by city.Mandatory
coverage.city_idStringUnique city identifier provided by Mercado Libre.Mandatory
coverage.city_nameStringCity name.Mandatory
coverage.state.idStringUnique state identifier provided by Mercado Libre. Format ISO 3166.Mandatory
coverage.state.nameStringState name.Mandatory

Status Codes

StatusHTTP codeDescription
SUCCESS200The authorization was successfully processed.
FAILED400The 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.
ERROR500Any 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"
}