Product from feeds
We provide an option to use predefined products and display them in a dropdown so your users can simply select a product and display all the important data.
Before implementing the endpoints, check how to work with API endpoints.
List products
- URL:
/{API.PRODUCTS}
<- variable set in TOPOL OPTIONS - Method:
GET
- Content-Type:
application-json
Params:
key | value |
---|---|
id | product id |
search | search query string |
per_page | expected products per page (default is 10) |
current_page | current page of paginated products |
feed | active feed id |
This endpoint is called when retrieving products from FEED.
Response:
json
{
"success": true,
"data": [
{
"id": "product id",
"name": "name of the product",
"description": "description of the product",
"url": "link to the product",
"img_url": "link to an image of the product",
"price_with_vat": "price of the product including VAT", //without currency
"currency": "currency of the price",
"price_before": "original price after product is discounted",
"product_feed_id": "id of the feed product belongs to"
}
],
//pagination helpers
"from": "first id of the resource",
"to": "last id of the resource",
"total_records": "total records of the resource",
"per_page": "resource per page",
"current_page": "current page of the resource",
"last_page": "last page of the resource"
}
List feeds
- URL:
/{API.FEEDS}
- Method:
GET
- Content-Type:
application-json
This endpoint is called when retrieving feeds of products.
Params:
key | value |
---|---|
id | feed id |
search | search query string |
per_page | expected products per page (default is 10) |
current_page | current page of paginated products |
Response:
json
{
"success": true,
"data": [
{
"id": "id of the feed",
"name": "name of the feed"
}
],
//pagination helpers
"from": "first id of the resource",
"to": "last id of the resource",
"total_records": "total records of the resource",
"per_page": "resource per page",
"current_page": "current page of the resource",
"last_page": "last page of the resource"
}