Skip to content

Rest salesShipOrderV1 API w/ Bundles error: "You can't create a shipment without products" #9762

Closed
@jim5359

Description

@jim5359

Preconditions

  1. Magento v2.1.4

Steps to reproduce

  1. Create an order containing a bundle of multiple simple products.
  2. Call the REST salesShipOrderV1 API (POST /V1/order/{orderId}/ship) and send a shipment for the individual items. Example:
{
        "appendComment": 1,
        "notify": 1,
        "comment": {
            "comment": "Your order has been shipped, login to view tracking information.",
            "is_visible_on_front": 1
        },
        "items": [
            {
                "order_item_id": 516,
                "qty": 1
            },
            {
                "order_item_id": 517,
                "qty": 1
            }
        ],
        "tracks": [
            {
                "title": "Netherlands Post Ground Parcel",
                "carrier_code": "custom",
                "track_number": "3SCEMW182389201"
            }
        ]
}

Expected result

  1. Order gets mark completed

Actual result

{
        "status": 400,
        "headers": {},
        "body": {
            "message": "Shipment Document Validation Error(s):\nYou can't create a shipment without products."
        }
}

Additional info

Reproduced it via Swagger.
Applied admin token and used the POST/V1/order/{orderId}/ship
Used the following query body

{
  "items": [
    {
      "extension_attributes": {},
      "order_item_id": 6,
      "qty": 1
    }
  ],
  "notify": true,
  "appendComment": true,
  "comment": {
    "extension_attributes": {},
    "comment": "Your order has been shipped, login to view tracking information.",
    "is_visible_on_front": 1
  },
  "tracks": [
    {
      "extension_attributes": {},
      "track_number": "3SCEMW182389201",
      "title": "Netherlands Post Ground Parcel",
      "carrier_code": "fixed"
    }
  ],
  "packages": [
    {
      "extension_attributes": {}
    }
  ],
  "arguments": {
    "extension_attributes": {}
  }
}

Where :

  • orderId can be found in Sales - Orders
    sales_orders
  • track_number is set while Shiping the order
    ship
    Add a tracking number
    track_number
  • order_item_id I'm sure that there is an easier way, but I used GraphQL to verify the order item id
    order_item_id

Metadata

Metadata

Assignees

Labels

CDIssue recommended for the contribution dayComponent: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogComponent: SalesIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions