Skip to main content

Routing ruleset API (v0)

Download OpenAPI specification:Download

Define routing rules for your business

Get routing rules example

Retrieves the current 'fulfillment configuration V1' transformed to adhere to the 'Routing Rule' V2 format. It shows the change in value-mapping between V1 and V2. If already using V2, this endpoint is of no use, and will return the current configuration. Refer to the 'Response Examples' to see the type of structure to be returned.

Authorizations:
newStoreAccessToken

Responses

Response samples

Content type
application/json
{
  • "routes": [
    ],
  • "sl_levels_priority": [
    ],
  • "location_groups": {
    },
  • "zip_code_regions": {
    }
}

Get routing rules

Retrieves the current 'Routing Rule V2'. If customer using V1, this endpoint is of no use, and will return the error.

Authorizations:
newStoreAccessToken

Responses

Response samples

Content type
application/json
{
  • "routes": [
    ],
  • "sl_levels_priority": [
    ],
  • "location_groups": {
    },
  • "zip_code_regions": {
    }
}

Updates the routing rules

This endpoint is used to initially seed the routing rules or to replace it completely

Note:

  • You have the option of defining route entries with a single country or multiple countries by providing the optional Content-Type header with your desired payload version.
  • If you'd like to define multiple countries set the Content-Type header to application/json; version=1. Select the appropriate Content-Type in the the request schema drop-down to see the schema for supporting multiple countries.
Authorizations:
newStoreAccessToken
Request Body schema:
Array of objects

Routing rules specification

sl_levels_priority
Array of strings non-empty [ items non-empty ]

Service levels priority. This is ordered according to which service level will be taken first

object

Location groups identifiers

object

Zip code groups, in order to facilitate the identification routes per regions

Responses

Request samples

Content type
{
  • "routes": [
    ],
  • "sl_levels_priority": [
    ],
  • "location_groups": {
    },
  • "zip_code_regions": {
    }
}

Response samples

Content type
{
  • "routing_ruleset": {
    },
  • "fulfillment_config_uri": "v0/fulfillment_configuration/revision/13"
}

Patch the routing rules

A convenience endpoint is where you use JSON patch to change parts of routing rules.

Note:

  • You have the option of defining route entries with a single country or multiple countries by providing the optional Content-Type header with your desired payload version.
  • If you'd like to define multiple countries set the Content-Type header to application/json; version=1. Select the appropriate Content-Type in the the request schema drop-down to see the schema for supporting multiple countries.
  • To use payload version 1 via the PATCH operation you need to update the route entries from country to countries via PUT endpoint for compatibility.
Authorizations:
newStoreAccessToken
Request Body schema:
Array
One of
path
required
string

A JSON Pointer path.

op
required
string
Enum: "add" "replace" "test"

The operation to perform.

value
required
any

The value to add, replace or test.

Responses

Request samples

Content type
[
  • {
    }
]

Response samples

Content type
{
  • "routing_ruleset": {
    },
  • "fulfillment_config_uri": "v0/fulfillment_configuration/revision/13"
}

Get routing rules section

Retrieves a section of the current 'Routing Rule V2'. If customer using V1, this endpoint is of no use, and will return the error.

Authorizations:
newStoreAccessToken
path Parameters
section
required
string
Enum: "routes" "sl_levels_priority" "location_groups" "zip_code_regions"

name of the section to retrieve

Responses

Response samples

Content type
application/json
{
  • "zip_code_regions": {
    }
}