Supported Formats

json

GET /api/v1/bill_of_ladings/:id/line_items.json
Returns a list of line items on a Bill of Lading.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/bill_of_ladings/:id/line_items.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=ADD TOKEN HERE"
{
  "line_items": [
    {
      "id": 1211,
      "container_id": 1902,
      "quantity": 1.0,
      "container_number": "ABC123",
      "cargo_type": "container",
      "container_type_label": "20DV",
      "container_weight": 4000,
      "container_weight_unit": "kg"
      "flex_fields": [
        {
          label: "flex_field_label",
          value: "flex_field_value"
        }
      ]
    }
  ],
  "actions" : {
    "next_page" : {
        "method" : "GET",
        "url" : "https://app.octopi.co/api/v1/bill_of_ladings/:id/line_items.json?page=2&per=10"
    }
  }
}

Params

Param name Description
page
optional

Indicates which page of results to fetch. The default is 1.

Validations:

  • Must be a number.

per
optional

The number of items to be displayed per page. This default is 10 and the maximum allowed value is 100.

Validations:

  • Must be a number.


POST /api/v1/bill_of_ladings/:id/line_items.json
Creates a Line Item for a Bill of Lading with given ID

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/bill_of_ladings/:id/line_items.json" -d '{ "line_item": { "container_id": 123456789, "container_type_label": "40DV", "container_weight": 4000.0, "container_weight_unit": "kg", "flex_fields": [{ "label": "flex_field_label", "value": "flex_field_value"}] } }' -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
  "id": 38,
  "container_id": 123456789,
  "quantity": 1.0,
  "container_number": "OCTO1231239",
  "cargo_type": "container",
  "container_type_label": "40DV",
  "container_weight": 4000.0,
  "container_weight_unit": "kg",
  "flex_fields": [
    {
      "label": "flex_field_label",
      "value": "flex_field_value"
    }
  ]
}

Params

Param name Description
id
required

Validations:

  • Must be a number.

line_item
optional

Validations:

  • Must be a Hash

line_item[container_id]
required

an id of the container to be assigned to the BL line item, required, the container must belong to the organization

Validations:

  • Must be a number.

line_item[container_type_label]
optional

Container Type label to be assigned to the Line Item. Can be one of the container types defined by the organization.

Validations:

  • Must be a String

line_item[container_weight]
optional

Weight of the Bill of Lading line item

Validations:

  • Must be a decimal number.

line_item[container_weight_unit]
optional

Unit to be used for the Bill of Lading weight

Validations:

  • Must be a String

line_item[flex_fields]
optional

Validations:

  • Must be an Array of nested elements

line_item[flex_fields][label]
optional

The name of the flex field

Validations:

  • Must be a String

line_item[flex_fields][value]
optional

The value of the flex field

Validations:

  • Must be a String


PATCH /api/v1/bill_of_ladings/:bill_of_lading_id/line_items/:id
Updates one Line Item with given ID for a Bill of Lading with bill_of_lading_id

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/bill_of_ladings/:bill_of_lading_id/line_items/:id.json" -d '{ "line_item": { "container_id": 123456789, "container_type_label": "40DV", "container_weight": 4200.0, "container_weight_unit": "kg", "flex_fields": [{ "label": "flex_field_label", "value": "flex_field_value"}] } }' -X PATCH -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
  "id": 38,
  "container_id": 123456789,
  "quantity": 1.0,
  "container_number": "OCTO1231239",
  "cargo_type": "container",
  "container_type_label": "40DV",
  "container_weight": 4200.0,
  "container_weight_unit": "kg",
  "flex_fields": [
    {
      "label": "flex_field_label",
      "value": "flex_field_value"
    }
  ]
}

Params

Param name Description
bill_of_lading_id
required

Validations:

  • Must be a number.

id
required

Validations:

  • Must be a number.

line_item
optional

Validations:

  • Must be a Hash

line_item[container_id]
optional

An ID of the container that will assigned to the Line Item.

Validations:

  • Must be a number.

line_item[container_type_label]
optional

Container Type label assigned to the Line Item. Can be one of the container types defined by the organization.

Validations:

  • Must be a String

line_item[container_weight]
optional

Validations:

  • Must be a decimal number.

line_item[container_weight_unit]
optional

Validations:

  • Must be one of: lb, kg.

line_item[flex_fields]
optional

Validations:

  • Must be an Array of nested elements

line_item[flex_fields][label]
optional

The name of the flex field

Validations:

  • Must be a String

line_item[flex_fields][value]
optional

The value of the flex field

Validations:

  • Must be a String


DELETE /api/v1/bill_of_ladings/:bill_of_lading_id/line_items/:id
Deletes the given bill of lading line item

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/bill_of_ladings/:bill_of_lading_id/line_items/:id.json'" -X DELETE -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"

Params

Param name Description
bill_of_lading_id
required

The bill of lading ID

Validations:

  • Must be a number.

id
required

The bill of lading line item ID

Validations:

  • Must be a number.