Skip to main content
POST
Create a travel zone for the signed-in supplier

Authorizations

x-api-key
string
header
required

API key minted in the MarketBox dashboard. Scope is restricted to the projects you select at creation time. Every route needs the key's standard API access (*) except POST /v1/projects/{projectId}/events, which needs events:write; a key without * is refused with 403 CAPABILITY_NOT_GRANTED.

Authorization
string
header
required

The signed-in person's Cognito access token, issued to this application's app client. Sent with the API key on the /clients/me and /suppliers/me routes.

Path Parameters

projectId
string
required

The project (tenant) that owns the resource. Every resource in this API is scoped to a project, and your API key is restricted to the projects it was issued for — a project outside that scope returns 403.

Minimum string length: 1
Example:

"prj_01kv60qgnef2kt3pvqgwmkbzfr"

Body

application/json

Travel zone data

name
string
required

The zone’s display name, as the supplier and staff see it.

Minimum string length: 1
Example:

"Downtown Toronto"

longitude
number
required

Longitude of the zone’s centre (for a CIRCULAR zone, the centre of the circle).

Example:

-79.3832

latitude
number
required

Latitude of the zone’s centre (for a CIRCULAR zone, the centre of the circle).

Example:

43.6532

travelZoneType
enum<string>
required

CIRCULAR = a radius around the centre (travelDistance and travelDistanceUnit); DRAWN = the polygons in travelRegions.

Available options:
CIRCULAR,
DRAWN
Example:

"CIRCULAR"

defaultLanguage
string

The language name is written in (BCP 47).

Minimum string length: 1
Example:

"en"

nameI18n
object

The name in other languages, keyed by BCP 47 language tag.

Example:
addressOneLine
string | null

The address of the zone’s centre, on one line.

Example:

"100 Queen St W, Toronto, ON M5H 2N2"

street
string | null

Street address of the zone’s centre.

Example:

"100 Queen St W"

city
string | null

City of the zone’s centre.

Example:

"Toronto"

state
string | null

State or province of the zone’s centre.

Example:

"ON"

country
string | null

Country of the zone’s centre.

Example:

"CA"

postalCode
string | null

Postal or ZIP code of the zone’s centre.

Example:

"M5H 2N2"

timezone
string | null

IANA time zone of the zone’s area. Omit or null to leave it unset.

Minimum string length: 1
Example:

"America/Toronto"

travelDistance
number | null

The radius of a CIRCULAR zone, in travelDistanceUnit. Required for CIRCULAR, null for DRAWN.

Required range: x > 0
Example:

10

travelDistanceUnit
enum<string> | null

The unit of travelDistance. Required for CIRCULAR, null for DRAWN.

Available options:
KM,
MILES,
null
Example:

"KM"

travelRegions
object | null

The area of a DRAWN zone, a GeoJSON Polygon or MultiPolygon. Required for DRAWN, null for CIRCULAR.

Example:
active
boolean
default:true

Active zones can be used by schedules; an inactive zone is kept but offers nothing. Defaults to true.

Example:

true

Response

Travel zone created

data
object
required