Jump to content

How do i edit an order state using the API ?


J0vis

Recommended Posts

Hello,
My boss needs me to create an application to control the stock of products and delivery of orders. I made a lot of progress with the API and right now im able to retrive all the data i need and show on the front-end whatever my boss asks for, but right now i need to actly change the values inside the store on a group of orders, a good example would be: Change all order_states = 21 to order_states = 3. I could not understand how to do the in the documentation, so if anyone can point me in the right direction it would amazing. The application is web based so html, css, php, js. Thanks in advance.
I just finished college and i feel like this is way byond me right now, im the whole "IT sector" here and sincerily i think boss is crazy asking an intern on his first job to manage this much data but... Holy fuck anxiety is way too loud right now sorry.

Link to comment
Share on other sites

  • 2 months later...
On 2/17/2025 at 5:34 PM, J0vis said:

Hello,
My boss needs me to create an application to control the stock of products and delivery of orders. I made a lot of progress with the API and right now im able to retrive all the data i need and show on the front-end whatever my boss asks for, but right now i need to actly change the values inside the store on a group of orders, a good example would be: Change all order_states = 21 to order_states = 3. I could not understand how to do the in the documentation, so if anyone can point me in the right direction it would amazing. The application is web based so html, css, php, js. Thanks in advance.
I just finished college and i feel like this is way byond me right now, im the whole "IT sector" here and sincerily i think boss is crazy asking an intern on his first job to manage this much data but... Holy fuck anxiety is way too loud right now sorry.

Using PrestaShop webservice, you can achieve your goal, but it completely depends on your logic & requirement.

As you said, you want to change all order states from one to another, so you need to get all the orders & run in a loop & call the POST API to update the order using the order ID.

You need to pass the required parameters in this POST API.

If you are using PrestaShop 8 & above, then you can use the PATCH method to update a particular key.

You can check the order blank schema on this link below.

https://devdocs.prestashop-project.org/8/webservice/resources/orders/#blank-schema

 

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