When I am using the salesShipOrderV1 REST API interface. I am receiving the "you can't create a shipment without products" error.
The order_item_id is taken from the order.items[X].item_id; from the end point: /V1/orders/{id}
I wanted to add another detail I found. When the order is in processing as it does when a Credit Card is used to pay for the order this fails. But when I use a money order to pay it will function correctly. I think this has something to do with the status of pending vs processing
Unfortunately, we can't reproduce this issue.
In our case, we did next steps:
{
"items": [
{
"qty": 2.0000,
"order_item_id": "3"
}
],
"notify": true,
"appendComment": false,
"tracks": [
{
"track_number": "21Z1234567890",
"title": "UPS",
"carrier_code": "ups"
}
]
}As a result, the Shipment is having been created for this order. Now we will get the Result you are talking about if we send that request again.
Please provide us more information on how you reproduce this issue.
@magento-engcom-team
Do the same thing but pay with a credit card. I found that money orders work but the credit card payment goes write to processing and not pending. The shipment can then not be added. I added this note in the message just above yours.
@magento-engcom-team
I updated the orginal text to include that the purchase method was credit cart authorize .net
@danscan1712 please confirm for us the following. In the "sales_order_item" table find item_id that is equal to the order_item_id You sent in Your request (in Your case it was 50). Now look what order_id and what product_id correspond to that item_id. Then enter that order (with that order_id) in Admin and go to its shipment section. Make sure that the product with that product_id is not present in one of those shipments. Thank You.
@danscan1712, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.
Hi @danscan1712 - if you don't mind me asking. Since you haven't followed up for a while about this issue - have you been able to resolve it? I'm having the same issue - payload is exactly as it should - all the id's and quantities match. But calling the rest/vi/order/[ID]/ship endpoint with the payload as you described above results in: "Shipment Document Validation Error(s):\nThe order does not allow a shipment to be created.\nYou can't create a shipment without products."
@baskuis
I actually started getting this issue again because of an item type (I think). If possible look up the actual exception message in the log. Occasionally that has something useful. This error is one of the worst in magento. The error message tells you nothing of value.
I'm getting the same thing. I create an order and pay by credit card, and call
/index.php/rest/V1/order/340/ship
with the payload:
{'tracks': [{'carrier_code': 'usps', 'track_number': '9400136205903868804224', 'title': 'USPS First'}], 'items': [{'order_item_id': 241, 'qty': 1}]}
And receive the error:
{"message":"Shipment Document Validation Error(s):\nThe order does not allow a shipment to be created.\nYou can't create a shipment without products."}
I duplicate the order, pay by cheque/money order, and repeat the process (obviously the ID in the endpoint changes and the order_item_id changes) and it works.
Both orders were Processing when I attempted to make the API call.
I just learned that it's necessary to invoice the order before you can create a shipment.
I would have assumed that since the order was in Processing, it was possible to ship it.
This issue is still persisting,I did all the essential steps but not able to succeed yet. Can anyone help me out please.
This issue is still open, see #9762
Most helpful comment
I just learned that it's necessary to invoice the order before you can create a shipment.
I would have assumed that since the order was in Processing, it was possible to ship it.