This resource allows clients to view, create, and delete a interchange for truck visits in Octopi.

Supported Formats

json

GET /api/v1/truck_visits/:truck_visit_id/interchanges.json
Get list of interchanges for a truck visit.

List all the interchanges for the given truck visit ID.

Supported Formats

json

Errors

Code Description
404 Not found.
422 Unprocessable Entity.
500 Internal Server Error.
409 Entity conflict.

Examples

curl --location
  --request GET 'https://app.octopi.co/api/v1/truck_visits/1876441/interchanges.json'       --header 'Content-Type: application/json'       --data-raw '{}'
[
  {
    "interchange_url": "http://app.octopi.co/api/v1/truck_visits/1876441/interchanges/2205893",
    "truck_visit_id": 1876441,
    "action_type": "interchange_in",
    "container_number": "CONZ1234674",
    "container_status": "full",
    "container_usage": 0,
    "container_has_damage": null,
    "container_vgm": null,
    "container_seal": null,
    "booking": "BOOKING12APR",
    "export_release": "EXP1",
    "bill_of_lading": null,
    "delivery_order": null,
    "chassis_number": "TESTCH-201",
    "chassis_weight": null,
    "genset": null,
    "genset_seal": null,
    "genset_fuel_level": null,
    "genset_has_reefer_compartment_seal": null,
    "genset_weight": null,
    "reefer_temperature": null,
    "reefer_temperature_unit": null,
    "reefer_set_point_temperature": null,
    "operating_reefer": false,
    "reefer_supply_temperature": null,
    "reefer_humidity": null,
    "reefer_ventilation": null,
    "scale_weight": null,
    "truck_weight": null,
    "completed_at": null
  }
]

Params

Param name Description
truck_visit_id
required

Truck visit ID.

Validations:

  • Must be a Integer


GET /api/v1/truck_visits/:truck_visit_id/interchanges/:id.json
Get details of an interchange for a truck visit.

Show interchange for a given interchange ID.

Supported Formats

json

Errors

Code Description
404 Not found.
422 Unprocessable Entity.
500 Internal Server Error.
409 Entity conflict.

Examples

curl --location --request GET 'https://app.octopi.co/api/v1/truck_visits/34234/interchanges/123.json'     --header 'Content-Type: application/json'
{
  "truck_visit_id": 34234,
  "action_type": "interchange_in",
  "container_number": "CONZ1234674",
  "container_status": "full",
  "container_usage": 0,
  "container_has_damage": null,
  "container_vgm": null,
  "container_seal": null,
  "booking": "BOOKING12APR",
  "export_release": "EXP1",
  "bill_of_lading": null,
  "delivery_order": null,
  "chassis_number": "TESTCH-201",
  "chassis_weight": null,
  "genset": null,
  "genset_seal": null,
  "genset_fuel_level": null,
  "genset_has_reefer_compartment_seal": null,
  "genset_weight": null,
  "reefer_temperature": null,
  "reefer_temperature_unit": null,
  "reefer_set_point_temperature": null,
  "operating_reefer": false,
  "reefer_supply_temperature": null,
  "reefer_humidity": null,
  "reefer_ventilation": null,
  "scale_weight": null,
  "truck_weight": null,
  "completed_at": null,
  "interchange": null
}

Params

Param name Description
id
required

Interchange ID.

Validations:

  • Must be a Integer

truck_visit_id
required

Truck visit ID.

Validations:

  • Must be a Integer


DELETE /api/v1/truck_visits/:truck_visit_id/interchanges/:id.json
Delete a truck visit's interchange.

This API endpoint allows you to delete an interchange for a specific truck visit.

Supported Formats

json

Errors

Code Description
404 Not found.
422 Unprocessable Entity.
500 Internal Server Error.
409 Entity conflict.

Examples

curl "https://app.octopi.co/api/v1/truck_visits/123/interchanges/353388.json" -X DELETE -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
  "id": 353388
}

Params

Param name Description
id
required

Interchange ID.

Validations:

  • Must be a String

truck_visit_id
required

Truck visit ID.

Validations:

  • Must be a String


POST /api/v1/truck_visits/:truck_visit_id/interchanges.json
Create an interchange for a truck visit.

Create an interchange for a truck visit.

Supported Formats

json

Errors

Code Description
404 Not found.
422 Unprocessable Entity.
500 Internal Server Error.
409 Entity conflict.

Examples

curl --location --request POST 'https://app.octopi.co/api/v1/truck_visits/1876441/interchanges.json'
  --header 'Content-Type: application/json'
  --data-raw '{
    "purpose": "drop_off_container",
    "container_number": "CAIU2340022",
    "container_status": "full",
    "booking_number": "10543688",
    "chassis_number": "SEFZ104186"
  }'
{
  "id": 12345,
  "container_status": "full",
  "truck_visit_id": 4567,
  "complete": false,
  "completed_at": null,
  "for_container": true,
  "for_chassis": false,
  "for_genset": false,
  "type": "interchange_in",
  "container": {
      "id": 1119659,
      "number": "CAIU2340022",
      "status": "full",
      "has_damages": false,
      "is_reefer": false,
      "is_flatrack": false,
      "unlifted_holds_exist": false,
      "chassis": {
        "id": 882733,
        "number": "SEFZ104186"
      }
  },
  "chassis": {
    "id": 882733,
    "number": "SEFZ104186"
  },
  "booking": {
    "id": 287504,
    "trucking_company_id": 467,
    "is_runner": false,
    "booking_number": "10543688",
    "voyage_number": "200S",
    "ship_name": "FS IPANEMA",
    "port_of_discharge": "ARUBA (AWAUA)",
    "port_of_loading": "PORT EVERGLADES (USPEF)",
    "port_of_delivery": "ARUBA (AWAUA)",
    "shipper": {
      "name": "SHIPPER INC."
    },
    "trucking_company": {
      "name": "Seaboard"
    },
    "items": [
      {
        "id": 16193771,
        "line_item_number": 10,
        "quantity": 1,
        "description": "",
        "container": {
          "id": null,
          "display_name": null
        },
        "dock_receipt_cargos": [],
        "hazmat_codes": [],
        "hazmat_ids_and_codes": {},
        "hazmat_classes": [],
        "container_type": {
          "label": "20CT"
        }
      },
      {
        "id": 1395330,
        "line_item_number": 4,
        "quantity": 1,
        "description": "CARGO NOS",
        "container": {
          "id": null,
          "display_name": null
        },
        "dock_receipt_cargos": [],
        "hazmat_codes": [],
        "hazmat_ids_and_codes": {},
        "hazmat_classes": [],
        "container_type": {
          "label": "40HC"
        }
      }
    ],
    "all_items": [
      {
        "id": 16193771,
        "line_item_number": 10,
        "quantity": 1,
        "description": "",
        "container": {
          "id": null,
          "display_name": null
        },
        "dock_receipt_cargos": [],
        "hazmat_codes": [],
        "hazmat_ids_and_codes": {},
        "hazmat_classes": [],
        "container_type": {
          "label": "20CT"
        }
      },
      {
        "id": 1395327,
        "line_item_number": 1,
        "quantity": 1,
        "description": "CARGO NOS",
        "container": {
          "id": 1101190,
          "display_name": "BSIU2346474"
        },
        "dock_receipt_cargos": [],
        "hazmat_codes": [],
        "hazmat_ids_and_codes": {},
        "hazmat_classes": [],
        "container_type": {
          "label": "20CT"
        }
      },
      {
        "id": 1395328,
        "line_item_number": 2,
        "quantity": 1,
        "description": "CARGO NOS",
        "container": {
          "id": 1119413,
          "display_name": "SMLU7903607"
        },
        "dock_receipt_cargos": [],
        "hazmat_codes": [],
        "hazmat_ids_and_codes": {},
        "hazmat_classes": [],
        "container_type": {
          "label": "20CT"
        }
      },
      {
        "id": 1395330,
        "line_item_number": 4,
        "quantity": 1,
        "description": "CARGO NOS",
        "container": {
          "id": null,
          "display_name": null
        },
        "dock_receipt_cargos": [],
        "hazmat_codes": [],
        "hazmat_ids_and_codes": {},
        "hazmat_classes": [],
        "container_type": {
          "label": "40HC"
        }
      },
      {
        "id": 1395329,
        "line_item_number": 3,
        "quantity": 1,
        "description": "CARGO NOS",
        "container": {
          "id": 1119444,
          "display_name": "SMLU3105445"
        },
        "dock_receipt_cargos": [],
        "hazmat_codes": [],
        "hazmat_ids_and_codes": {},
        "hazmat_classes": [],
        "container_type": {
          "label": "20CT"
        }
      },
      {
        "id": 1395333,
        "line_item_number": 7,
        "quantity": 1,
        "description": "CARGO NOS",
        "container": {
          "id": 1114166,
          "display_name": "TCNU6028886"
        },
        "dock_receipt_cargos": [],
        "hazmat_codes": [],
        "hazmat_ids_and_codes": {},
        "hazmat_classes": [],
        "container_type": {
          "label": "40HC"
        }
      }
    ]
  },
  "export_release": null
}

Params

Param name Description
truck_visit_id
required

Truck visit ID.

Validations:

  • Must be a Integer

purpose
required

Purpose of the interchange.

Validations:

  • Must be one of: drop_off_container, pick_up_container, drop_off_chassis, pick_up_chassis, drop_off_genset, pick_up_genset.

container_number
optional

Container number to create interchange.

Validations:

  • Must be a String

container_status
optional

Container status.

Validations:

  • Must be one of: full, empty.

booking_number
optional

Booking number for the interchange.

Validations:

  • Must be a String

chassis_number
optional

Chassis number.

Validations:

  • Must be a String

genset_number
optional

Genset number.

Validations:

  • Must be a String

export_release_number
optional

Export release number for the interchange.

Validations:

  • Must be a String

bill_of_lading_number
optional

Bill of lading number for the interchange.

Validations:

  • Must be a String

delivery_order_number
optional

Delivery order number for the interchange.

Validations:

  • Must be a String

completed_at
optional

The date and time at which interchange was completed, in ISO 8601 format (Eg 2023-04-13T14:30:00Z). Providing this value will create the interchange with a completed status.

Validations:

  • Must be a String

temperature_letter_port_of_discharge
optional

Temperature letter port of discharge (eg. “HTPAP”)

Validations:

  • Must be a String

temperature_letter_vgm
optional

Temperature letter VGM in your organization’s weight unit preference (eg. 2345.0)

Validations:

  • Must be a Float


PATCH /api/v1/truck_visits/:truck_visit_id/interchanges/:id.json
Update an interchange's attributes.

This API endpoint allows you to update a pending interchange.

Supported Formats

json

Errors

Code Description
404 Not found.
422 Unprocessable Entity.
500 Internal Server Error.
409 Entity conflict.

Examples

curl "https://app.octopi.co/api/v1/truck_visits/123/interchanges/12345.json" -X PATCH -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=ADD TOKEN HERE
-d '{
  "container_number": "CON123456",
  "booking_number": "BOOK1234",
  "chassis_number": "CH1234",
  "genset_number": "GEN123",
  "export_release_number": "EXP123",
  "bill_of_lading_number":  null,
  "delivery_order_number":  null,
  "completed_at": "2023-06-28T21:12:29.128+09:00",
}'
{
  "id": 12345,
  "container_status": "full",
  "truck_visit_id": 123456,
  "complete": true,
  "completed_at": "2023-07-03T09:24:09-05:00",
  "for_container": true,
  "for_chassis": false,
  "for_genset": false,
  "type": "interchange_in",
  "container": {
    "id": 12345,
    "number": "CON123456",
    "status": "full",
    "has_damages": false,
    "is_reefer": false,
    "is_flatrack": false,
    "unlifted_holds_exist": false
  },
  "booking": {
    "id": 123456,
    "trucking_company_id": null,
    "is_runner": true,
    "booking_number": "111111",
    "voyage_number": null,
    "ship_name": null,
    "port_of_discharge": null,
    "port_of_loading": null,
    "port_of_delivery": null,
    "items": [],
    "all_items": []
  },
  "export_release": null,
  "interchange": null
}

Params

Param name Description
id
required

Interchange ID.

Validations:

  • Must be a String

truck_visit_id
required

Truck visit ID.

Validations:

  • Must be a String

container_number
optional

The container number used for the interchange.

Validations:

  • Must be a String

booking_number
optional

The booking number used for the interchange.

Validations:

  • Must be a String

chassis_number
optional

The chassis number used for the interchange.

Validations:

  • Must be a String

genset_number
optional

The genset number used for the interchange.

Validations:

  • Must be a String

export_release_number
optional

Export release number used for the interchange.

Validations:

  • Must be a String

bill_of_lading_number
optional

Bill of lading number used for the interchange.

Validations:

  • Must be a String

delivery_order_number
optional

Delivery order number used for the interchange.

Validations:

  • Must be a String

completed_at
optional

The date and time at which interchange was completed, in ISO 8601 format (Eg 2023-04-13T14:30:00Z). Providing this value will update the interchange with a completed status.

Validations:

  • Must be a String