Skip to content

Adds a new TransportOrder

Request

Security
BearerToken
Bodyapplication/json
entityTypestring
Value:"transportOrder"
Example:"transportOrder"
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.

Example:"baa507c2-1d81-4092-a5c2-e80820ee4fd1"
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

External attributes are a simple way to add information in an OpenTripModel message that could not fit into one of the OTM fields otherwise. The externalAttributes member is meant for additional meta data and/or additional ID's of an entity. This can also help to identify an OTM entity in a system by the ID of that system.

Please, use this with caution: having too many external attributes can be a sign of not using OpenTripModel as it was intended.

Example:
{ "id": "OrderId" }
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

A free text description of this transport order, e.g. boxes of fruit ordered by Simacan.

Example:"Transport order containing all consignments to be shipped."
consignmentsArray of any

All consignments belonging to this transport order.

Example:
[ { "entity": { … }, "associationType": "inline" }, { "entity": { … }, "associationType": "inline" } ]
actorsArray of any

The actors associated with this transport order, for instance the consignor, consignee.

constraintany
curl -i -X PUT \
  https://otm-api-spec.redocly.app/_mock/api/5.9/otm/api/v5/transportOrders \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "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"
      }
    ]
  }'

Responses

The same entity

Bodyapplication/json
entityTypestring
Value:"transportOrder"
Example:"transportOrder"
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.

Example:"baa507c2-1d81-4092-a5c2-e80820ee4fd1"
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

External attributes are a simple way to add information in an OpenTripModel message that could not fit into one of the OTM fields otherwise. The externalAttributes member is meant for additional meta data and/or additional ID's of an entity. This can also help to identify an OTM entity in a system by the ID of that system.

Please, use this with caution: having too many external attributes can be a sign of not using OpenTripModel as it was intended.

Example:
{ "id": "OrderId" }
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

A free text description of this transport order, e.g. boxes of fruit ordered by Simacan.

Example:"Transport order containing all consignments to be shipped."
consignmentsArray of any

All consignments belonging to this transport order.

Example:
[ { "entity": { … }, "associationType": "inline" }, { "entity": { … }, "associationType": "inline" } ]
actorsArray of any

The actors associated with this transport order, for instance the consignor, consignee.

constraintany
Response
{ "id": "baa507c2-1d81-4092-a5c2-e80820ee4fd1", "externalAttributes": { "id": "OrderId" }, "description": "Transport order containing all consignments to be shipped.", "consignments": [ { … }, { … } ] }