Reading list Switch to dark mode

    How to update specific fields in a resources using webservice in PrestaShop 8

    Updated 1 September 2023

    In this blog, We are going to learn how to update specific fields of an object class.

    First of all, we want to inform you that in Prestashop 1.7 when you update any resource data you need to send all required fields in the API request using the PUT method because no PATCH method exists in 1.7.

    PS17_No_Patch

    In PrestaShop 8, the PreatShop team introduced a new Request method named PATCH. Using this method you can update some specific fields (which means not need to send all requested fields in the request data).

    Patch_In_PS8

    Let’s understand the process with a live practical.

    Before, If we wanted to update any resource then we needed to send all required fields else we would get an error with status code 400 (Bad Request). Check the below image.

    Searching for an experienced
    Prestashop Company ?
    Find out More
    Put

    In PrestaShop 8, You can make the same request with the PATCH method, You’ll end up with a 200 Ok status & things will be updated in DB as per your request.

    Patch

    That’s all about this blog. Hope it will help you.

    If you are facing any issues or have any doubts about the above process, please feel free to contact us through the comment section.

    Also, you can explore our PrestaShop Development Services and a large range of quality PrestaShop Modules.

    For any doubt contact us at [email protected]

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home