API Docs

Global settings

Get warehouses

Returns all warehouses available in MPower.

GET/https://api-get-warehouses-kigtdz23uq-ew.a.run.app

Headers

x-api-key
<API_KEY>
string

Body Parameters

No body, query, or path parameters are required.

cURL

curl -i \
  -H "x-api-key: <API_KEY>" \
  https://api-get-warehouses-kigtdz23uq-ew.a.run.app

Response

200 Success

{
  "count": 10,
  "warehouses": {
    "warehouseDocumentId": {
      "name": "Warehouse name",
      "country_iso": "CHE"
    }
  }
}

200 Success: no warehouses found

{
  "count": 0,
  "warehouses": {}
}

401 Unauthorized

Returned when the x-api-key header is missing or invalid.

{
  "error": "Unauthorized"
}

403 Origin not allowed

Only applies to an OPTIONS preflight request sent from a browser origin that is not allowed by the CORS configuration.

{
  "error": "Origin not allowed"
}

405 Method not allowed

Returned when the endpoint is called with a method other than GET or OPTIONS. The response includes the header Allow: GET.

{
  "error": "Method not allowed"
}

500 API key is not configured

Returned when PRODUCT_PRICES_API_KEY is not available in the function runtime.

{
  "error": "API key is not configured"
}

Behavior / Side effects

Read-only endpoint

  • Reads all documents from the warehouses collection.
  • Does not create, update, or delete Firestore documents.

Request behavior

  • Does not require body parameters.
  • Does not support query parameters, filters, sorting, or pagination.
  • Returns all warehouses in a single response.

Response shape

  • Returns a top-level count and warehouses object.
  • count contains the number of warehouses returned.
  • count matches the number of keys inside warehouses.
  • Each key inside warehouses is the Firestore warehouse document ID.
  • Each warehouse includes only name and country_iso.

Field mapping

  • warehouses.{warehouse_id}.name is read from warehouses/{warehouse_id}.name.
  • warehouses.{warehouse_id}.country_iso is read from warehouses/{warehouse_id}.country_iso.
  • country_iso is trimmed and normalized to uppercase.

Data quality expectations

  • name and country_iso are expected to exist for every warehouse.
  • The API has a defensive fallback and returns null if either underlying value is missing, empty, or not a valid string.
  • Warehouses with incomplete or malformed fields are still included in the response.