Supported Formats

json

GET /api/v1/vehicles.json
Gets a list of vehicles

This API endpoint allows you to fetch information about vehicles.

Supported Formats

json

Errors

Code Description
404 Not found.
400 Bad request.
422 Unprocessable entity.
500 Internal server error.

Examples

curl "https://app.octopi.co/api/v1/vehicles.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR_TOKEN" -d '{ "consignee_id": "ABC DIRECT" }'
{
  "vehicles": [
    {
      "id": 12345,
      "quantity": 1,
      "goods_description": "Toyota Tacoma",
      "arrival_voyage": null,
      "departure_voyage": null,
      "commodity_type": null,
      "consignees": [
        "CAPCOM AUTO SALES"
      ],
      "current_location_type": "Terminal",
      "current_location": "South Terminal",
      "dock_receipt": "201011005",
      "reference_number": null,
      "tags": [],
      "usage": "export",
      "volume": "14.80"
    },
    {
      "id": 5678,
      "quantity": 1,
      "goods_description": "Bmw X7 2020",
      "arrival_voyage": null,
      "departure_voyage": null,
      "commodity_type": null,
      "consignees": [
        "CARICOM AUTO SALES"
      ],
      "current_location_type": "Terminal",
      "current_location": "North Terminal",
      "dock_receipt": "201011000",
      "reference_number": null,
      "tags": [],
      "usage": "export",
      "volume": "18.66"
    }
  ],
  "actions": {
    "index": {
      "method": "GET",
      "url": "http://localhost:3000/api/v1/vehicles"
    },
    "next": {
      "method": "GET",
      "url": "http://localhost:3000/api/v1/vehicles?page=3"
    },
    "previous": {
      "method": "GET",
      "url": "http://localhost:3000/api/v1/vehicles?page=1"
    },
    "last": {
      "method": "GET",
      "url": "http://localhost:3000/api/v1/vehicles?page=747"
    }
  }
}

Params

Param name Description
vin
optional

Filter by Vehicle Identification Number (VIN).

Validations:

  • Must be a String

arrival_voyage_id
optional

Filter for a specific arrival voyage. Can be the Octopi voyage id or voyage number.

Validations:

  • Must be a String

booking_id
optional

Filter for a specific booking. Can be the Octopi booking id or booking number.

Validations:

  • Must be a String

commodity_type
optional

Filter for a specific commodity type.

Validations:

  • Must be a String

consignee_id
optional

Filter for a specific consignee. Can be the Octopi consignee id or consignee name.

Validations:

  • Must be a String

current_location_type
optional

Filter for a specific current location type.

Validations:

  • Must be a String

departure_voyage_id
optional

Filter for a specific departure voyage.

Validations:

  • Must be a String

dock_receipt_id
optional

Filter for a specific dock receipt. Can be the Octopi dock receipt id or dock receipt number.

Validations:

  • Must be a String

reference_number
optional

Filter for a specific reference number.

Validations:

  • Must be a String

stripped_from_container_id
optional

Filter by the container the cargo was stripped from. Can be the Octopi container id or container number.

Validations:

  • Must be a String

tags
optional

Filter for a list of pipe-separated tags (eg. ‘tag1|tag2|tag3’)

Validations:

  • Must be a String

usage
optional

Filter for a specific usage.

Validations:

  • Must be a String

page
optional

Specify which page of results to fetch. This value defaults to 1.

Validations:

  • Must be a Integer

per
optional

The number of items to be displayed. This value defaults to 10 and accepts a maximum of 100.

Validations:

  • Must be a Integer


GET /api/v1/vehicles/:id.json
Returns information about a specific vehicle

This API endpoint allows you to fetch information about a specific vehicle.

Supported Formats

json

Errors

Code Description
404 Not found.
400 Bad request.
422 Unprocessable entity.
500 Internal server error.

Examples

curl "https://app.octopi.co/api/v1/vehicles/:id.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR_TOKEN"'
{
  "vehicle": {
    "id": 12345,
    "reference_number": null,
    "quantity": 1,
    "goods": "Toyota Tacoma",
    "goods_description": "Toyota Tacoma",
    "shipping_marks": null,
    "usage": "export",
    "active_bill_of_ladings": "",
    "vin_number": "5TFUU4EN112",
    "consignee": "Consignee: CAPCOM AUTO SALES",
    "current_location_type": "Terminal",
    "current_location": "South Terminal",
    "weight_unit": "kg",
    "weight": 1508.19,
    "dimension_unit": "meter",
    "width": 1.83,
    "height": 1.68,
    "length": 4.83,
    "volume": "14.80",
    "pieces_per_package": null,
    "package_weight": 0,
    "yard_slot": null,
    "package_type_code": null,
    "package_type": null,
    "extra_attributes": null,
    "flex_fields": []
  }
}

Params

Param name Description
id
required

The Octopi ID or VIN of the vehicle.

Validations:

  • Must be a String


PATCH /api/v1/vehicles/:id.json
Update a vehicle's data.

This API endpoint allows you to update data for a specific vehicle.

Supported Formats

json

Errors

Code Description
404 Not found.
400 Bad request.
422 Unprocessable entity.
500 Internal server error.

Examples

curl -X PUT \
"https://app.octopi.co/api/v1/vehicles/:id.json" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Token token=YOUR_TOKEN" \
-d '{
  "vehicle": {
    "goods_description": "Toyota Mirai",
    "quantity": 1,
    "consignee_names": [
      "VEHICLE CONSOL"
    ],
    "extra_attributes": {
      "foo": "bar"
    }
  }
}'
{
  "vehicle": {
    "id": 1234,
    "reference_number": null,
    "quantity": 1,
    "goods": "Toyota Tacoma",
    "goods_description": "Toyota Mirai",
    "shipping_marks": null,
    "usage": "export",
    "active_bill_of_ladings": "",
    "vin_number": "5TFUU4ENXEX107511",
    "consignee": "Consignee: VEHICLE CONSOL",
    "current_location_type": "Terminal",
    "current_location": "South Terminal",
    "weight_unit": "kg",
    "weight": 1508.00,
    "dimension_unit": "meter",
    "width": 1.83,
    "height": 1.68,
    "length": 4.83,
    "volume": "14.80",
    "pieces_per_package": null,
    "package_weight": 0,
    "yard_slot": null,
    "package_type_code": null,
    "package_type": null,
    "extra_attributes": {
      "foo": "bar"
    },
    "flex_fields": []
  }
}

Params

Param name Description
id
required

The Octopi ID or VIN of the vehicle you would like to update.

Validations:

  • Must be a String

goods_description
optional

The vehicle’s description.

Validations:

  • Must be a String

consignee_names
optional

An array of consignee names.

Validations:

  • Must be an array of String

shipping_line
optional

The vehicle’s shipping line.

Validations:

  • Must be a String

usage
optional

The vehicle’s usage.

Validations:

  • Must be a String

weight
optional

The vehicle’s weight in your organization’s weight unit preference.

Validations:

  • Must be a Numeric

height
optional

The vehicle’s height in your organization’s dimension unit preference.

Validations:

  • Must be a Numeric

length
optional

The vehicle’s length in your organization’s dimension unit preference.

Validations:

  • Must be a Numeric

width
optional

The vehicle’s width in your organization’s dimension unit preference.

Validations:

  • Must be a Numeric

year
optional

The vehicle’s year.

Validations:

  • Must be a Numeric

make
optional

The vehicle’s make.

Validations:

  • Must be a String

model
optional

The vehicle’s model.

Validations:

  • Must be a String

color
optional

The vehicle’s color.

Validations:

  • Must be a String

quantity
optional

The vehicle’s quantity.

Validations:

  • Must be a Numeric

package_weight
optional

The vehicle’s package weight.

Validations:

  • Must be a Numeric

extra_attributes
optional

A key-value pair of extra attributes for the vehicle.

Validations:

  • Must be a Hash