Skip to content

On creating shipment via rest API order status remains unchanged #3307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ruby10 opened this issue Feb 5, 2016 · 59 comments
Closed

On creating shipment via rest API order status remains unchanged #3307

ruby10 opened this issue Feb 5, 2016 · 59 comments
Labels
bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@ruby10
Copy link

ruby10 commented Feb 5, 2016

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.
s3

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
s4

@ruby10
Copy link
Author

ruby10 commented Feb 11, 2016

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": []
}
}

@stephangroen
Copy link

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.

_000000013___orders___operations___sales___magento_admin

_000000079___shipments___operations___sales___magento_admin

@mujtaba2012
Copy link

Same behaviour here while making POST v1/shipment call, the status of the order is not changing. Any news on this?

@NadiyaS NadiyaS added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report labels Mar 10, 2016
@NadiyaS
Copy link
Contributor

NadiyaS commented Mar 10, 2016

Hi guys,
thanks for reporting this issue.
Internal ticket was created MAGETWO-50299.

@rohitgupta4
Copy link

@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.

@NadiyaS
Copy link
Contributor

NadiyaS commented Mar 18, 2016

Hi, @rohitgupta4,
MAGETWO-48530 is about Sales Order Shipping Address. The problem described in 2628.

@karanbhomiagit
Copy link

@NadiyaS Could you please tell which release would this be in? And any ETA on that release?

@srinivasanithin
Copy link

@NadiyaS is there any ETA on this bug fix?

@m1keharris
Copy link

We are also getting this problem, is there any update on when a fix might be available?

@ruby10
Copy link
Author

ruby10 commented Apr 27, 2016

Is there any update on this issue?

@rohitgupta4
Copy link

@NadiyaS Any updates on the release milestone related to this issue?

@ruby10
Copy link
Author

ruby10 commented May 9, 2016

Hey @NadiyaS , This issue has been blocker for development work we are doing, Please let us know the updates regarding this issue.

@maityutpal
Copy link

Hi,

I am also facing this issue in case of invoice creation. Any ETA for this ??

@srinivasanithin
Copy link

Hi

Any update on this bug fix

@cafeasp
Copy link

cafeasp commented Jun 2, 2016

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.

@ruby10
Copy link
Author

ruby10 commented Jun 14, 2016

@NadiyaS , @MomotenkoNatalia , is there any update on this issue ?

@mujtaba2012
Copy link

@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?

@claudioxu
Copy link

claudioxu commented Jun 21, 2016

We got the the same issue on 2.0.7, is there any update on 2.1.0?

@NadiyaS
Copy link
Contributor

NadiyaS commented Jun 21, 2016

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.

@timtt-zz
Copy link

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 #3307 (comment), or mute the thread https://github.com/notifications/unsubscribe/ACSYIn3fOnqXAg92eSbokmPcxiNzx6pUks5qN_ylgaJpZM4HUZTh.

@casperbakker
Copy link

I cannot see how this is not:

  • a super high priority
  • relatively easy to fix

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?

@karanbhomiagit
Copy link

@NadiyaS : This bug is one major blocker for any kind of integration to 3rd party softwares.
Please take it with higher priority.

@srinivasanithin
Copy link

@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.

@ruby10
Copy link
Author

ruby10 commented Jun 22, 2016

@NadiyaS , this issues seems to be a terrible problem for so many people developing integrations!

@sshymko
Copy link

sshymko commented Oct 5, 2016

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

@MarkB42
Copy link

MarkB42 commented Oct 6, 2016

@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.*
  • only tested with an order with one line. You must also set the payments object withing the sales object to null or it will throw an exception about a setter missing.

@olysenko
Copy link

olysenko commented Oct 6, 2016

@sshymko Yes, I confirm.
We currently preparing 2.1.3 and 2.0.11 versions for release. No dates yet

@EmilyPepperman
Copy link
Contributor

Did this get solved in 2.1.3 ?

@olysenko
Copy link

Yes, see description of /V1/order/{orderId}/ship in http://devdocs.magento.com/swagger/index.html

@marcosdsdba
Copy link

marcosdsdba commented Jan 19, 2017

Why does "POST /V1/order/{orderId}/ship" not work in Magento 2.1.1 CE?
Returns "Request does not match any route error"

@NadiyaS NadiyaS removed their assignment Jan 19, 2017
@cloudjibao
Copy link

@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 } ] } }

@marcosdsdba
Copy link

marcosdsdba commented Feb 3, 2017

@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"

@itzRamkumar
Copy link

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?

@apluzhnikov
Copy link

apluzhnikov commented Mar 22, 2017

@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

@stephangroen
Copy link

@itzRamkumar Read the comment! It's fixed in 2.1.3, so obviously in 2.1.1 it's still a bug.

@itzRamkumar
Copy link

@apluzhnikov Yes Invoice is Created.

@stephangroen How to upgrade 2.1.1 to 2.1.3 version.

@stephangroen
Copy link

@itzRamkumar http://lmgtfy.com/?q=upgrade+magento+2

@itzRamkumar
Copy link

itzRamkumar commented Mar 22, 2017

@apluzhnikov @stephangroen @NadiyaS Not worked in 2.1.5 version.

OrderStatus : Processing

capture

capture1

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.

@nem6087
Copy link

nem6087 commented Aug 2, 2017

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?

@ddeppner
Copy link

ddeppner commented Aug 3, 2017

@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.

@Nishadup
Copy link

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?

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Dec 21, 2017
@apluzhnikov
Copy link

@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}):
image

@Nishadup
Copy link

@apluzhnikov, Thanks a ton. that resolved my issue.

@danscan1712
Copy link

@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"
}
]
}

@apluzhnikov
Copy link

@danscan1712 hi, I run this json and all is ok, shipment has been raised. In our case with id 16:
image

@amardeepthadisetty
Copy link

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:
complete1
complete2

Any help would be appreciated!!!

@amardeepthadisetty
Copy link

amardeepthadisetty commented Jan 17, 2018

@apluzhnikov
Copy link

@amardeepthadisetty Hi, we got the same issue here, but then after we removed the block with arguments, it worked:
image

@amardeepthadisetty
Copy link

@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!!!

@amardeepthadisetty
Copy link

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!!!

@vittoria-ravi
Copy link

@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"

@https://github.com/marcosdsdba Did you get the solution for above issue on 2.1.1v ? if not to upgrade.

@marcosdsdba
Copy link

@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"

@https://github.com/marcosdsdba Did you get the solution for above issue on 2.1.1v ? if not to upgrade.

Solved in versions 2.4.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests