Zones
Zones allow defining ShippingRates for specific Locations.
A maximum number of 100 zones can be created per project. Learn more about this limit.
Representations
Zone
Groups locations to a zone. A location can only be assigned to exactly one zone. A zone is used to define a ShippingRate for a set of locations.
id
- String
The unique ID of the zone.version
- Number
The current version of the zone.key
- String - Optional
User-specific unique identifier for a zone. Must be unique across a project. The field can be reset using the Set Key UpdateAction.createdAt
- DateTimelastModifiedAt
- DateTimename
- Stringdescription
- String - Optionallocations
- Array of Location
ZoneDraft
ZoneDrafts are used as payloads given with Create Zone requests.
key
- String - Optional
User-specific unique identifier for a zone. Must be unique across a project. The field can be reset using the Set Key UpdateAction.name
- String - Requireddescription
- String - Optionallocations
- Array of Location - Optional
Location
A geographical location representing a country with an optional state.
country
- String
A two-digit country code as per ISO 3166-1 alpha-2.state
- String - Optional
Get Zone
Get Zone by ID
Endpoint: /{projectKey}/zones/{id}
Method: GET
OAuth 2.0 Scopes: view_orders:{projectKey}
Response Representation: Zone
Get Zone by Key
Endpoint: /{projectKey}/zones/key={key}
Method: GET
OAuth 2.0 Scopes: view_orders:{projectKey}
Response Representation: Zone
Query Zones
Endpoint: /{projectKey}/zones
Method: GET
OAuth 2.0 Scopes: view_orders:{projectKey}
Response Representation: PagedQueryResult with the results
array of Zone
Query Parameters:
where
- Query Predicate - Optionalsort
- Sort - Optionalexpand
- Expansion - Optionallimit
- Number - Optionaloffset
- Number - Optional
Create Zone
Endpoint: /{projectKey}/zones
Method: POST
OAuth 2.0 Scopes: manage_orders:{projectKey}
Request Representation: ZoneDraft
Response Representation: Zone
Update Zone
Update Zone by ID
Endpoint: /{projectKey}/zones/{id}
Method: POST
OAuth 2.0 Scopes: manage_orders:{projectKey}
Response Representation: Zone
Fields:
version
- Number - Required
The expected version of the zone on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.actions
- Array of UpdateAction - Required
The list of update actions to be performed on the zone.
Update Zone by Key
Endpoint: /{projectKey}/zones/key={key}
Method: POST
OAuth 2.0 Scopes: manage_orders:{projectKey}
Response Representation: Zone
Fields:
version
- Number - Required
The expected version of the zone on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.actions
- Array of UpdateAction - Required
The list of update actions to be performed on the zone.
Update Actions
Set Key
Sets a key for the zone that is defined by you. The key must be unique across the project.
action
- String -"setKey"
key
- String - Optional
Ifkey
is absent ornull
, this field will be removed if it exists.
Change Name
action
- String -"changeName"
name
- String - Required
Set Description
action
- String -"setDescription"
description
- String - Optional
Add Location
action
- String -"addLocation"
location
- Location - Required
Remove Location
action
- String -"removeLocation"
location
- Location - Required
Delete Zone
Delete Zone by ID
Endpoint: /{projectKey}/zones/{id}
Method: DELETE
OAuth 2.0 Scopes: manage_orders:{projectKey}
Query Parameters:
version
- Number - Required
Delete Zone by Key
Endpoint: /{projectKey}/zones/key={key}
Method: DELETE
OAuth 2.0 Scopes: manage_orders:{projectKey}
Query Parameters:
version
- Number - Required