Delivery zones
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. Requires delivery_zones:read and an active connection to the location.
Check delivery zone coverage
curl --request POST \
--url https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"latitude": 123,
"longitude": 123
}
'import requests
url = "https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check"
payload = {
"latitude": 123,
"longitude": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({latitude: 123, longitude: 123})
};
fetch('https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'latitude' => 123,
'longitude' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check"
payload := strings.NewReader("{\n \"latitude\": 123,\n \"longitude\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"latitude\": 123,\n \"longitude\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"latitude\": 123,\n \"longitude\": 123\n}"
response = http.request(request)
puts response.read_body{
"object": "delivery_zone_check",
"in_zone": true,
"zone": {
"object": "delivery_zone",
"id": "<string>",
"location_id": "<string>",
"name": "<string>",
"zone_type": "polygon",
"polygon": {
"type": "Polygon",
"coordinates": [
[
[
123,
123
]
]
]
},
"radius_miles": 123,
"delivery_fee_cents": 123,
"min_order_cents": 123,
"max_distance_miles": 123,
"is_active": true,
"priority": 123,
"created_at": "<string>",
"updated_at": "<string>"
},
"delivery_fee_cents": 123
}{
"_tag": "DeveloperApiBadRequest",
"message": "<string>",
"code": "<string>"
}{
"_tag": "DeveloperApiUnauthorized",
"message": "<string>"
}{
"_tag": "DeveloperApiForbidden",
"code": "insufficient_scope",
"message": "<string>"
}{
"_tag": "DeveloperApiNotFound",
"message": "<string>"
}{
"_tag": "DeveloperApiRateLimited",
"message": "<string>",
"retry_after": 123
}Authorizations
API key — mpk_test_… for the sandbox, mpk_live_… for production. Issued by Maple during partner onboarding.
Path Parameters
Body
application/json
Response
Success
Available options:
delivery_zone_check A delivery zone. delivery_fee_cents and min_order_cents are integer USD cents; created_at / updated_at are ISO 8601 timestamps.
Show child attributes
Show child attributes
delivery_fee_cents
Option 1 · numberOption 2 · enum<string>Option 3 · enum<string>Option 4 · enum<string>Option 5 · enum<string>
required
Was this page helpful?
⌘I
Check delivery zone coverage
curl --request POST \
--url https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"latitude": 123,
"longitude": 123
}
'import requests
url = "https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check"
payload = {
"latitude": 123,
"longitude": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({latitude: 123, longitude: 123})
};
fetch('https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'latitude' => 123,
'longitude' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check"
payload := strings.NewReader("{\n \"latitude\": 123,\n \"longitude\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"latitude\": 123,\n \"longitude\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maple.inc/v1/locations/{locationId}/delivery_zones/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"latitude\": 123,\n \"longitude\": 123\n}"
response = http.request(request)
puts response.read_body{
"object": "delivery_zone_check",
"in_zone": true,
"zone": {
"object": "delivery_zone",
"id": "<string>",
"location_id": "<string>",
"name": "<string>",
"zone_type": "polygon",
"polygon": {
"type": "Polygon",
"coordinates": [
[
[
123,
123
]
]
]
},
"radius_miles": 123,
"delivery_fee_cents": 123,
"min_order_cents": 123,
"max_distance_miles": 123,
"is_active": true,
"priority": 123,
"created_at": "<string>",
"updated_at": "<string>"
},
"delivery_fee_cents": 123
}{
"_tag": "DeveloperApiBadRequest",
"message": "<string>",
"code": "<string>"
}{
"_tag": "DeveloperApiUnauthorized",
"message": "<string>"
}{
"_tag": "DeveloperApiForbidden",
"code": "insufficient_scope",
"message": "<string>"
}{
"_tag": "DeveloperApiNotFound",
"message": "<string>"
}{
"_tag": "DeveloperApiRateLimited",
"message": "<string>",
"retry_after": 123
}