Relocates general cargo to another yard slot and records a yard move, the same way the Relocate button does. Dwell days are not reset. Use this instead of updating the yard_slot_id of the general cargo.
If the destination yard slot already holds cargo from the same origin, the relocated quantity is merged into it. The response’s cargo is the record now at the destination, which can differ from the requested cargo after a split or a merge. source_cargo is the original cargo with its remaining quantity. It is only returned when it differs from cargo and still exists.
| Code | Description |
|---|---|
| 400 | Bad Request. |
| 404 | Not found. |
| 422 | Unprocessable entity. |
| 500 | Server crashed for some reason. |
curl "https://app.octopi.co/api/v1/general_cargoes/:general_cargo_id/relocate.json" -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE" -d '{"yard_slot_id": 123, "quantity": 5}'
{
"message": "5 units of Pallets have been relocated to WH-A-01",
"merged": false,
"cargo": {
"id": 987,
"number": null,
"vin": null,
"quantity": 5.0,
"yard_slot": { "id": 123, "custom_name": "WH-A-01" }
},
"source_cargo": {
"id": 654,
"number": null,
"vin": null,
"quantity": 15.0,
"yard_slot": { "id": 100, "custom_name": "WH-B-04" }
}
}
| Param name | Description |
|---|---|
|
general_cargo_id required |
The Octopi ID of the general cargo. Validations:
|
|
yard_slot_id required |
The Octopi ID of the destination yard slot. Yard slot IDs are listed by GET /yard_areas/:id. Validations:
|
|
quantity optional |
The quantity to relocate. Defaults to the full quantity. A partial quantity is split into new cargo, and the remaining quantity stays at the original location. Validations:
|