Skip to navigation

Create a delivery zone

Partner key + restaurant key. A zone by postal codes (POSTAL_CODES) or by radius (RADIUS). Amounts are integers in øre (0–10000000). The name is trimmed. A POSTAL_CODES zone needs at least one postal code (four digits); a RADIUS zone needs centerLat, centerLng and radiusKm (above 0, at most 100 km). On create and on change alike, fields with a value that belong to the other zone type (postal codes on a RADIUS zone, centre and radius on a POSTAL_CODES zone) are rejected with 422; null and an empty list are accepted and stored as empty. Unknown fields are rejected.

At most 50 zones per restaurant (including inactive ones). Delivery at checkout also needs the restaurant to offer delivery (deliveryEnabled in the settings).

Authentication

AuthorizationBearer

The partner key (lbp_test_… or lbp_live_…), sent as Authorization: Bearer lbp_… and created in LettBestilt Partner under Partner key. It belongs to the whole partner, not to a restaurant, and only works against /api/v1/partner. Server to server only: a request with an Origin header is rejected with 403 FORBIDDEN, and the key must never be in a browser. A TEST key sees and creates only sandboxes; LIVE keys work once LettBestilt Partner is open. A suspended or archived partner, a revoked key and a restaurant key (lbs_…) here give 401 UNAUTHORIZED; an expired key gives 401 KEY_EXPIRED.

X-LettBestilt-Restaurant-Keystring

The restaurant’s own key (lbs_test_… or lbs_live_…) for calls about one restaurant in the partner API, sent together with the partner key. The key must have full access (scope *, otherwise 403 INSUFFICIENT_SCOPE), belong to a restaurant the partner owns and be in the same environment as the partner key. A restaurant that does not exist, belongs to another partner or does not match the key always gives the same 404 RESTAURANT_NOT_FOUND. Older keys without an environment in the prefix (lbs_<random>) are not accepted here; rotate them in LettBestilt Partner.

Path parameters

slugstringRequired

The restaurant’s slug. It must match the restaurant key in X-LettBestilt-Restaurant-Key.

Request

This endpoint expects an object.
namestringRequired1-100 characters
deliveryFeeintegerRequired0-10000000
typeenumOptionalDefaults to POSTAL_CODES
Allowed values:
postalCodeslist of stringsOptionalDefaults to []
centerLatdouble or nullOptional-90-90
centerLngdouble or nullOptional-180-180
radiusKmdouble or nullOptional<=100
centerLabelstring or nullOptional<=200 characters
minimumOrderintegerOptional0-10000000Defaults to 0
estimatedMinutesintegerOptional0-240Defaults to 30
isActivebooleanOptionalDefaults to true

Response

Created.
dataobject

A delivery zone. Active zones are also in deliveryZones in GET /api/v1/menu, and a delivery order must fall within an active zone.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error