Magento2: Sales order ID is updated when sales order save is called from SOAP API

Created on 3 Jan 2017  路  4Comments  路  Source: magento/magento2

Hi all,

When using the Magento 2.1.1 SOAP API to update the sales order state, the displayed ID (increment_id) is changed with the order state.

Preconditions

We use a JAVA client for the magento 2.1.1 SOAP API to handle sales order in an external application.

Steps to reproduce

  1. Create a sales order from the magento shop. Assume that the displayed order ID (increment_id) is 0000001 and the internal order ID (entity_id) is 1. The order is created and its state is complete.
  2. Use the salesOrderRepository SOAP API to fetch the order and treat it in our external application.
  3. Assume the the order is completely treated in our application, we want to close it. So we use the salesOrderRepository SOAP API save operation to update the order state from complete to closed.

Expected result

What we expected is that the order state is changed but its visible ID remains the same since it is the ID sent to the customer as a reference and if something wrong happens we will not find a reference to the customer order.

Actual result

The order state is updated correctly but the visible ID is increment to 0000002. The internal order ID is not touched and we are still able to fetch it using the SOAP API with the same internal ID. Finally we have sent an email to the customer telling him that his order (ID = 0000001) is created and when the order is treated, its visible ID is changed to 0000002. Our problem here is when the customer will complain about an error occurred in his order, he will tell us that his order ID is 0000001 which does not exist anymore in the magento store since it is transformed to 0000002 after the SOAP API save call.

Best Regards

FrameworWebapi Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x bug report

Most helpful comment

The same result with REST calls.

All 4 comments

Hi, @hacheni! Thank you for reporting! The internal ticket MAGETWO-70885 was created to address this issue.

Do you know that order has to be refunded to get the status 'Closed'?
But if the custom order status within the same state was created and then I will change its status we will have the similar situation as you described.

These links may help you in some way:

  1. What are the definitions of the order statuses? OR: Where should I integrate my order state?
  2. Manage Magento 2 Order Status Ultimate Guide

@hacheni, thank you for your report.
We've created internal ticket(s) MAGETWO-70885 to track progress on the issue.

The same result with REST calls.

Hi @hacheni.

Thank you for your report and collaboration!

The issue was fixed by Magento team. The fix was delivered into magento/magento2:2.3-develop branch(es).
Related commit(s):

The fix will be available with the upcoming 2.3.4 release.

Was this page helpful?
0 / 5 - 0 ratings