GET /api/products
?display=[id,reference,price]
&output_format=JSON
200 OK
{
"id": 42,
"reference": "ABC-001"
}
Want an external application to read products from PrestaShop without giving it database credentials?
The native PrestaShop Webservice is the first tool to learn.
In this tutorial we make a real read-only request and retrieve Product ID, Reference/SKU and Price from /api/products.
1. Create Webservice access
Enable Webservice in the Back Office and create an access key. For the first test, read access to the products resource is enough.
Tip
Do not enable every permission. Start with the minimum access the integration actually needs.
2. The API endpoint
https://shop.example/api/Products:
https://shop.example/api/products3. Authentication
curl \
-u "YOUR_WEBSERVICE_KEY:" \
"https://shop.example/api/"Warning
Never expose production API keys in documentation, repositories or public screenshots.
4. Make the first request
curl \
-u "YOUR_WEBSERVICE_KEY:" \
"https://shop.example/api/products"5. Request only the fields you need
/api/products?display=[id,reference,price]curl \
-u "YOUR_WEBSERVICE_KEY:" \
"https://shop.example/api/products?display=[id,reference,price]"6. JSON output
/api/products?display=[id,reference,price]&output_format=JSON7. Filter by reference
/api/products?filter[reference]=[ABC-001]&display=[id,reference,price]EXTERNAL SKU
↓
Find PrestaShop product
↓
Get id_product
↓
Read / Update8. Pagination
/api/products?display=[id,reference,price]&limit=0,100Next batch:
/api/products?display=[id,reference,price]&limit=100,1009. Products and stock are different resources
/api/stock_availablesA useful mental model is:
Product data
+
StockAvailable
=
usable stock dataset10. What about combinations?
/api/combinationsProducts
↓
Combinations
↓
Stock Available
↓
Unified dataset11. Real integration scenario
| ID | SKU | Price | Stock |
|---|---|---|---|
| 21 | ABC-001 | 29.90 | 14 |
| 22 | ABC-002 | 18.50 | 0 |
12. Do not start with PUT
READ
↓
MAP
↓
VALIDATE
↓
TRANSFORM
↓
WRITE
↓
VERIFYTroubleshooting
401: check the access key, Basic Auth, Webservice status and Authorization-header forwarding.
403: check the permissions assigned to the key.
Empty or limited response: check display, filter, limit and the shop context.
Official references
- https://devdocs.prestashop-project.org/9/webservice/
- https://devdocs.prestashop-project.org/9/webservice/tutorials/testing-access/
- https://devdocs.prestashop-project.org/9/webservice/tutorials/testing-webservice-postman/
- https://devdocs.prestashop-project.org/9/webservice/tutorials/advanced-use/additional-list-parameters/
What to do next
Once the first request is stable, add filters, sorting and pagination before scaling extraction. Keep writes separate until you have a safe product-update workflow with read-before-write validation.