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:
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
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 |
Responses
Request samples
- Payload
[- {
- "op": "add",
- "path": "/DC1",
- "value": {
- "limit": 40,
- "hours": {
- "monday": [
- 8,
- 22
], - "tuesday": [
- 8,
- 22
], - "wednesday": [
- 8,
- 22
], - "thursday": [
- 8,
- 22
], - "friday": [
- 8,
- 23
], - "saturday": [
- 8,
- 23
], - "sunday": null
}
}
}, - {
- "op": "replace",
- "path": "/DC1/limit",
- "value": 20
}
]
Response samples
- 200
- 400
- 412
- 422
- 500
{- "error": null,
- "config": {
- "DC01": {
- "limit": 25,
- "hours": {
- "monday": [
- 8,
- 20
], - "tuesday": [
- 8,
- 20
], - "wednesday": [
- 8,
- 20
], - "thursday": [
- 8,
- 20
], - "friday": [
- 8,
- 20
], - "saturday": null,
- "sunday": null
}
}
}
}
Response samples
- 200
- 404
- 500
{- "config": {
- "store-1": {
- "limit": 10,
- "hours": {
- "monday": [
- 10,
- 12
], - "tuesday": [
- 10
], - "wednesday": [
- 12,
- 11
], - "thursday": [
- 8,
- 23
], - "friday": null,
- "saturday": null,
- "sunday": null
}
}, - "store-2": {
- "limit": 50,
- "hours": {
- "monday": [
- 9,
- 21
], - "tuesday": [
- 10
], - "wednesday": [
- 12,
- 11
], - "thursday": [
- 8,
- 23
], - "friday": [
- 7,
- 18
], - "saturday": [
- 8,
- 20
], - "sunday": [
- 9,
- 19
]
}
}
}, - "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:
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: |
hash | string In case you want to override the/an old policy, add the hash parameter |
Responses
Request samples
- Payload
{- "policy": {
- "boston_1": {
- "limit": 1337,
- "hours": {
- "monday": [
- 1,
- 4
], - "tuesday": [
- 6
], - "wednesday": [
- 6,
- 2
]
}
}
}
}
Response samples
- 200
- 400
- 404
- 500
{- "error": null,
- "config": {
- "DC01": {
- "limit": 25,
- "hours": {
- "monday": [
- 8,
- 20
], - "tuesday": [
- 8,
- 20
], - "wednesday": [
- 8,
- 20
], - "thursday": [
- 8,
- 20
], - "friday": [
- 8,
- 20
], - "saturday": null,
- "sunday": null
}
}
}, - "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:
query Parameters
locations | string Locations may be the fulfillment node name like |
Responses
Response samples
- 200
- 500
{- "capacity": {
- "DC1": 1,
- "DC2": 20,
- "DC3": 22
}, - "error": null
}