Using the REST webservice
Last updated
Was this helpful?
Last updated
Was this helpful?
This tutorial shows you how to use the PrestaShop web service with PHP library by creating a "CRUD" application.
PrestaShop 1.4 installed on a server with mod_rewrite
enabled (Apache only).
A local XAMPP server with PHP5.
is an acronym that stands for "Create, Read, Update, Delete". These are the four basic operations for managing data in an application.
The PrestaShop web service uses the REST architecture in order to be available on as many platforms as possible, since HTTP and XML protocols are present on countless platforms.
defines an architecture that represents a set of good methods to practice on the web. It defines several rules, including one that we will describe that is similar to CRUD.
In HTTP, there are that can perform processing on data that are defined in the REST architecture. This correspondence can also be done with CRUD and SQL:
HTTP/ REST
CRUD
SQL
POST
Create
INSERT
GET
Retrieve
SELECT
PUT
Update
UPDATE
DELETE
Delete
DELETE
Together, we will look at how to create a small application to perform these four operations on our customers.
Chapters 1, 2 and 3 are mandatory.
In the next chapters, you'll learn how to interact with the web service with each of the CRUD operations, in order to give you the tools to make a full CRUD application.
If you only want to retrieve data, for example when developing a web application to notify you of orders, you might only be interested in Chapter 4.
If you prefer to develop a more complete application, chapters 4 to 7 will interest you.
Copy/paste the file into an empty text local file, using for instance Notepad.
Save the file as PSWebServiceLibrary.php
Manage your PrestaShop website through Open ERP: by Akretion & CampToCamp (GNU Affero GPLv3)
A Scala library to access the PrestaShop web service: by Alex Dean (GNU Affero GPLv3)
A Python library to access the PrestaShop web service: by Guewen Baconnier (GNU Affero GPLv3)
The latest version of the PSWebServiceLibrary.php file can be found on our code repository: To download the file:
Click here to view the raw file:
You can also directly download a zip archive of all the files in this repository, including the example files, by clicking here:
All the example files can be found on our code repository: