> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maple.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Check delivery zone coverage

> Checks whether a coordinate falls inside any active delivery zone of a connected location and returns the matching zone and delivery fee.

POST`https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check`API key

Checks whether a coordinate falls inside any active delivery zone of a connected location and returns the matching zone and delivery fee. Requires `delivery_zones:read` and an active connection to the location.

## Authorization

Send your API key as `Authorization: Bearer <key>`: `mpk_test_…` against the sandbox (`https://api.staging.maple.inc/v1`), `mpk_live_…` against production. See [Authentication](https://docs.maple.inc/developer-api/concepts/authentication.md). The samples read the key from `MAPLE_KEY` and the base URL from `MAPLE_BASE`, as set up in the [Quickstart](https://docs.maple.inc/developer-api/quickstart.md).

## Parameters

- `locationId` string path required

## Request body

`application/json`, required.

- `latitude` number required

- `longitude` number required

## Responses

### 200 OK

- `object` string required

  Always `delivery_zone_check`.

- `in_zone` boolean required

- `zone` object or null required

- `zone.object` string required

  Always `delivery_zone`.

- `zone.id` string required

- `zone.location_id` string required

- `zone.name` string required

- `zone.zone_type` string required

  One of `polygon`, `circle`.

- `zone.polygon` object required

  A GeoJSON Polygon. Coordinates are `[longitude, latitude]` rings; the first ring must be closed.

- `zone.polygon.type` string required

  Always `Polygon`.

- `zone.polygon.coordinates` \[number, number]\[]\[] required

- `zone.radius_miles` number or null required

- `zone.delivery_fee_cents` number required

- `zone.min_order_cents` number or null required

- `zone.max_distance_miles` number or null required

- `zone.is_active` boolean required

- `zone.priority` number required

- `zone.created_at` string required

- `zone.updated_at` string required

- `delivery_fee_cents` number or null required

### Errors

- `400` Bad request DeveloperApiBadRequest

- `401` Unauthorized DeveloperApiUnauthorized

- `403` Forbidden DeveloperApiForbidden

- `404` Not found DeveloperApiNotFound

- `429` Too many requests DeveloperApiRateLimited

Every error body names the error in `_tag`, explains it in `message`, and says where to report it in `feedback`. See [Errors](https://docs.maple.inc/developer-api/concepts/errors.md).

A `429` also sends `Retry-After`: Seconds to wait before retrying; also returned as retry\_after in the body.

Check delivery zone coverage

```sh
curl "$MAPLE_BASE/locations/str_123/delivery_zones/check" \
  -H "Authorization: Bearer $MAPLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"latitude":1.5,"longitude":1.5}'
```

```python
import os
import requests


r = requests.post(
    f"{os.environ['MAPLE_BASE']}/locations/str_123/delivery_zones/check",
    headers={"Authorization": f"Bearer {os.environ['MAPLE_KEY']}"},
    json={
        "latitude": 1.5,
        "longitude": 1.5,
    },
    timeout=30,
)
r.raise_for_status()
print(r.json())
```

```js
const res = await fetch(`${process.env.MAPLE_BASE}/locations/str_123/delivery_zones/check`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MAPLE_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "latitude": 1.5,
    "longitude": 1.5
  }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
```

```json
{
  "object": "delivery_zone_check",
  "in_zone": true,
  "zone": {
    "object": "delivery_zone",
    "id": "string",
    "location_id": "str_123",
    "name": "string",
    "zone_type": "polygon",
    "polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            null,
            null
          ]
        ]
      ]
    },
    "radius_miles": 1.5,
    "delivery_fee_cents": 1.5,
    "min_order_cents": 1.5,
    "max_distance_miles": 1.5,
    "is_active": true,
    "priority": 1.5,
    "created_at": "string",
    "updated_at": "string"
  },
  "delivery_fee_cents": 1.5
}
```

```json
{
  "_tag": "DeveloperApiBadRequest",
  "code": "string",
  "message": "string",
  "feedback": "string"
}
```
