Supported Formats

json

GET /api/v1/general_cargoes.json
Gets a list of general cargo

This API endpoint allows you to fetch information about general cargo.

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/general_cargoes.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR_TOKEN" -d '{ "consignee_id": "ABC DIRECT" }'
{
  "general_cargoes" : [
    {
      "id": 12345,
      "quantity": 50.0,
      "goods_description": "1.0 kilogram of wood",
      "arrival_voyage": "",
      "commodity_type": null,
      "consignees": [
        'ABC DIRECT'
      ],
      "current_location_type": "Voyage",
      "current_location": "Voyage: PLANET EARTH",
      "dock_receipt": null,
      "reference_number": null,
      "tags": [
        'quality wood'
      ],
      "usage": "unknown",
      "volume": "8,000.00"
    },
    "flex_fileds": [{
      "label": "Name",
      "value": "Octopi"
    }]
  ],
  "actions": {
    "index": {
      "method": "GET",
      "url": "https://app.octopi.co/api/v1/general_cargoes.json"
    },
    "next": {
      "method": "GET",
      "url": "https://app.octopi.co/api/v1/general_cargoes.json?page=2"
    },
    "previous": {
      "method": "GET",
      "url": "https://app.octopi.co/api/v1/general_cargoes.json?page=0"
    },
    "last": {
      "method": "GET",
      "url": "https://app.octopi.co/api/v1/general_cargoes.json?page=304"
    }
  }
}

Params

Param name Description
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/general_cargoes/:id.json
Returns information about a specific general cargo

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

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/general_cargoes/:id.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR_TOKEN"'
{
  "general_cargo": {
    "id": 123,
    "reference_number": "",
    "quantity": 1.0,
    "goods": "Bundle of wood",
    "goods_description": "1.0 Bundle of wood",
    "shipping_marks": null,
    "usage": "export",
    "active_bill_of_ladings": "BOL1092719",
    "consignee": "Consignee: COOL DUDE",
    "current_location_type": "Terminal",
    "current_location": "Terminal: Sunny Beaches",
    "weight_unit": "lb",
    "weight": 2.0,
    "dimension_unit": "inches",
    "width": 48.0,
    "height": 13.0,
    "length": 168.0,
    "volume": "104,832.00",
    "pieces_per_package": null,
    "package_weight": 0,
    "yard_slot": null,
    "package_type_code": "",
    "package_type": null,
    "extra_attributes": null,
    "flex_fileds": [{
      "label": "Name",
      "value": "Octopi"
    }]
  }
}

Params

Param name Description
id
required

The Octopi general cargo ID.

Validations:

  • Must be a Integer


PUT /api/v1/general_cargoes/:id.json
Update general cargo data

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

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/general_cargoes/:id.json" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Token token=YOUR_TOKEN" \
-d '{
  "general_cargo": {
    "goods_description": "Pipes",
    "consignee_names": ["UNITY LOGISTICS"],
    "quantity": 12.0,
    "package_weight": 100,
    "package_type": "crate",
    "current_location_id": 35,
    "current_location_type": "Terminal",
    "extra_attributes": {
      "foo": "bar"
    }
  }
}'
{
  "general_cargo": {
    "id": 1234,
    "reference_number": "",
    "quantity": 12.0,
    "goods": "Pipes",
    "goods_description": "12.0 crates of Pipes",
    "shipping_marks": "",
    "usage": "import",
    "consignee": "Consignee: UNITY LOGISTICS",
    "current_location_type": "YardArea",
    "current_location": "Warehouse",
    "weight_unit": "lb",
    "weight": 0.0,
    "dimension_unit": "inches",
    "width": 0.0,
    "height": 0.0,
    "length": 0.0,
    "volume": "0.00",
    "pieces_per_package": null,
    "package_weight": 100,
    "yard_slot": null,
    "package_type_code": "CR",
    "package_type": "crate",
    "extra_attributes": {
      "foo": "bar"
    },
    "flex_fields": []
  }
}

Params

Param name Description
id
required

The general cargo ID.

Validations:

  • Must be a Integer

goods_description
optional

The cargo’s goods description.

Validations:

  • Must be a String

consignee_names
optional

An array of consignee names.

Validations:

  • Must be an array of String

quantity
optional

The cargo’s quantity.

Validations:

  • Must be a Numeric

package_weight
optional

The cargo’s package weight.

Validations:

  • Must be a Numeric

package_type
optional

The cargo’s package type name or code (eg. ‘Box’ or ‘QP’).

Validations:

  • Must be a String

extra_attributes
optional

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

Validations:

  • Must be a Hash

current_location_id
optional

the container current location id.

Validations:

  • Must be a number.

current_location_type
optional

the type of current location

Validations:

  • Must be one of: Terminal, YardArea, YardSlot, Port, BerthArea.