# Line Items

This section provides information on how line items work in both the load and the quote.

To make a request for line items, you'll need the following path parameter:

load_id: Data type string representing the load related to line items, max length 18 and min length 15.

Here's a description of each data type and its properties related to line items in the load::

handling_unit_count: Data type number with the number of items for that handling unit. handling_units: Data type string referring to any packaging unit and the goods it contains
length: Data type a decimal with length dimensions.
width: Data type a decimal with width dimensions.
height: Data type a decimal with width height.
weight: Data type a weight with width height.
description: Data type string with a brief description of the item.
hazardous_materials: Data type boolean that indicates whether the element is hazardous or not.
stackable: Data type boolean that indicates whether the element is stackable or not.

Caution

If you want to create or update an item with hazardous_materials, the load must have a hazmat accessorial otherwise, the endpoint responds with an error.

# Error response:

{
  "message": "the line item was selected as hazardous material, please add the Hazardous Material Handling accessory to the load."
}
✏️ Important information

The propertiedelete, indicates if the load quotation has been deleted and should be re-quoted.

# Create line item

The following is the path param required to create a line item in a load:

load_id: Data type string representing the load related to line items.

Make a POST request with the required object to the following endpoint:


POST /api/v1/line-items/{load_id}

DEV URL: https://dev.webservices.goglt.com/api/v1/line-items/{load_id}

PROD URL: https://webservices.goglt.com/api/v1/line-items/{load_id}

# Request

This is a code with real data to create a line item in a load.


{
  [
    {
    "handling_unit_count": 1,
    "length": 10,
    "width": 10,
    "height": 10,
    "weight": 10,
    "description": "test",
    "hazardous_materials": false,
    "stackable": true
    }
  ]
}

# Response


{
   "line_items":[
      {
         "name":"Item 1",
         "description":"test",
         "dimension_units":null,
         "handling_unit_count":1,
         "handling_units":null,
         "height":10,
         "length":10,
         "linear_feet":"0.01",
         "nmfc_class":null,
         "weight_units":null,
         "weight":10,
         "width":10,
         "pickup_stop":"a0t7A0000029qzTQAQ",
         "delivery_stop":"a0t7A0000029qzYQAQ",
         "hazardous_materials":false,
         "hazmat_class_division":null,
         "hazmat_number_type":null,
         "hazmat_number":null,
         "hazmat_packaging_group":null,
         "nmfc_number":null,
         "packaging_unit_count":null,
         "packaging_units":null,
         "hu_cube":null,
         "stackable":false,
         "id":"a0g7A000001ciDYQAY",
         "load_id":"a0j7A000007bKl8QAE",
         "hazmat_contact":null
      }
   ],
   "content":"due to the update of the line items the quotation associated with the load has been removed,\n please make a re-quote.",
   "delete":true
}

# Update line item

The following is the path param required to update a line item in a load:

load_id: Data type string representing the load related to line items.

Make a PATCH request with the required object to the following endpoint:


PATCH /api/v1/line-items/{load_id}

DEV URL: https://dev.webservices.goglt.com/api/v1/line-items/{load_id}

PROD URL: https://webservices.goglt.com/api/v1/line-items/{load_id}

To update the line items in a load, the id field and the fields to be modified are needed.

# Request


{
  [
    {
      "id": "a0g7A000001ciDYQAY",
      "description": "Change the line item description.",
    }
  ]
}

# Response

{
   "line_items":[
      {
         "name":"Item 1",
         "description":"Change the line item description.",
         "dimension_units":null,
         "handling_unit_count":1,
         "handling_units":null,
         "height":10,
         "length":10,
         "linear_feet":"0.01",
         "nmfc_class":null,
         "weight_units":null,
         "weight":10,
         "width":10,
         "pickup_stop":"a0t7A0000029qzTQAQ",
         "delivery_stop":"a0t7A0000029qzYQAQ",
         "hazardous_materials":false,
         "hazmat_class_division":null,
         "hazmat_number_type":null,
         "hazmat_number":null,
         "hazmat_packaging_group":null,
         "nmfc_number":null,
         "packaging_unit_count":null,
         "packaging_units":null,
         "hu_cube":null,
         "stackable":false,
         "id":"a0g7A000001ciDYQAY",
         "load_id":"a0j7A000007bKl8QAE",
         "hazmat_contact":null
      }
   ],
   "delete":false
}

# Delete a line item

The following is the path param required to delete a line item in a load:

The path params to delete a line item:

load_id: Data type string representing the load related to line items.
line_item_id: Data type string that represents the line item to be delete.

Make a DELETE request with the required object to the following endpoint:


DELETE /api/v1/line-items/{load_id}

DEV URL: https://dev.webservices.goglt.com/api/v1/line-items/{load_id}

PROD URL: https://webservices.goglt.com/api/v1/line-items/{load_id}

# Request

{
  "line_item_id": "a0g7A000001ciDYQAY",
  "load_id": "a0j7A000007bKl8QAE",
}

# Response


{
  "line_item": "a0g7A000001ciDYQAY",
  "content": "The line item was deleted succefull.",
  "delete": true,
}