OS1 Services
...
Container
Integrate with Containers

How to: Create a Container type

4min

For information about prerequisites, see Creating Containers.

Containers have two modes leaf: and non-leaf:

  • Leaf Containers cannot contain other Containers.
  • Non-leaf Containers can contain other Containers.

To add a Container type, call the Create Container Type endpoint.

In the response body, the required member elements are:

Parameter

Description

Remarks

name

A unique name that represents the container type.

Container type names consist of upper and lower case alpha characters. The minimum length is 3 characters and the maximum length is 64 characters.

You use the isLeaf member to specify that the Container can contain other Containers. The isLeaf member is not required when creating a Container Type. If it is omitted, the default value of false is used during the creation, and the Containers created using the type cannot contain other Containers.

The Container API is asynchronous and event-driven. When creating a Container Type, we recommend that you specify a callback URL on which you can receive a notification of the success of the creation of the Container Type and notifications of the success of operations performed on Containers based on the Type.

To create a leaf Container, you must include the isLeaf member and set it to true.

For illustration purposes, this how-to uses the example of a pallet and a box.

📘 Once created, Container types cannot be deleted. Keep this in mind when you are creating Container types for the purpose of testing.

To create a non-leaf Container, call the Create Container Type and pass a request body similar to the following:

JSON


The response body will be similar to the following and returns the Container Type ID as id in the data object.

JSON


To create a leaf Container, call the Create Container Type endpoint and pass a request body similar to the following:

JSON


The response body will be similar to the following and returns the Container Type ID as id in the data object.

JSON