GET /resolve-warehouse

Resolve Warehouse

Find which Mercadona warehouse (online hub or physical store) serves a Spanish postal code, and whether the address is inside the delivery area.

Mercadona API

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

ParameterTypeRequiredDefaultDescription
postal_codestringYes-Spanish 5-digit postal code, e.g. 46001 or 08001. Send it as a string so leading zeros are kept

Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
  "status": true,
  "request_id": "640c49a9-3073-9fa8-f2ae-b7162f36",
  "cached_at": "2026-10-14T08:51:22Z",
  "data": {
    "postal_code": "46001",
    "warehouse": "vlc1",
    "warehouse_type": "hub",
    "in_area": true
  },
  "request_params": {
    "postal_code": "46001"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the request succeeded
request_idstringUnique request identifier
cached_atstring | nullISO timestamp when the answer came from cache, null when fetched for this request
dataobjectResponse payload
data.postal_codestringThe postal code you sent
data.warehousestringCode of the warehouse that serves this postal code. Pass it as warehouse on other endpoints
data.warehouse_typestringhub or store
data.in_areabooleanWhether the address is inside Mercadona’s delivery area
request_paramsobjectThe query parameters you sent, echoed back as strings
request_params.postal_codestringThe postal_code you sent

Example results

Postal codeAreawarehousewarehouse_typein_area
46001Valenciavlc1hubtrue
35001Las Palmas4701storetrue
51001Ceuta4436storetrue
07001Palma3842storetrue

Error Responses

A missing or invalid postal_code returns HTTP 400 with error as a plain string:

1
2
3
4
5
{
  "status": false,
  "request_id": "...",
  "error": "Invalid parameter 'postal_code': Field required"
}
Status CodeCauseDescription
400Missing postal_codeInvalid parameter 'postal_code': Field required
400Malformed postal_codeMust be exactly 5 digits: String should match pattern '^[0-9]{5}$'

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import requests

BASE_URL = "https://mercadona-api.p.rapidapi.com"

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "mercadona-api.p.rapidapi.com"
}

# Resolve the postal code once
response = requests.get(
    f"{BASE_URL}/resolve-warehouse",
    headers=headers,
    params={"postal_code": "46001"}
)
resolved = response.json()["data"]

if not resolved["in_area"]:
    raise SystemExit(f"{resolved['postal_code']} is outside the delivery area")

warehouse = resolved["warehouse"]
print(f"Postal code {resolved['postal_code']} -> {warehouse} ({resolved['warehouse_type']})")

# Reuse the warehouse code on later calls
response = requests.get(
    f"{BASE_URL}/search",
    headers=headers,
    params={"q": "leche", "warehouse": warehouse}
)
for product in response.json()["data"]["results"]:
    print(f"{product['name']}: {product['price']} EUR")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
const url = "https://mercadona-api.p.rapidapi.com/resolve-warehouse";

const params = new URLSearchParams({
  postal_code: "46001"
});

const response = await fetch(`${url}?${params}`, {
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "mercadona-api.p.rapidapi.com"
  }
});

const { data } = await response.json();
console.log(`${data.postal_code} -> ${data.warehouse} (${data.warehouse_type}), in area: ${data.in_area}`);
1
2
3
4
curl -G "https://mercadona-api.p.rapidapi.com/resolve-warehouse" \
  --data-urlencode "postal_code=46001" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: mercadona-api.p.rapidapi.com"
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI