Shipment Templates

Shipment Templates are a core part of the Tive Shipment workflow that make it easier to create shipments for commonly used shipping lanes. Templates can provide a standardized way to specify shipping details and alert preset(s) that are used across many shipments.

Creating Shipments with Templates

Creating a shipment with a template is a two step process. First, you will need to retrieve the template data via the list shipment template or retrieve a shipment template endpoint.

//GET https://api.tive.com/public/v3/shipmentTemplates

{
  "totalRecords": 1,
  "pageNumber": 1,
  "pageSize": 50,
  "data": [
    {
      "shipmentTemplateId": 1234,
      "name": "My Example Shipment Template",
      "description": "Shows an example format of a shipment template",
      "isDefaultTemplate": false,
      "autoCompleteMinutesDelay": 1440,
      "customFields": [
        {
          "key": "Purchase Order",
          "value": null
        }
      ],
      "shipmentLegs": [
        {
          "mode": "Road",
          "carrierId": null,
          "containerId": null,
          "airWaybill": null,
          "fromCoordinates": {
            "latitude": 42.3807959,
            "longitude": -71.0797724
          },
          "fromAddress": {
            "street": "56 Roland St Suite 100A",
            "sublocality": null,
            "locality": "Boston",
            "state": "Massachusetts",
            "country": "United States",
            "zipCode": "02129"
          },
          "toCoordinates": {
            "latitude": 42.3604065,
            "longitude": -71.0577624
          },
          "toAddress": {
            "street": "1 City Hall Square",
            "sublocality": null,
            "locality": "Boston",
            "state": "Massachusetts",
            "country": "United States",
            "zipCode": "02201"
          },
          "orderNo": 1,
          "legLabel": "My Custom Leg Name",
          "alertPresetIds": [
            123456
          ]
        }
      ]
    }
  ]
}

With the template data in hand, it can subsequently be used for a Create a Shipment endpoint request.

Please note, shipment templates only require a template name and mode for each shipment leg specified for creation. As such, if you are creating a shipment with a template, you will still have to provide any required fields that were not specified in the template as well as a ShipmentId and shipFromDate as they cannot be specified on templates.

Additionally, any further changes you make to the request body when creating a shipment will only be implemented on that particular shipment. Customizing shipment details for a particular shipment will not change the template.

To view more details on API shipment creation please visit the Create a Shipment user guide.


What’s Next