Maps a Spanish postal code to the Mercadona warehouse that serves it: one of the 7 online hubs or one of the 267 physical stores. You usually don’t need this endpoint, because every warehouse-scoped endpoint accepts postal_code directly and resolves it for you. Use it to check coverage for an address, or to resolve a postal code once and cache the warehouse code for later calls. in_area tells you whether the address is inside the delivery area.
HTTP Request
GET /resolve-warehouse
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
postal_code | string | Yes | - | Spanish 5-digit postal code, e.g. 46001 or 08001. Send it as a string so leading zeros are kept |
Response
| |
Response Fields
| Field | Type | Description |
|---|---|---|
status | boolean | true when the request succeeded |
request_id | string | Unique request identifier |
cached_at | string | null | ISO timestamp when the answer came from cache, null when fetched for this request |
data | object | Response payload |
data.postal_code | string | The postal code you sent |
data.warehouse | string | Code of the warehouse that serves this postal code. Pass it as warehouse on other endpoints |
data.warehouse_type | string | hub or store |
data.in_area | boolean | Whether the address is inside Mercadona’s delivery area |
request_params | object | The query parameters you sent, echoed back as strings |
request_params.postal_code | string | The postal_code you sent |
Example results
| Postal code | Area | warehouse | warehouse_type | in_area |
|---|---|---|---|---|
46001 | Valencia | vlc1 | hub | true |
35001 | Las Palmas | 4701 | store | true |
51001 | Ceuta | 4436 | store | true |
07001 | Palma | 3842 | store | true |
Error Responses
A missing or invalid postal_code returns HTTP 400 with error as a plain string:
| |
| Status Code | Cause | Description |
|---|---|---|
| 400 | Missing postal_code | Invalid parameter 'postal_code': Field required |
| 400 | Malformed postal_code | Must be exactly 5 digits: String should match pattern '^[0-9]{5}$' |
Code Examples
| |
| |
| |
Related Endpoints
- Warehouses : list all 274 warehouse codes
- Product Search : search products for a postal code or warehouse
- Product Details : full product sheet as sold in a warehouse
- Price Drops : current price drops for a warehouse