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.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not found.
422 Unprocessable entity.
500 Server crashed for some reason.

Examples

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" }
  }
}

Params

Param name Description
general_cargo_id
required

The Octopi ID of the general cargo.

Validations:

  • Must be a String

yard_slot_id
required

The Octopi ID of the destination yard slot. Yard slot IDs are listed by GET /yard_areas/:id.

Validations:

  • Must be a Integer

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:

  • Must be a Integer