Create an interchange for a truck visit.
Note: Some parameters have conditional requirements based on organization settings: - The ‘usage’ parameter is required for depot terminal organizations when container_status is ‘full’ - The ‘export_release_number’ parameter is required for empty containers when the organization requires export releases
| Code | Description | 
|---|---|
| 404 | Not found. | 
| 422 | Unprocessable Entity. | 
| 500 | Internal Server Error. | 
| 409 | Entity conflict. | 
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",
    "usage": "export",
    "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
}
  | Param name | Description | 
|---|---|
| truck_visit_id required | Truck visit ID. Validations: 
 | 
| purpose required | Purpose of the interchange. Validations: 
 | 
| container_number optional | Container number to create interchange. Validations: 
 | 
| container_status optional | Container status. Validations: 
 | 
| usage optional | Container usage type. Required for depot terminal organizations when container_status is ‘full’. Validations: 
 | 
| booking_number optional | Booking number for the interchange. Validations: 
 | 
| container_type_label optional | Container type label. Validations: 
 | 
| chassis_number optional | Chassis number. Validations: 
 | 
| genset_number optional | Genset number. Validations: 
 | 
| export_release_number optional | Export release number for the interchange. Required for empty containers when organization requires export releases. Validations: 
 | 
| bill_of_lading_number optional | Bill of lading number for the interchange. Validations: 
 | 
| delivery_order_number optional | Delivery order number for the interchange. Validations: 
 | 
| 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: 
 | 
| temperature_letter_port_of_discharge optional | Temperature letter port of discharge (eg. “HTPAP”) Validations: 
 | 
| temperature_letter_vgm optional | Temperature letter VGM in your organization’s weight unit preference (eg. 2345.0) Validations: 
 |