0

I'm creating a partial shipment for a bundle product using this api

POST /rest/V1/order/{orderId}/ship

And this is the body

{
    "items": [
        {
            "order_item_id": 87,
            "qty": 0
        },
        {
            "order_item_id": 88,
            "qty": 1
        },
        {
            "order_item_id": 89,
            "qty": 1
        },
        {
            "order_item_id": 90,
            "qty": 1
        }
    ],
    "tracks": [
        {
            "track_number": "TRK-0063-01",
            "carrier_code": "custom",
            "title": ""
        }
    ],
    "arguments": {
        "extension_attributes": {
            "source_code": "default"
        }
    }
}

where the first item (order_item_id = 87) is the bundle product. But I'm getting an error from the api

{
    "message": "Shipment Document Validation Error(s):\nCannot create shipment as bundle product \"\" has shipment type \"Separately\". Bundle product options should be shipped instead."
}

My main questions regarding this are:

  1. Is the issue that the "Ship Bundle Items" option is set to "Separately"? If so then what should the request body be for this case.
  2. Is there some other API that should be used for bundle products with the "Separately" option?
0

The endpoint you mentioned worked for me :| But this is how I called it:

  1. Create first shipment POST /rest/V1/order/21/ship (37 is the id of the parent item)
{
    "items": [
        {
            "order_item_id": 37,
            "qty": 1
        },
        {
            "order_item_id": 38,
            "qty": 1
        },
        {
            "order_item_id": 39,
            "qty": 1
        }
    ],
    "tracks": [
        {
            "track_number": "test-CODE-1",
            "carrier_code": "custom",
            "title": ""
        }
    ],
    "arguments": {
        "extension_attributes": {
            "source_code": "default"
        }
    }
}
  1. Create second shipment with the remaining items calling the same endpoint with same order ID POST /rest/V1/order/21/ship
{
    "items": [
        {
            "order_item_id": 40,
            "qty": 1
        },
        {
            "order_item_id": 41,
            "qty": 1
        }
    ],
    "tracks": [
        {
            "track_number": "test-CODE-2",
            "carrier_code": "custom",
            "title": ""
        }
    ],
    "arguments": {
        "extension_attributes": {
            "source_code": "default"
        }
    }
}

The two shipments were registered correctly: enter image description here

My order includes a bundle product set with shipping items separately (the order creates 5 order items, out of which 1 is the parent product).

You can also omit the parent product order item entirely, the shipment doesn't care about it (I've performed the API calls only with children products also and it behave the same as my example above - there isn't any difference between the results).

6
  • Forgot to mention i tried this on a 2.4.1 instance. Mar 9 at 16:33
  • Still facing the same issue. I tried with a new order but the same response Mar 9 at 17:19
  • Sorry to hear this :( but are you able to partially ship the order from the admin? Mar 9 at 17:20
  • 1
    Yes, no issue in creating from admin Mar 9 at 17:22
  • Do your products have multiple sources? Coz in my case there are 2, ones default and I have one other source. Maybe thats causing the issue Mar 9 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.