After creating order for an item with specified quantity , if shipment record for same is created via
"POST /V1/shipment/" ,(http://devdocs.magento.com/swagger/index.html#/ ),order status doesn't change to "Processing" from "Pending" as it is happening on creating shipment from Magento2.x back-end . Also in "Order information" data there is no info about shipped quantity whereas it shipped quantity is visible on creating shipment from Magento back end.
Also as shown in above image shipment record no-36 i,created via rest API, is having no value for column "ship-to name" ,
whereas shipment record created from back-end appears in following way
Here is json with minimal data , that I have used. Any updates on the issue?
{
"entity": {
"orderId": 40,
"items": [
{
"orderItemId": 72,
"qty": 1
}
],
"tracks": [],
"comments": []
}
}
We're having the same issue but our order is 'processing' and needs to get 'complete'. After creating the shipment, the shipment is visible at the order but the product in the order view itself is not marked as shipped. I have attached some screenshots to clarify.
Same behaviour here while making POST v1/shipment call, the status of the order is not changing. Any news on this?
Hi guys,
thanks for reporting this issue.
Internal ticket was created MAGETWO-50299.
@NadiyaS Just wanted to inform you that per my conversation with another team member of yours (Maura), this issue is also being tracked by MAGETWO-48530 ticket. Pls link both the tickets as applicable.
Hi, @rohitgupta4,
MAGETWO-48530 is about Sales Order Shipping Address. The problem described in 2628.
@NadiyaS Could you please tell which release would this be in? And any ETA on that release?
@NadiyaS is there any ETA on this bug fix?
We are also getting this problem, is there any update on when a fix might be available?
Is there any update on this issue?
@NadiyaS Any updates on the release milestone related to this issue?
Hey @NadiyaS , This issue has been blocker for development work we are doing, Please let us know the updates regarding this issue.
Hi,
I am also facing this issue in case of invoice creation. Any ETA for this ??
Hi
Any update on this bug fix
Same issue here on 2.0.6. A work around would be to mark the sales_order_item table and set qty_shipped to qty you ship. Also, update the order status in sales_order table columns state and status. Don't like this solution but it might help.
@NadiyaS , @MomotenkoNatalia , is there any update on this issue ?
@NadiyaS, any update on this. Its been open for three months without any updates.Its a very critical bug for integrating Magento with external system. Any ideas if this been actively worked on?
We got the the same issue on 2.0.7, is there any update on 2.1.0?
Hi,
2.1.0 won't have this fix.
I want to remind you that we've created a story to improve order functionality where described bug will also be fixed (internal ticket is MAGETWO-50299).
It will be delivered as soon as possible according to other items priority.
Thank you for understanding and we are sorry for delay about this issue.
Thanks for this info. What does “as soon as possible according to other items priority” really mean though? Is this just not very high priority in the team’s view and so it will continue to be prioritized below other bugs?
On Jun 21, 2016, at 8:00 AM, Nadiya Syvokonenko [email protected] wrote:
Hi,
2.1.0 won't have this fix.
I want to remind you that we've created a story to improve order functionality where described bug will also be fixed (internal ticket is MAGETWO-50299).
It will be delivered as soon as possible according to other items priority.
Thank you for understanding and we are sorry for delay about this issue.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/3307#issuecomment-227467725, or mute the thread https://github.com/notifications/unsubscribe/ACSYIn3fOnqXAg92eSbokmPcxiNzx6pUks5qN_ylgaJpZM4HUZTh.
I cannot see how this is _not_:
Most larger webshops do not use Magento in their warehouse to ship orders, and Magento is focussing on these larger webshops. Non of these webshops can mark orders as completed in Magento 2.
It blows my mind.
@NadiyaS Does a community pull request to fix this have a serious chance to be accepted?
@NadiyaS : This bug is one major blocker for any kind of integration to 3rd party softwares.
Please take it with higher priority.
@NadiyaS I think this should be fixed asap as this will be blocking alot of integration partners who are into shipping integration. Please make this super priority.
@NadiyaS , this issues seems to be a terrible problem for so many people developing integrations!
As this issue was not resolved in 2.1.0, I've developed an extension that should fix the bug in the meantime: https://github.com/pizza-pizza/magento2-shipment-status-fix
If you're an Enterprise customer, open a support ticket so they get you the patch as soon as it's available. I heard that it will be released very soon.
Also building an integration with a warehouse system and eagerly awaiting a fix for this issue. The whole idea of this integration is so that our customers don't have to mark every shipped order as completed in the Magento backend ;)
As a workaround for now, as long as you're on 2.1.0 or above, you can make an API call to the orders endpoint after creating the shipment to complete the order. It would look a little like so:
$url = $this->base_url.'orders';
$params = array(
"entityId" => $entityId,
"incrementId" => $incrementId,
"state" => "complete",
"status" => "complete",
"items" => array(),
);
// Fill out the item data
foreach ($olines as $ol) {
$item = array();
$item['item_id'] = $ol['item_id'];
$item['qtyShipped'] = $ol['quantity'];
$item['sku'] = $ol['sku'];
$params['items'][] = $item;
}
$entity = array("entity" => $params);
// Init curl and post the data, eg:
// curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($entity));
Hi, we implemented and delivered into develop branch new services
Our new services provide corresponding order status changes after invoice/ship/refund operation.
We believe these changes will be also back-ported with Magento versions 2.1.3 and 2.0.11
More info see in devdocdraft
Hi, having new services is nice but the server should just close the order automatically when the order is fulfilled surely?
Maget 2.1.1
Of course, you are right. Order fulfilled with new services will be automatically closed.
New services implemented and delivered into develop branch and planned to be released in Magento 2.1.3 and Magento 2.0.11.
We're experiencing the same issue, but it seems to be even more severe as the problem extends beyond updating the order status. Looks like no business rules enforcement takes place, for instance, it is possible to ship the same items multiple times and in quantities exceeding the ordered ones. Moreover, it appears possible to create a shipment with items that do not even belong to an order at all. The lack of the business rules validation applies to shipping addresses as well.
@olysenko, please confirm the newly introduced API endpoints obey the business rules in exactly the same way as manipulations through the admin panel. What's the timeline for 2.1.3 release?
Thanks
@sshymko Yes I also noticed that the "ShipQty" against the item on the line is not updated when you use the REST, well am actually using the SOAP, API call.
It's a bit of a PITA but if you
1) ship the item,
2) read the sales order back,
3) update the Items[] to what has been shipped,
4) then send the returned object back to Magento IF the lines are fulfilled the business logic appears to kick back in.*
@sshymko Yes, I confirm.
We currently preparing 2.1.3 and 2.0.11 versions for release. No dates yet
Did this get solved in 2.1.3 ?
Yes, see description of /V1/order/{orderId}/ship in http://devdocs.magento.com/swagger/index.html
Why does "POST /V1/order/{orderId}/ship" not work in Magento 2.1.1 CE?
Returns "Request does not match any route error"
@Marcosdba I had to change the payload sent as follows in order to get it working:
{"entity":{
"notify": true,
"appendComment": true,
"comment": {
"comment": "awesome comment here",
"isVisibleOnFront": 0
},
"tracks": [
{
"trackNumber": "TRAC123",
"title": "TRAC123",
"carrierCode": 'free'
}
],
"items": [
{
"orderItemId": 48,
"qty": 1
}
]
}
}
@cloudjibao Thanks for answering me and Forgive me I messed up the version. It's in 2.1.1 , /V1/order/{orderId}/ship not working !!!
returns : "Request does not match any route error"
Still the Status remains Unchanged after create the shipment in version 2.1.1
Is this Issue resolved?
Is any other way to update the Order status to complete using Rest API call?
@itzRamkumar, did you created an invoice before? As far as I know it doesn't change the order status to "complete" if the shipment or the invoice doesn't exist
@itzRamkumar Read the comment! It's fixed in 2.1.3, so obviously in 2.1.1 it's still a bug.
@apluzhnikov Yes Invoice is Created.
@stephangroen How to upgrade 2.1.1 to 2.1.3 version.
@itzRamkumar http://lmgtfy.com/?q=upgrade+magento+2
@apluzhnikov @stephangroen @NadiyaS Not worked in 2.1.5 version.
OrderStatus : Processing
URL : http://mysite.com/rest/V1/shipment
Example Request :
{
"entity": {
"order_id": 30,
"shipment_status": 1,
"shipping_address_id": 59,
"store_id": 1,
"total_qty": 1,
"total_weight": 1.25,
"items": [
{
"parent_id": 30,
"price": 30,
"product_id": 1288,
"row_total": 30,
"sku": "Test002",
"weight": 1.25,
"order_item_id":60
"qty": 1
}
],
"tracks": [
{
"order_id": 30,
"weight": 1.25,
"qty": 1,
"description": "Tracking Updated",
"track_number": "123456",
"title": "DHL",
"carrier_code": "DHL"
}
],
"comments": [
{
"is_customer_notified": 1,
"comment": "Order Completed",
"is_visible_on_front": 1
}
]
}
}
Got Response Successfully but status not changed.
Is anything need to change.
Magento Version : 2.1.5
Update:
http://mysite.com/rest/V1/order/30/ship
above link worked in version 2.1.5. and status is updated.
Hey I've been working on this and having a hard time with the order status changing much like a lot of people here. I've been Posting to http://siteURL.bz/rest/default/V1/order/111779/ship and have been getting shipment ids back. However it never updates the order status. Is what I read correct that an invoice needs to be created in order for the status to automatically update?
@nem6087 If you want order status to go to "complete", yes, my understanding is that you also need to invoice the order. A complete order must be both invoiced and shipped.
I am always getting the message 'You can't create a shipment without products.' Anyone, please guide me how to get order_item_id from the order?
@Nishadup when you get the order data by id from magento, you always have a list of items, there you can find your order_item_id as "itemId" in JSON response (http://devdocs.magento.com/swagger/index_20.html -> salesOrderRepositoryV1 -> GET /V1/orders/{id}):
@apluzhnikov, Thanks a ton. that resolved my issue.
@Nishadup @apluzhnikov
I have been trying to use the salesShipOrderV1 : /V1/order/{orderId}/ship
End point and I am also receiving You can't create a shipment without products error. But I am adding the items[x].order_item_id from the order.items[x].item_id;
I am still getting this error.
{
"items": [
{
"qty": 2.0000,
"order_item_id": "50"
}
],
"notify": true,
"appendComment": false,
"tracks": [
{
"track_number": "21Z1234567890",
"title": "UPS",
"carrier_code": "ups"
}
]
}
@danscan1712 hi, I run this json and all is ok, shipment has been raised. In our case with id 16:
I have a different problem. My magento version is 2.2.2. I am using the following code:
"entity": {
"orderId": 4883,
"items": [
{
"extension_attributes": {},
"order_item_id": "7141",
"qty": "1"
}
],
"notify": true,
"append_comment": true,
"comment": {
"extension_attributes": {},
"comment": "Item(s) has been shipped",
"is_visible_on_front": 0
},
"tracks": [
{
"extension_attributes": {},
"track_number": "028806881473805",
"title": "Federal Express",
"carrier_code": "fedex"
}
],
"packages": [
{
"extension_attributes": {}
}
],
"arguments": {
"extension_attributes": {}
}
}
}
URL is: 'https://'.$_SERVER['HTTP_HOST'].'/index.php/rest/V1/order/'.$entity_id.'/ship/';
In my case, before running the above script the order status at magento admin site is under 'processing'.
After running the script , that particular order status is changing to complete. However, the tracking number, carrier code and title, comment are not being updated in the admin. If i again run the script, after updating the status to complete, I am getting an error like: "You can't create a shipment without products" and some other error. So, i think, it works only the first time.
The order status is changing to complete in my case, however, I am unable to update the tracking info. I am attaching a screen shot:
Any help would be appreciated!!!
Here is the stack over flow question:
https://stackoverflow.com/questions/48226701/magento-rest-api-tracking-number-not-being-updated
@amardeepthadisetty Hi, we got the same issue here, but then after we removed the block with arguments, it worked:
@apluzhnikov Thank you for replying back. I am waiting for a new order to check. Will look into that and keep you posted. Thank you once again!!!
Hey, Thank you @apluzhnikov , i have removed the one which you have mentioned, it did not work. Then i removed entire things, which i am not using. then it worked. This is the one I am using:
$tracking_str = [
"items"=> [
[
"order_item_id"=>$orderItemId,
"qty"=> $qty_invoiced
]
],
"notify" => true,
"appendComment" => true,
"comment" => [
"extension_attributes" => [],
"comment" => "Item(s) has been shipped",
"is_visible_on_front" => 0
],
"tracks" => [
[
"extension_attributes" => [],
"track_number" => $TrackingNumber,
"title" => $ShipTitle,
"carrier_code" => $carrierCode
]
]
]
Finally, tracking number, carrier code and title are being updated. Thanks for everything!!!
Most helpful comment
As this issue was not resolved in 2.1.0, I've developed an extension that should fix the bug in the meantime: https://github.com/pizza-pizza/magento2-shipment-status-fix