cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 : Why the incrementId is incremented when updating sales order?

Magento 2 : Why the incrementId is incremented when updating sales order?

Hi all,

I am using magento 2.1.0 and SOAP Api to invoke SalesOrderRepositoryV1Service in order to update the status and the state of an order from "complete" to "closed".

After executing the update (using service SalesOrderRepositoryV1Save) , I had the same entityId for the order but the incrementId (ID field) was incremented.

The question is why is the ID incremented ? and how can I update an order without incrementing the ID ?

Many thanks.

3 REPLIES 3

Re: Magento 2 : Why the incrementId is incremented when updating sales order?

Hi @KarouiLeila,



Could you please share the code that you are using to update the order?

We will be able to investigate further by looking at your approach.


Best regards.
Gabriel

Welcome to the Magento Forums. Remember to introduce yourself and read the Magento Forums Guidelines.

Re: Magento 2 : Why the incrementId is incremented when updating sales order?

Hi @Gabriel Guarino

 

In fact, i generated an axis2 java client from the wsdl and i used the operation salesOrderRepositoryV1Save. There is some required fields such as : baseGrandTotal, customerEmail and grandTotal. Besides these 3 fields, i mention the entityId and the status and state to update for a given order.

Re: Magento 2 : Why the incrementId is incremented when updating sales order?

Hi,

 

Given the delay, you probably do not need the answer, but it may help someone else.

 

I had the same issue and the answer is that you are not using the right call.

The right solution is to call salesOrderManagementV1AddComment

See https://github.com/magento/magento2/issues/8257 which describes well what should be done.