Boxollo API
https://api.boxollo.com/minboxBoxollo API is a service allowing users to calculate minimal packaging containers and decision-making in the packaging process.
Authentication
Authentication is done using the HTTP Authorization header with Basic authentication scheme.
You can authenticate either by:
- Providing standard
username:passwordcredentials, or - Using a token provided by our authentication system in the format
Token:<access_token>
In both cases, the credentials must follow the standard and be Base64-encoded and sent in the Authorization header as follows:
Authorization: Basic base64(<credentials>)
Example
If your token is:
izfvstg3654z3cfve6c5z4cz6
Then the string to encode in Base64 is:
Token:izfvstg3654z3cfve6c5z4cz6
Which results in:
VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
Your final header should be:
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
Example in Javascript
const token = "izfvstg3654z3cfve6c5z4cz6";
const base64 = btoa(`Token:${token}`);
const headers = {
Authorization: `Basic ${base64}`
};
/orders
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
client_order_id: ORDER_xyz_123 string, required Unique order id defined by client- products array, fixed-type, required List of all order products
- object
product_id: PRODUCT_xyz_123 string, required Unique product id- length: 450 number, required Product length in mm
- width: 330 number, required Product width in mm
- height: 220 number, required Product height in mm
- amount: 1 number, required Product amount in mm
- weight: 300 number, required Product weight in g
- compatibility object, optional Object that defines compatibility between product <-> product and product <-> container
- containers object, optional Defines compatibility between product and fixed packer container
- properties array[string], fixed-type, optional All the property entries correspond to the container.compatibility.properties array. The product can only be added to a container that contains all the corresponding properties.
- group string, optional The group attribute corresponds to the container.compatibility.groups array. The product can only be added to a container that contains the corresponding group.
- products string, optional Defines compatibility between products. Only products having the same (or undefined) 'products' attribute can be present in the same container
- containers object, optional Defines compatibility between product and fixed packer container
- object
{
"client_order_id": "ORDER_xyz_123",
"products": [
{
"product_id": "PRODUCT_xyz_0123",
"length": 450,
"width": 330,
"height": 220,
"amount": 1,
"weight": 300,
"compatibility": {
"containers": {
"group": "group1",
"properties": ["fragile"]
},
"products": "cleaner"
}
}
]
}
- data object Stored order data
id: 35e2c2bc-fef6-4848-8939-902dec4f712f string Internal order ID referenced by other APIs.
{
"status": 201,
"message": "Received",
"data": {
"id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"products": [
{
"product_id": "PRODUCT_xyz_0123",
"length": 450,
"width": 330,
"height": 220,
"amount": 1,
"weight": 300,
"compatibility": {
"containers": {
"group": "diaper",
"properties": ["fragile"]
},
"products": "cleaner"
}
}
]
}
}
{
"status": 400,
"message": "Bad Request | missing product_id attribute"
}
{
"status": 401,
"message": "Unauthorized"
}
/orders/{order_id}
- order_id Internal order ID
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
- data object Stored order data
id: 35e2c2bc-fef6-4848-8939-902dec4f712f string Internal order id referenced by other APIs.
{
"status": 200,
"message": "OK",
"data": {
"id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"products": [
{
"product_id": "PRODUCT_xyz_0123",
"length": 450,
"width": 330,
"height": 220,
"amount": 1,
"weight": 300,
"compatibility": {
"containers": {
"group": "diaper",
"properties": ["fragile"]
},
"products": "cleaner"
}
}
]
}
}
{
"status": 404,
"message": "Not Found"
}
{
"status": 401,
"message": "Unauthorized"
}
/packings/batches
Create order packing batch and calculate containers based on packer settings provided in the body of this request. Every container is limited to 30 boxes per request on input. Every batch is limited to 300 boxes in total per request.
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
order_id:35e2c2bc-fef6-4848-8939-902dec4f712fstring, requireddone_callback: https://client.site/api/packing/done/ string, optional HTTPS URL defined by client. It is called when batch calculation is finished. 'batch_id' query parameter is automatically added to the URL. Callback URL call is not repeated if it fails. It is also cancelled if server does not reply in 5 seconds.done_callback_auth_header:ccji78s-plc2wlk-xxwpc-24lk0lstring, optional Optional X-API-KEY http header added to done_callback request- packers array, fixed-type, required Priority stack of packers. The algorithm tries to pack all boxes (products) using first packer. If first packer does not pack all boxes then it takes the remaining ones and pass them to second packer, third packer, ..., until all boxes are packed or there are no available packers in the stack.
- object
client_packer_id: opera_1 string, required Packer id set by client, unique relatively to current batchpacker_type: dynamic (string, required) - Packer type. 'dynamic': packer producing containers with variable dimensions. 'fixed': packer which uses static containers with given dimensionsmax_container_length: 600 number, required Max. container length in mm.max_container_width: 500 number, required Max. container width in mm.max_container_height: 440 number, required Max. container height in mm.max_container_weight: 30000 number, optional Max. container weight in g. Unlimited by default.max_container_count: 1 number, optional Max. number of containers produced by packer. Unlimited by default.max_box_count_per_container: 5 number, optional Max. number of boxes in container. 30 by default and max.max_box_weight: 5000 number, optional Max. box weight. Unlimited by default.box_allow_rotation: true boolean, optional Rotates y-axis only when false. True by default.
- object
client_packer_id: manual_1 string, required Packer id set by client, unique relatively to current batchpacker_type: fixed (string, required) - Packer type. 'dynamic': packer producing containers with variable dimensions. 'fixed': packer which uses containers with given dimensions- containers array, fixed-type List of fixed containers
- object
client_container_id: manual_1 string, required Container id set by client, unique relatively to packer- length: 400 number, required Container length in mm.
- width: 250 number, required Container width in mm.
- height: 200 number, required Container height in mm.
max_weight: 30000 number, optional Max. container weight in g.max_box_count: 5 number, optional Max. number of boxes in container. 30 by default and max.max_box_weight: 5000 number, optional Max. box weight. Unlimited by default.box_allow_rotation: true boolean, optional Rotates y-axis only when false. True by default.compatibilityobject, optional Object that defines compatibility between product <-> container- properties array[string], fixed-type, optional The properties attribute corresponds to the product.compatibility.properties array. A product can only be added to the container if the container contains all the corresponding properties defined in product.
- groups array[string], fixed-type, optional The group attribute corresponds to the container.compatibility.groups array. The product can only be added to a container that contains the corresponding group.
allow_neutral_property_productsboolean, optional Allows to add 'neutral' products to the container. Neutral products are products that do not have any compatibility properties.
- object
- object
{
"order_id": "35e2c2bc-fef6-4848-8939-902dec4f712f ",
"done_callback": "https://client.site/api/packing/done/",
"packers": [
{
"client_packer_id": "opera_1",
"packer_type": "dynamic",
"max_container_length": 600,
"max_container_width": 500,
"max_container_height": 440,
"max_container_weight": 30000,
"max_container_count": 1,
"max_box_count_per_container": 5,
"max_box_weight": 5000,
"box_allow_rotation": false
},
{
"client_packer_id": "manual_1",
"packer_type": "fixed",
"containers": [
{
"client_container_id": "small",
"length": 100,
"width": 75,
"height": 50,
"max_weight": 10000,
"max_box_count": 5,
"max_box_weight": 500,
"box_allow_rotation": false,
"compatibility": {
"properties": ["fragile"],
"groups": ["group1"],
"allow_neutral_property_products": true
}
},
{
"client_container_id": "normal",
"width": 400,
"length": 250,
"height": 200,
"max_weight": 20000,
"max_box_count": 3
},
{
"client_container_id": "big",
"width": 600,
"length": 500,
"height": 400
}
]
},
{
"client_packer_id": "opera_2",
"packer_type": "dynamic",
"max_container_length": 500,
"max_container_width": 400,
"max_container_length": 220,
"max_container_weight": 20000
}
]
}
- data object Batch data
id:35e2c2bc-fef6-4848-8939-902dec4f712fstring Packing batch id. Used by /packings/batch/{batch_id} API.order_id:35e2c2bc-fef6-4848-8939-902dec4f712fstring Internal order idclient_order_id: ORDER_xyz_123 string Order id set by client- status: queued enum Batch status
- queued Batch is queued and will be calculated
in_progressBatch calculation has been started- done Batch calculation has been finished
- error An error occured during calculation.
{
"status": 201,
"message": "Received",
"data": {
"id": "3d174e56-6e8c-4289-ae02-5f1c8b5564b1",
"order_id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"status": "queued"
}
}
{
"status": 400,
"message": "Bad Request | Missing 'client_packer_id' attribute"
}
{
"status": 401,
"message": "Unauthorized Access"
}
/packings/batches/{batch_id}
Can be checked periodically to retrieve batch calculation status. Provides packing_id when the calculation is done which can be used in /packings/{packing_id} API.
- batch_id Packing batch id
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
- data object Batch status data
id:3d174e56-6e8c-4289-ae02-5f1c8b5564b1string Packing batch id.order_id:35e2c2bc-fef6-4848-8939-902dec4f712fstring Order id.client_order_id: ORDER_xyz_123 string Order id set by client.packing_id:sd54a6-x54e6-5486-cd85-ca5v4bt321cvstring, optional Packing id. Used by /packings/{packing_id} API. Avalable when the batch calculation is done.- status: done enum Batch status.
- queued Batch is queued and will be calculated.
in_progressBatch calculation has been started.- done Batch calculation has been done.
- error An error occured during calculation.
{
"status": 200,
"message": "OK",
"data": {
"id": "3d174e56-6e8c-4289-ae02-5f1c8b5564b1",
"order_id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"packing_id": "sd54a6-x54e6-5486-cd85-ca5v4bt321cv",
"status": "done"
}
}
{
"status": 404,
"message": "Not Found"
}
{
"status": 401,
"message": "Unauthorized Access"
}
/packings/{packing_id}
Retrieve order packing details when the calculation is done. Packings are generated by /packings/batch API.
- packing_id Packing id
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
- data object Packing data
id:sd54a6-x54e6-5486-cd85-ca5v4bt321cvstring Packing id.order_id:35e2c2bc-fef6-4848-8939-902dec4f712fstring Order id.client_order_id: ORDER_xyz_123 string Order id set by client.- containers array, fixed-type List of all packed containers and their boxes when calculation is done.
- object
container_id:368614a6 c256 489d a221 a66f9da80662string Container id. Used by /container/{container_id} API.client_container_id: manual_1 string, optional Container id set by client. Available if packer_type is 'fixed'. Unique relatively to packer.client_packer_id: opera_1 string Packer id set by client, unique relatively to current batch.packer_type: dynamic string Packer type. 'dynamic': packer producing containers with variable dimensions. 'fixed': packer which uses containers with given dimensions.- length: 460 number Container length in mm.
- width: 460 number Container width in mm.
- height: 250 number Container height in mm.
- weight: 5560 number Container weight in g.
- boxes object
product_id: PRODUCT_xyz_0123 string- amount: 1 number
- object
not_packed_boxesarray, fixed-type List of boxes which were not packed by any packer.- object
product_id: PRODUCT_xyz_0123 string- amount: 1 number
- object
{
"status": 200,
"message": "OK",
"data": {
"id": "sd54a6-x54e6-5486-cd85-ca5v4bt321cv",
"order_id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"containers": [
{
"container_id": "368614a6-c256-489d-a221-a66f9da80662",
"client_packer_id": "opera_1",
"packer_type": "dynamic",
"length": 545,
"width": 460,
"height": 250,
"weight": 5560,
"boxes": [
{
"product_id": "PRODUCT_xyz_0123",
"amount": 1
},
{
"product_id": "PRODUCT_xyz_0005",
"amount": 2
},
{
"product_id": "PRODUCT_xyz_0004",
"amount": 1
}
]
},
{
"container_id": "c64c6de8-e61a-447e-aea1-35e3adfeae41",
"client_container_id": "small",
"client_packer_id": "manual_1",
"packer_type": "fixed",
"length": 545,
"width": 460,
"height": 250,
"weight": 5560,
"boxes": [
{
"product_id": "PRODUCT_xyz_0005",
"amount": 3
}
]
},
{
"container_id": "fg4c6de8-e61a-447e-aea1-59s6c4ss5a",
"client_container_id": "big",
"client_packer_id": "manual_1",
"packer_type": "fixed",
"length": 700,
"width": 600,
"height": 450,
"weight": 15560,
"boxes": [
{
"product_id": "PRODUCT_xyz_0008",
"amount": 2
}
]
}
],
"not_packed_boxes": [
{
"product_id": "PRODUCT_xyz_0006",
"amount": 2
},
{
"product_id": "PRODUCT_xyz_0007",
"amount": 1
}
]
}
}
{
"status": 404,
"message": "Not Found"
}
{
"status": 401,
"message": "Unauthorized Access"
}
/containers/{container_id}
Retrieve container and its boxes details. Containers are generated by /packings/batch API.
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
- data object Packing data
id:368614a6-c256-489d-a221-a66f9da80662string Container ID. It is referenced by other API callspacking_batch_id:3d174e56-6e8c-4289-ae02-5f1c8b5564b1string Packing batch id.client_packer_id: opera_1 string Packer id set by client, unique relatively to current batchpacker_type: dynamic string Packer type. 'dynamic': packer producing containers with variable dimensions. 'fixed': packer which uses static containers with given dimensionsclient_container_id: manual_1 string, optional Container id set by client. Available if packer_type is 'fixed'. Unique relatively to packer.order_id:35e2c2bc-fef6-4848-8939-902dec4f712fstring Order id.client_order_id: ORDER_xyz_123 string Order id set by client.- length: 460 number Container length in mm.
- width: 460 number Container width in mm.
- height: 250 number Container height in mm.
- weight: 5560 number Container weight in g.
- boxes object
product_id: PRODUCT_xyz_0123 string- boundaries array Box orientation in space [minX, maxX, minY, maxY, minZ, maxZ]
{
"status": 200,
"message": "OK",
"data": {
"id": "368614a6-c256-489d-a221-a66f9da80662",
"packing_batch_id": "3d174e56-6e8c-4289-ae02-5f1c8b5564b1",
"client_packer_id": "opera_1",
"packer_type": "dynamic",
"client_container_id": "manual 5",
"order_id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"length": 545,
"width": 460,
"height": 250,
"weight": 5560,
"boxes": [
{
"product_id": "PRODUCT_xyz_0123",
"boundaries": [-440, 0, 0, 85, 0, 250]
},
{
"product_id": "PRODUCT_xyz_0005",
"boundaries": [0, 80, 0, 80, 0, 260]
}
]
}
}
{
"status": 404,
"message": "Not Found"
}
{
"status": 401,
"message": "Unauthorized Access"
}
/pack
Create order and calculate packing in a single synchronous request. This endpoint combines the functionality of /orders and /packings/batches APIs into one blocking call that returns the complete packing result. The request will wait until the calculation is finished.
Note: This endpoint creates order, batch, packing and containers the same way as the asynchronous flow. All data is persisted and can be accessed via other APIs afterwards.
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
- order object, required Order data (same structure as POST /orders body)
client_order_id: ORDER_xyz_123 string, required Unique order id defined by client- products array, fixed-type, required List of all order products
- object
product_id: PRODUCT_xyz_123 string, required Unique product id- length: 450 number, required Product length in mm
- width: 330 number, required Product width in mm
- height: 220 number, required Product height in mm
- amount: 1 number, required Product amount
- weight: 300 number, required Product weight in g
- compatibility object, optional Object that defines compatibility between product <-> product and product <-> container
- object
- packers array, fixed-type, required Priority stack of packers (same structure as POST /packings/batches body)
{
"order": {
"client_order_id": "ORDER_xyz_123",
"products": [
{
"product_id": "PRODUCT_xyz_0123",
"length": 450,
"width": 330,
"height": 220,
"amount": 1,
"weight": 300
}
]
},
"packers": [
{
"client_packer_id": "opera_1",
"packer_type": "dynamic",
"max_container_length": 600,
"max_container_width": 500,
"max_container_height": 440,
"max_box_count_per_container": 5,
"box_allow_rotation": false
}
]
}
- data object Complete packing result
- order object Created order data
id:35e2c2bc-fef6-4848-8939-902dec4f712fstring Internal order IDclient_order_id: ORDER_xyz_123 string Order id set by client- products array List of order products
- batch object Batch data
id:3d174e56-6e8c-4289-ae02-5f1c8b5564b1string Packing batch idorder_id:35e2c2bc-fef6-4848-8939-902dec4f712fstring Internal order idclient_order_id: ORDER_xyz_123 string Order id set by clientpacking_id:sd54a6-x54e6-5486-cd85-ca5v4bt321cvstring Packing id- status: done string Batch status
- packing object Packing result
id:sd54a6-x54e6-5486-cd85-ca5v4bt321cvstring Packing idorder_id:35e2c2bc-fef6-4848-8939-902dec4f712fstring Order idclient_order_id: ORDER_xyz_123 string Order id set by client- containers array List of packed containers
not_packed_boxesarray List of boxes which were not packed
- order object Created order data
{
"status": 200,
"message": "OK",
"data": {
"order": {
"id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"products": [
{
"product_id": "PRODUCT_xyz_0123",
"length": 450,
"width": 330,
"height": 220,
"amount": 1,
"weight": 300
}
]
},
"batch": {
"id": "3d174e56-6e8c-4289-ae02-5f1c8b5564b1",
"order_id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"packing_id": "sd54a6-x54e6-5486-cd85-ca5v4bt321cv",
"status": "done",
"created_ts": 1653250645750,
"started_ts": 1653250645800,
"finished_ts": 1653250646100
},
"packing": {
"id": "sd54a6-x54e6-5486-cd85-ca5v4bt321cv",
"order_id": "35e2c2bc-fef6-4848-8939-902dec4f712f",
"client_order_id": "ORDER_xyz_123",
"containers": [
{
"container_id": "368614a6-c256-489d-a221-a66f9da80662",
"client_packer_id": "opera_1",
"packer_type": "dynamic",
"length": 450,
"width": 330,
"height": 220,
"weight": 300,
"boxes": [
{
"product_id": "PRODUCT_xyz_0123",
"amount": 1
}
]
}
],
"not_packed_boxes": []
}
}
}
{
"status": 400,
"message": "Bad Request | Missing 'order' attribute"
}
{
"status": 401,
"message": "Unauthorized Access"
}
Returned when client closes connection before calculation is finished.
{
"status": 499,
"message": "Client Closed Request"
}
Returned when an error occurs during packing calculation.
{
"status": 500,
"message": "error | <error details>",
"batch": { ... }
}
/displays
Get list of dislays. Display is a device that renders packings.
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
- data array, fixed-type, required Packing data
- object
id:5080e4d6-57e4-497c-9c79-d77bc20689e2string Display ID.name:Opera 1 displaystring Display name or identificator.status: online enum Display device connectivity status.- online There is an active data connection between server and display device.
- offline Device is offline.
last_online_status_ts: 1653250645750 string, optional UTC timestamp of the last online status. Status is checked regularly.last_shown_packing_id:f9a8a173-ada6-445f-98fe-4ad77bb9614dstring, optional The packing ID that was last shown on display.
- object
{
"status": 200,
"message": "OK",
"data": [
{
"id": "5080e4d6-57e4-497c-9c79-d77bc20689e2",
"name": "Opera 1 display",
"status": "online",
"last_online_status_ts": 1653250645750,
"last_shown_packing_id": "f9a8a173-ada6-445f-98fe-4ad77bb9614d"
}
]
}
{
"status": 401,
"message": "Unauthorized Access"
}
/displays/{display_id}/show
Show container detail on the display device identified by its ID.
- display_id Display device ID
Basic Authorization header containing <username>:<password> or Token:<access_token> information
Authorization: Basic VG9rZW46aXpmdnN0ZzM2NTR6M2NmdmU2YzV6NGN6Ng==
container_id:5080e4d6-57e4-497c-9c79-d77bc20689e2string, required ID of the container that is to be shown on display.- username: Peter string, required Name or client specific user ID.
- info_1: 112 string, optional Optional information shown on display. User daily statistics is shown if this parameter is not provided.
- info_2: 105 string, optional Optional information shown on display. Hidden if not provided.
{
"container_id": "f9a8a173-ada6-445f-98fe-4ad77bb9614d",
"username": "Peter",
"info_1": "112",
"info_2": "105"
}
- data object Stored order data
- delivery: shown enum Status of the request delivery to the display..
- shown Request has been delivered and shown on the display device.
- ongoing Request has not been yet delivered to the display device - it is offline or its internet connectivity is slow.
- delivery: shown enum Status of the request delivery to the display..
{
"status": 201,
"message": "Received",
"data": {
"delivery": "shown"
}
}
{
"status": 400,
"message": "Bad Request | Missing 'packing_id' attribute"
}
{
"status": 401,
"message": "Unauthorized"
}
{
"status": 404,
"message": "Not Found"
}