Skip to main content

Capacity-based Routing (v0)

Download OpenAPI specification:Download

Use these APIs to control the amount of routing based on the capacity of each distribution center. They are configuration sets to limit items to be picked, redirecting them to be shipped from another warehouse.

Updates store capacity configuration using patch.

Patching store capacity configuration is based on RFC 6902 - Json Patch specification. Hours will be the time range (UTC) it can be processed. null value means that the day does not contain a time range at a given week day. The configuration format is as follows:

{
    "DC1": {
      "limit": 10,
      "hours": {
        "monday": [8, 18],
        "tuesday": [10, 13],
        "wednesday": [7, 14],
        "thursday": null,
        "friday": null,
        "saturday": null,
        "sunday": [12, 0]
      }
    },
    "DC2": {
      ...
    }
}

If you wan to add a patch operation to saturday, you can do it with the following payload:

[
  {
    "op": "replace",
    "path": "/DC1/hours/saturday",
    "value": [10, 12]
  },
  {
    "op": "replace",
    "path": "/DC1/hours/sunday,
    "value": [10, 20]
  }
]
Authorizations:
newStoreAccessToken
header Parameters
If-Match
required
string

This value is an etag to the version it should update. The value of the hash is returned as ETag header can be retrieved by running a GET /store_capacity.

Request Body schema: application/json
Array ([ 1 .. 100 ] items)
op
required
string
Enum: "add" "remove" "replace" "copy" "move" "test"

Operation to be applied. More details about operations are described on https://jsonpatch.com/

path
required
string

Path on configuration to be applied

value
string or object or array or boolean or integer or number

According to Json Patch documentation, value may be optional, depending on the operation

from
string

This property is required for copy and move operations

Responses

Request samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Response samples

Content type
application/json
{
  • "error": null,
  • "config": {
    }
}

Gets the configuration for store capacity

Description

Authorizations:
newStoreAccessToken

Responses

Response samples

Content type
application/json
{
  • "config": {
    },
  • "error": null,
  • "hash": "202cb962ac59075b964b07152d234b70"
}

Upserts the store capacity configuration using POST.

The request for this endpoint looks as follows:

{
  "policy": {
    "some-node": {
      "limit": 123,
      "hours": {
        "monday": null
      }
    }
  }
}
Authorizations:
newStoreAccessToken
header Parameters
If-Match
string

This value is an etag to the version it should update. The value of the hash is returned as ETag header can be retrieved by running a GET /store_capacity. In case you want to add a new policy leave this empty.

Request Body schema: application/json
required
object

It contains the store capacity configuration. It describes the time range the store will be able to process the shipments in order to comply with order processing and promised shipment time to a given fulfillment node. eG: {"DC1": {"monday": [10, 20], "tuesday": [9, 21]}} means that routing will process orders during that period for fulfillment node DC1. If the grace period finished out of that range, routing process will hold the order until the defined time range. null hour range means that there will not be any order processed for routing at that given week day.

hash
string

In case you want to override the/an old policy, add the hash parameter

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "error": null,
  • "config": {
    },
  • "hash": "202cb962ac59075b964b07152d234b70"
}

Gets the the store capacity availability based on the configuration and the routed items in the last 48 hours.

The availability will be computed from the configuration and the routed order items in the last 48 hours. It may receive a star (*) wildcard as a query string in order to retrieve all the fulfillment nodes.

Authorizations:
newStoreAccessToken
query Parameters
locations
string

Locations may be the fulfillment node name like ff-id-1 or using a star to define everything starting with ff like ff* or even *ff or *ff* or even *. The values are separated by comma.

Responses

Response samples

Content type
application/json
{
  • "capacity": {
    },
  • "error": null
}