Delete default allocation and recreate new allocations

Hi,

By default Veeqo allocates all items in an order to 1 package, so an order with 2 items would ship in 1 package. If I wish to change this via the API to use 1 package per item so that 2 packages are shipped, what’s the proper workflow?

  1. call DELETE /orders/:order_id/allocations/:allocation_id to remove the default allocation
  2. call POST /orders/:order_id/allocations/ to create 2 packages
  3. call GET /shipping/rates/:allocation_id for each allocation id
  4. call POST /shipping/shipments and buy all the quoted rates for each allocation

When I create the new allocation in step 2, the web UI shows the order being split into multiple packages, but the packages have no items packed inside them. Is there another API call to pack the items? Or, is there an API equivalent of “Edit Packages → Split by Package” found on the web UI

My payload for creating a new allocation

{
  "allocation": {
    "warehouse_id": 1,
    "line_items_attributes": [
      {
        "sellable_id": 123456789,
        "quantity": 1
      },
      {
        "sellable_id": 123456789,
        "quantity": 1
      }
    ]
  }
}

Hey @rundown7666,

In order to have multiple packages for a single order - you’d need to make multiple separate allocations.

Since you are currently just calling the POST /orders/:order_id/allocations/ endpoint in step 2 once, you are only making one allocation.

So all you need to change with your workflow is to just do step 2 twice but your payload would look like this:

{
  "allocation": {
    "warehouse_id": 1,
    "line_items_attributes": [
      {
        "sellable_id": 123456789,
        "quantity": 1
      },
    ]
  }
}

Then you’d proceed by getting rates for each allocation and creating two separate shipments as you do in the UI.

If this works for you, please mark this message as a solution so that other developers can use it as a reference. If you are still having trouble then contact Veeqo Support via the support messenger in the Veeqo app or contacting helpme@support.veeqo.com

Hope this helps,
Alex - Veeqo