Skip to content

Adds a new Consignment

Request

Security
BearerToken
Bodyapplication/json
entityTypestring
Value:"consignment"
Example:"consignment"
idstring

Uniquely identifies this entity. A URI can be assigned by the client to indicate where more information can be retrieved. Note that every entity always has a unique EntityId. However since, OTM5.2 it is not required to send it in the request. One can be generated for you by the server.

namestring

Name of the entity. For display purposes and search only.

creationDatestring, (date-time)

The creation date of this entity.

lastModifiedstring, (date-time)

The last modified date of this entity. If none is given the creation date is used instead.

contextEventsArray of any(event)

The context events provides some optional information about the events that can provide additional information on the current state of this entity.

For example: your system might send ETA information for the arrival of a vehicle on a location. To make it clear what caused this ETA to be updated, we can include some information about what caused this ETA update by including an event as context. If your ETA update was caused by a location update, this event can be included as context. If the ETA was caused by a traffic accident on the route of the vehicle, you can include that event in the context.

externalAttributesobject
externalIdentifiersArray of objects(externalIdentifiers)

Standardized identifiers of this entity as known in external systems. Use this to exchange repeatable partner or system specific identifiers without overloading externalAttributes.

Example:
[ { "id": "AAA", "scheme": "CAS" } ]
descriptionstring

General description of consignment in Free text. e.g 20 europallets fruit. Meant for human inspection, not for automating processes.

statusstring(status)

Status defines whether this entity (e.g. trip or consignment) is a draft, requested, confirmed, in transit, completed, closed, rejected or cancelled. Status closed is about administrative closure, while completed is about the realization of e.g. a trip or consignment. A trip or consignment can be completed but not closed yet, e.g. when the invoice has not been paid yet. The values accepted (replaced by confirmed) and modified (replaced the lastModified field on every entity) are deprecated since OTM5.1, but will be supported for the whole OTM5.X line.

Enum:"draft""requested""rejected""confirmed""inTransit""completed""closed""cancelled""accepted""modified"
typestring

Free text to describe type of consignment. Usually used to indicate the property types of the products being transported (e.g. frozen, fragile, etc.).

goodsArray of any

The various goods that need to be transported, together they are part of this consignment.

transportOrderany
documentsArray of any

Documents that are relevant for this consignment. Such as an official agreement between consignee and consignor.

remarkstring

Remark concerning the complete consignment, to be printed on the transport document.

actorsArray of any

The actors associated with this consignment, for instance the shipper and carrier. One should inline the actors only on the top-level entity (such as the transportOrder or trip)

actionsArray of any(action-association)

General description of actions related to the consignment f.e. loading, unloading, hand over, drop of.

constraintany
relatedConsignmentsArray of any

Consignments that have replaced the current consignment. Because of various reasons a consignment can be cancelled and replaced by one or more other consignments. An example is that the consignment is too large to be transported as a single 'transportable unit'. You can use the relation field in the association to indicate the type of relationship.

curl -i -X PUT \
  https://otm-api-spec.redocly.app/_mock/api/5.9/otm/api/v5/consignments \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "entityType": "consignment",
    "id": "string",
    "name": "string",
    "creationDate": "2019-08-24T14:15:22Z",
    "lastModified": "2019-08-24T14:15:22Z",
    "contextEvents": [
      {
        "id": "fc6b2b0c-2f0a-40c6-a580-212c5c7984c8",
        "name": "couple vehicle to trip",
        "lifecycle": "planned",
        "entity1": {
          "uuid": "50824123-0924-4563-ac1e-ca0e37487823",
          "entityType": "trip",
          "associationType": "reference"
        },
        "entity2": {
          "entity": {
            "id": "b9bb914d-845e-46f2-91ff-31fa4bac2fbe",
            "name": "Bob'\''s Boxtruck",
            "vehicleType": "boxtruck",
            "fuel": "electricity",
            "loadCapacities": [
              {
                "value": 1000,
                "unit": "kg"
              }
            ],
            "length": {
              "value": 8,
              "unit": "m"
            },
            "height": {
              "value": 2.8,
              "unit": "m"
            },
            "width": {
              "value": 2,
              "unit": "m"
            },
            "licensePlate": "AB-12-CD",
            "emptyWeight": {
              "value": 2000,
              "unit": "kg"
            },
            "entityType": "vehicle"
          },
          "associationType": "inline"
        },
        "eventType": "associationCreatedEvent"
      }
    ],
    "externalAttributes": {
      "property1": {},
      "property2": {}
    },
    "externalIdentifiers": [
      {
        "id": "AAA",
        "scheme": "CAS"
      }
    ],
    "description": "string",
    "status": "draft",
    "type": "string",
    "goods": [
      {
        "associationType": "inline",
        "entity": {
          "id": "903807df-ee62-47aa-bf8e-7efd747618ce",
          "entityType": "goods",
          "type": "items",
          "description": "Box of bananas",
          "remark": "Please deliver in time, we want fresh bananas",
          "barCode": "CSE370",
          "productType": "Fruit",
          "packagingMaterial": "Box",
          "constraint": {
            "entity": {
              "value": {
                "and": [
                  {
                    "startTime": "2021-06-23T10:00:00Z",
                    "endTime": "2021-06-23T13:00:00Z",
                    "description": "alert-threshold",
                    "type": "timeWindowConstraint"
                  },
                  {
                    "constraintType": "maximum",
                    "maximum": {
                      "value": 5,
                      "unit": "C"
                    },
                    "type": "temperatureConstraint"
                  },
                  {
                    "or": [
                      {
                        "fuelTypes": [
                          "battery"
                        ],
                        "type": "fuelTypeConstraint"
                      },
                      {
                        "fuelTypes": [
                          "biodiesel"
                        ],
                        "type": "fuelTypeConstraint"
                      },
                      {
                        "minimum": "euro5",
                        "type": "emissionStandardConstraint"
                      }
                    ],
                    "type": "orConstraint"
                  }
                ],
                "type": "andConstraint"
              }
            },
            "associationType": "inline"
          }
        },
        "description": "string"
      }
    ],
    "transportOrder": {
      "associationType": "inline",
      "entity": {
        "id": "baa507c2-1d81-4092-a5c2-e80820ee4fd1",
        "externalAttributes": {
          "id": "OrderId"
        },
        "description": "Transport order containing all consignments to be shipped.",
        "consignments": [
          {
            "entity": {
              "id": "e75a541b-e9d9-49e7-8bba-95492d682a6c",
              "description": "Package for miss X."
            },
            "associationType": "inline"
          },
          {
            "entity": {
              "id": "4a08bd61-720e-4a8c-81cf-028f1271c4da",
              "description": "Package for mr Y."
            },
            "associationType": "inline"
          }
        ]
      },
      "description": "string"
    },
    "documents": [
      {
        "associationType": "inline",
        "entity": {
          "id": "cf32da57-5edc-4c46-9a97-58c97ae27cf8",
          "name": "Photo of the PoD",
          "content": {
            "uri": "https://link-to-the-actual-document.org/1234",
            "contentType": "link"
          },
          "externalAttributes": {
            "externalID": "photo1234"
          },
          "documentType": "photo",
          "filename": "my_photo.JPG",
          "mimeType": "image/jpeg",
          "description": "Proof that the goods are delivered by providing the photo that captures the moment",
          "creator": {
            "uuid": "655a2a4e-79b1-4637-9f13-b904730022ef",
            "entityType": "actor",
            "associationType": "reference"
          },
          "owner": {
            "uuid": "655a2a4e-79b1-4637-9f13-b904730022ef",
            "entityType": "actor",
            "associationType": "reference"
          }
        },
        "description": "string"
      }
    ],
    "remark": "string",
    "actors": [
      {
        "associationType": "inline",
        "entity": {
          "id": "45db6ed0-28a7-4e4a-baba-3d5f8d171103",
          "name": "Logistics manager",
          "contactDetails": [
            {
              "value": "Simon Isaac",
              "remark": "Wants to be called '\''Sim'\''.",
              "type": "firstName"
            },
            {
              "value": "Macan",
              "type": "lastName"
            },
            {
              "value": "+312012345678",
              "remark": "private cellphone of the CEO",
              "language": "nld",
              "type": "phone"
            },
            {
              "value": "simon@macan",
              "type": "email"
            },
            {
              "value": "NL74BANK5890469479",
              "type": "iban"
            },
            {
              "value": "NL000099998B57",
              "type": "vatCode"
            }
          ],
          "type": "person",
          "firstName": "string",
          "lastName": "string",
          "role": "string",
          "department": "string",
          "languages": [
            "nld"
          ]
        },
        "description": "string",
        "roles": [
          "shipper"
        ]
      }
    ],
    "actions": [
      {
        "associationType": "inline",
        "entity": {
          "id": "e81a7aa3-23a6-4089-b916-52b854c7b6f1",
          "lifecycle": "planned",
          "remark": "loading a consignment",
          "consignment": {
            "uuid": "047cfa4d-fd8b-47ba-b8e9-87067294d2fa",
            "entityType": "consignment",
            "associationType": "reference"
          },
          "startTime": "2021-06-23T14:00:00Z",
          "endTime": "2021-06-23T14:15:00Z",
          "constraint": {
            "entity": {
              "id": "89a7bb4d-8720-4db9-aef7-4c3309186c3e",
              "name": "Example combined constraint",
              "value": {
                "and": [
                  {
                    "startTime": "2021-06-23T10:00:00Z",
                    "endTime": "2021-06-23T13:00:00Z",
                    "description": "alert-threshold",
                    "type": "timeWindowConstraint"
                  },
                  {
                    "constraintType": "maximum",
                    "maximum": {
                      "value": 5,
                      "unit": "C"
                    },
                    "type": "temperatureConstraint"
                  },
                  {
                    "or": [
                      {
                        "fuelTypes": [
                          "battery"
                        ],
                        "type": "fuelTypeConstraint"
                      },
                      {
                        "fuelTypes": [
                          "biodiesel"
                        ],
                        "type": "fuelTypeConstraint"
                      },
                      {
                        "minimum": "euro5",
                        "type": "emissionStandardConstraint"
                      }
                    ],
                    "type": "orConstraint"
                  }
                ],
                "type": "andConstraint"
              }
            },
            "associationType": "inline"
          },
          "actionType": "load"
        },
        "description": "string"
      }
    ],
    "constraint": {
      "associationType": "inline",
      "entity": {
        "id": "89a7bb4d-8720-4db9-aef7-4c3309186c3e",
        "name": "Example combined constraint",
        "value": {
          "and": [
            {
              "startTime": "2021-06-23T10:00:00Z",
              "endTime": "2021-06-23T13:00:00Z",
              "description": "alert-threshold",
              "type": "timeWindowConstraint"
            },
            {
              "constraintType": "maximum",
              "maximum": {
                "value": 5,
                "unit": "C"
              },
              "type": "temperatureConstraint"
            },
            {
              "or": [
                {
                  "fuelTypes": [
                    "battery"
                  ],
                  "type": "fuelTypeConstraint"
                },
                {
                  "fuelTypes": [
                    "biodiesel"
                  ],
                  "type": "fuelTypeConstraint"
                },
                {
                  "minimum": "euro5",
                  "type": "emissionStandardConstraint"
                }
              ],
              "type": "orConstraint"
            }
          ],
          "type": "andConstraint"
        }
      },
      "description": "string"
    },
    "relatedConsignments": [
      {
        "associationType": "inline",
        "entity": {
          "entityType": "consignment",
          "id": "string",
          "name": "string",
          "creationDate": "2019-08-24T14:15:22Z",
          "lastModified": "2019-08-24T14:15:22Z",
          "contextEvents": [
            {
              "id": "fc6b2b0c-2f0a-40c6-a580-212c5c7984c8",
              "name": "couple vehicle to trip",
              "lifecycle": "planned",
              "entity1": {
                "uuid": "50824123-0924-4563-ac1e-ca0e37487823",
                "entityType": "trip",
                "associationType": "reference"
              },
              "entity2": {
                "entity": {
                  "id": "b9bb914d-845e-46f2-91ff-31fa4bac2fbe",
                  "name": "Bob'\''s Boxtruck",
                  "vehicleType": "boxtruck",
                  "fuel": "electricity",
                  "loadCapacities": [
                    {
                      "value": 1000,
                      "unit": "kg"
                    }
                  ],
                  "length": {
                    "value": 8,
                    "unit": "m"
                  },
                  "height": {
                    "value": 2.8,
                    "unit": "m"
                  },
                  "width": {
                    "value": 2,
                    "unit": "m"
                  },
                  "licensePlate": "AB-12-CD",
                  "emptyWeight": {
                    "value": 2000,
                    "unit": "kg"
                  },
                  "entityType": "vehicle"
                },
                "associationType": "inline"
              },
              "eventType": "associationCreatedEvent"
            }
          ],
          "externalAttributes": {
            "property1": {},
            "property2": {}
          },
          "externalIdentifiers": [
            {
              "id": "AAA",
              "scheme": "CAS"
            }
          ],
          "description": "string",
          "status": "draft",
          "type": "string",
          "goods": [
            {
              "associationType": "inline",
              "entity": {
                "id": "903807df-ee62-47aa-bf8e-7efd747618ce",
                "entityType": "goods",
                "type": "items",
                "description": "Box of bananas",
                "remark": "Please deliver in time, we want fresh bananas",
                "barCode": "CSE370",
                "productType": "Fruit",
                "packagingMaterial": "Box",
                "constraint": {
                  "entity": {
                    "value": {
                      "and": [
                        {
                          "startTime": "2021-06-23T10:00:00Z",
                          "endTime": "2021-06-23T13:00:00Z",
                          "description": "alert-threshold",
                          "type": "timeWindowConstraint"
                        },
                        {
                          "constraintType": "maximum",
                          "maximum": {
                            "value": 5,
                            "unit": "C"
                          },
                          "type": "temperatureConstraint"
                        },
                        {
                          "or": [
                            {
                              "fuelTypes": [
                                "battery"
                              ],
                              "type": "fuelTypeConstraint"
                            },
                            {
                              "fuelTypes": [
                                "biodiesel"
                              ],
                              "type": "fuelTypeConstraint"
                            },
                            {
                              "minimum": "euro5",
                              "type": "emissionStandardConstraint"
                            }
                          ],
                          "type": "orConstraint"
                        }
                      ],
                      "type": "andConstraint"
                    }
                  },
                  "associationType": "inline"
                }
              },
              "description": "string"
            }
          ],
          "transportOrder": {
            "associationType": "inline",
            "entity": {
              "id": "baa507c2-1d81-4092-a5c2-e80820ee4fd1",
              "externalAttributes": {
                "id": "OrderId"
              },
              "description": "Transport order containing all consignments to be shipped.",
              "consignments": [
                {
                  "entity": {
                    "id": "e75a541b-e9d9-49e7-8bba-95492d682a6c",
                    "description": "Package for miss X."
                  },
                  "associationType": "inline"
                },
                {
                  "entity": {
                    "id": "4a08bd61-720e-4a8c-81cf-028f1271c4da",
                    "description": "Package for mr Y."
                  },
                  "associationType": "inline"
                }
              ]
            },
            "description": "string"
          },
          "documents": [
            {
              "associationType": "inline",
              "entity": {
                "id": "cf32da57-5edc-4c46-9a97-58c97ae27cf8",
                "name": "Photo of the PoD",
                "content": {
                  "uri": "https://link-to-the-actual-document.org/1234",
                  "contentType": "link"
                },
                "externalAttributes": {
                  "externalID": "photo1234"
                },
                "documentType": "photo",
                "filename": "my_photo.JPG",
                "mimeType": "image/jpeg",
                "description": "Proof that the goods are delivered by providing the photo that captures the moment",
                "creator": {
                  "uuid": "655a2a4e-79b1-4637-9f13-b904730022ef",
                  "entityType": "actor",
                  "associationType": "reference"
                },
                "owner": {
                  "uuid": "655a2a4e-79b1-4637-9f13-b904730022ef",
                  "entityType": "actor",
                  "associationType": "reference"
                }
              },
              "description": "string"
            }
          ],
          "remark": "string",
          "actors": [
            {
              "associationType": "inline",
              "entity": {
                "id": "45db6ed0-28a7-4e4a-baba-3d5f8d171103",
                "name": "Logistics manager",
                "contactDetails": [
                  {
                    "value": "Simon Isaac",
                    "remark": "Wants to be called '\''Sim'\''.",
                    "type": "firstName"
                  },
                  {
                    "value": "Macan",
                    "type": "lastName"
                  },
                  {
                    "value": "+312012345678",
                    "remark": "private cellphone of the CEO",
                    "language": "nld",
                    "type": "phone"
                  },
                  {
                    "value": "simon@macan",
                    "type": "email"
                  },
                  {
                    "value": "NL74BANK5890469479",
                    "type": "iban"
                  },
                  {
                    "value": "NL000099998B57",
                    "type": "vatCode"
                  }
                ],
                "type": "person",
                "firstName": "string",
                "lastName": "string",
                "role": "string",
                "department": "string",
                "languages": [
                  null
                ]
              },
              "description": "string",
              "roles": [
                "shipper"
              ]
            }
          ],
          "actions": [
            {
              "associationType": "inline",
              "entity": {
                "id": "e81a7aa3-23a6-4089-b916-52b854c7b6f1",
                "lifecycle": "planned",
                "remark": "loading a consignment",
                "consignment": {
                  "uuid": "047cfa4d-fd8b-47ba-b8e9-87067294d2fa",
                  "entityType": "consignment",
                  "associationType": "reference"
                },
                "startTime": "2021-06-23T14:00:00Z",
                "endTime": "2021-06-23T14:15:00Z",
                "constraint": {
                  "entity": {
                    "id": "89a7bb4d-8720-4db9-aef7-4c3309186c3e",
                    "name": "Example combined constraint",
                    "value": {
                      "and": [
                        {
                          "startTime": "2021-06-23T10:00:00Z",
                          "endTime": "2021-06-23T13:00:00Z",
                          "description": "alert-threshold",
                          "type": "timeWindowConstraint"
                        },
                        {
                          "constraintType": "maximum",
                          "maximum": {
                            "value": 5,
                            "unit": "C"
                          },
                          "type": "temperatureConstraint"
                        },
                        {
                          "or": [
                            {
                              "fuelTypes": [
                                "battery"
                              ],
                              "type": "fuelTypeConstraint"
                            },
                            {
                              "fuelTypes": [
                                "biodiesel"
                              ],
                              "type": "fuelTypeConstraint"
                            },
                            {
                              "minimum": "euro5",
                              "type": "emissionStandardConstraint"
                            }
                          ],
                          "type": "orConstraint"
                        }
                      ],
                      "type": "andConstraint"
                    }
                  },
                  "associationType": "inline"
                },
                "actionType": "load"
              },
              "description": "string"
            }
          ],
          "constraint": {
            "associationType": "inline",
            "entity": {
              "id": "89a7bb4d-8720-4db9-aef7-4c3309186c3e",
              "name": "Example combined constraint",
              "value": {
                "and": [
                  {
                    "startTime": "2021-06-23T10:00:00Z",
                    "endTime": "2021-06-23T13:00:00Z",
                    "description": "alert-threshold",
                    "type": "timeWindowConstraint"
                  },
                  {
                    "constraintType": "maximum",
                    "maximum": {
                      "value": 5,
                      "unit": "C"
                    },
                    "type": "temperatureConstraint"
                  },
                  {
                    "or": [
                      {
                        "fuelTypes": [
                          "battery"
                        ],
                        "type": "fuelTypeConstraint"
                      },
                      {
                        "fuelTypes": [
                          "biodiesel"
                        ],
                        "type": "fuelTypeConstraint"
                      },
                      {
                        "minimum": "euro5",
                        "type": "emissionStandardConstraint"
                      }
                    ],
                    "type": "orConstraint"
                  }
                ],
                "type": "andConstraint"
              }
            },
            "description": "string"
          },
          "relatedConsignments": [
            {
              "associationType": "inline"
            }
          ]
        },
        "description": "string",
        "relation": "split"
      }
    ]
  }'

Responses

The same entity

Bodyapplication/json
entityTypestring
Value:"consignment"
Example:"consignment"
idstring

Uniquely identifies this entity. A URI can be assigned by the client to indicate where more information can be retrieved. Note that every entity always has a unique EntityId. However since, OTM5.2 it is not required to send it in the request. One can be generated for you by the server.

namestring

Name of the entity. For display purposes and search only.

creationDatestring, (date-time)

The creation date of this entity.

lastModifiedstring, (date-time)

The last modified date of this entity. If none is given the creation date is used instead.

contextEventsArray of any(event)

The context events provides some optional information about the events that can provide additional information on the current state of this entity.

For example: your system might send ETA information for the arrival of a vehicle on a location. To make it clear what caused this ETA to be updated, we can include some information about what caused this ETA update by including an event as context. If your ETA update was caused by a location update, this event can be included as context. If the ETA was caused by a traffic accident on the route of the vehicle, you can include that event in the context.

externalAttributesobject
externalIdentifiersArray of objects(externalIdentifiers)

Standardized identifiers of this entity as known in external systems. Use this to exchange repeatable partner or system specific identifiers without overloading externalAttributes.

Example:
[ { "id": "AAA", "scheme": "CAS" } ]
descriptionstring

General description of consignment in Free text. e.g 20 europallets fruit. Meant for human inspection, not for automating processes.

statusstring(status)

Status defines whether this entity (e.g. trip or consignment) is a draft, requested, confirmed, in transit, completed, closed, rejected or cancelled. Status closed is about administrative closure, while completed is about the realization of e.g. a trip or consignment. A trip or consignment can be completed but not closed yet, e.g. when the invoice has not been paid yet. The values accepted (replaced by confirmed) and modified (replaced the lastModified field on every entity) are deprecated since OTM5.1, but will be supported for the whole OTM5.X line.

Enum:"draft""requested""rejected""confirmed""inTransit""completed""closed""cancelled""accepted""modified"
typestring

Free text to describe type of consignment. Usually used to indicate the property types of the products being transported (e.g. frozen, fragile, etc.).

goodsArray of any

The various goods that need to be transported, together they are part of this consignment.

transportOrderany
documentsArray of any

Documents that are relevant for this consignment. Such as an official agreement between consignee and consignor.

remarkstring

Remark concerning the complete consignment, to be printed on the transport document.

actorsArray of any

The actors associated with this consignment, for instance the shipper and carrier. One should inline the actors only on the top-level entity (such as the transportOrder or trip)

actionsArray of any(action-association)

General description of actions related to the consignment f.e. loading, unloading, hand over, drop of.

constraintany
relatedConsignmentsArray of any

Consignments that have replaced the current consignment. Because of various reasons a consignment can be cancelled and replaced by one or more other consignments. An example is that the consignment is too large to be transported as a single 'transportable unit'. You can use the relation field in the association to indicate the type of relationship.

Response
{ "entityType": "consignment", "id": "string", "name": "string", "creationDate": "2019-08-24T14:15:22Z", "lastModified": "2019-08-24T14:15:22Z", "contextEvents": [ { … } ], "externalAttributes": { "property1": {}, "property2": {} }, "externalIdentifiers": [ { … } ], "description": "string", "status": "draft", "type": "string", "goods": [ { … } ], "transportOrder": { "associationType": "inline", "entity": { … }, "description": "string" }, "documents": [ { … } ], "remark": "string", "actors": [ { … } ], "actions": [ { … } ], "constraint": { "associationType": "inline", "entity": { … }, "description": "string" }, "relatedConsignments": [ { … } ] }