Jump to content

Webservice API - Change order state and generate stock movement


Recommended Posts

I'm using the PrestaShop WebService API to change the order state. To achieve this, I make a POST request like the following:

POST -> https://www.mydomain.com/api/order_histories
Body:

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
    <order_history>
        <id/>
        <id_employee>1</id_employee>
        <id_order_state>4</id_order_state>
        <id_order>7</id_order>
        <date_add/>
    </order_history>
</prestashop>

In this scenario, state 4 corresponds to "Sent," causing PrestaShop to reduce the stock of the product. The issue, however, is that it does not generate a new entry in the stock movements, resulting in a loss of traceability in the back office.

How can I force PrestaShop to generate a stock movement entry? I have attempted using the stock_movements resource, but it seems that post, put, and patch operations are not permitted.

Thanks in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...