Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Table of content

Using the PrestaShop Web Service

PrestaShop enables merchants to give third-party tools access to their shop's database through a CRUD API, otherwise called a web service.

About CRUD & REST

The PrestaShop web service uses the REST architecture in order to be available on as many platforms as possible, since the HTTP protocol and XML files are understood by most platforms, if not all.

CRUD is an acronym that stands for "Create, Read, Update, and Delete". These are the four basic operations for managing data in an application.

REST defines roughly a style of software architecture, which promotes the use of HTTP methods when building web application, instead of custom methods or protocols such as SOAP or WSDL. It defines several rules, including one that is similar to CRUD, which is described below.

HTTP has several methods that can perform processing on data as defined in the REST architecture, among which are 4 main methods. See this page: http://en.wikipedia.org/wiki/HTTP#Request_methods

The table below offers a comparison with CRUD and SQL:

HTTP / REST

CRUD

SQL

POST

Create

INSERT

GET

Retrieve

SELECT

PUT

Update

UPDATE

DELETE

Delete

DELETE

Learning how to use the web service

Documentation

The quickest way to learn the intricacies of the PrestaShop web service is to use the web service one-page documentation.

Tutorial

The slowest by most complete way to learn about the web service is to follow the tutorial.

It demonstrates how to use the PrestaShop web service by creating a CRUD application using the dedicated PHP library.

Implementations

  • Manage your PrestaShop website through Open ERP: Prestashop OpenERP Connector by Akretion & CampToCamp (GNU Affero GPLv3)
  • A Scala library to access the PrestaShop web service: prestasac by Alex Dean (GNU Affero GPLv3)
  • A Python library to access the PrestaShop web service: prestapyt by Guewen Baconnier (GNU Affero GPLv3)

Files

Web service library

The latest version of the PSWebServiceLibrary.php file can be found on our code repository: https://github.com/PrestaShop/PrestaShop-webservice-lib/blob/master/PSWebServiceLibrary.php
To download the file:

  1. Click here to view the raw file: https://raw.github.com/PrestaShop/PrestaShop-webservice-lib/master/PSWebServiceLibrary.php
  2. Copy/paste the file into an empty text local file, using for instance Notepad.
  3. Save the file as PSWebServiceLibrary.php

You can also directly download a zip archive of all the files in this repository, including the example files, by clicking here: https://github.com/PrestaShop/PrestaShop-webservice-lib/archive/master.zip

Examples files

All the example files can be found on our code repository: https://github.com/PrestaShop/PrestaShop-webservice-lib/tree/master/examples

 

  • No labels