Coverage
Introduction
Remember that the carrier's Web Service must provide an HTTP REST endpoint against which Mercado Libre can query the current coverage status that carriers have available.
bash1POST service_url/coverage
Important: For security in authorizations, OAuth 2.0 will be used.
Request Format
Within the body, a JSON object will be sent with the fields listed below:
Name | Data Type | Description | Type |
|---|---|---|---|
| service_type | String | Service identifier for which coverage will be queried. | Mandatory |
| direction | String | Indicates the direction in which coverage will be queried: • origin • destination | Mandatory |
Response Format
Zip_code
Within the body, the system will return the list of all ZIP code ranges that it has as coverage for a service at a specific address:
Important: The countries that must support the coverage service by Zip_code are: Argentina, Brazil, Mexico.
Name | Data Type | Description | Type |
|---|---|---|---|
| service_type | String | Service identifier for which coverage will be queried. | 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" interval and the second being the "to" intervals corresponding to each array, both of Numeric type. | Mandatory |
Cities
Within the body, the system will return the list of all cities with their respective data:
Important: The countries that must support the coverage service by City are: Chile, Colombia, Ecuador, Peru, Uruguay.
Name | Data Type | Description | Type |
|---|---|---|---|
| service_type | String | Service identifier for which coverage will be queried. | Mandatory |
| direction | String | Indicates the meaning to which the coverage refers. | Mandatory |
| country_id | String | Unique identifier assigned by Mercado Libre to the country in ISO 3166 format. | Mandatory |
| country_name | String | Name of the country. | Mandatory |
| coverage | Array | Contains information related to city coverage. | Mandatory |
| coverage.city_id | String | Unique identifier assigned by Mercado Libre to the city. | Mandatory |
| coverage.city_name | String | Name of the city. | Mandatory |
| coverage.state_id | String | Unique identifier assigned by Mercado Libre to the state in ISO 3166 format. | Mandatory |
| coverage.state_name | String | Name of the state. | Mandatory |
Status Codes
Status | HTTP Code | Description |
|---|---|---|
| SUCCESS | 200 | When the request was successfully processed. |
| FAILED | 400 | When the request could not be processed due to a request error. "status": "FAILED" is expected to be returned along with "status_message" describing the reason for the error. |
| ERROR | 500 | Any server-side error. In this case, status and status_message are optional. |
Examples
Request:
bash1POST https://hostName/coverage 2{ 3 "service_type": "a_domicilio", 4 "direction": "origin" 5}
Response:
Success Zip_code (200 OK)
json1{ 2 "service_type": "a_domicilio", 3 "direction": "origin", 4 "coverage": [ 5 [ 1000, 1001 ], 6 [ 2000, 2010 ], 7 [ 3000, 3002 ], 8 [ 4000, 4004 ], 9 [ 5000, 5001 ] 10 ] 11}
Success Cities (200 OK)
json1{ 2 "service_type": "a_sucursal", 3 "direction": "destination", 4 "country_id": "BR", 5 "country_name": "Brasil", 6 "coverage": [ 7 { 8 "city_id": "TUxCQ0JPTTYzNmUz", 9 "city_name": "Bombinhas", 10 "state_id": "BR-SC", 11 "state_name": "Santa Catarina" 12 }, 13 { 14 "city_id": "TUxCQ0JFTDQ4OWQ1", 15 "city_name": "Bela Vista", 16 "state_id": "BR-SC", 17 "state_name": "Santa Catarina" 18 }, 19 { 20 "city_id": "QlItU1BHdWFyaWJh", 21 "city_name": "Guariba", 22 "state_id": "BR-SC", 23 "state_name": "Santa Catarina" 24 }, 25 { 26 "city_id": "QlItU1BHdWFyaXJvYmE", 27 "city_name": "Guariroba", 28 "state_id": "BR-SC", 29 "state_name": "Santa Catarina" 30 } 31 ] 32}
Failed (400 FAILED)
json1{ 2 "status": "FAILED", 3 "status_message": "Missing service_type" 4}
Error (500 ERROR)
json1{ 2 "status": "ERROR", 3 "status_message": "Internal server error" 4}
