Skip to content
On this page

Product from feeds

WARNING

When working with custom endpoints don't forget to allow our server d5aoblv5p04cg.cloudfront.net as a known origin. Otherwise you are going to run into CORS issues.

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.

List products

  • URL: /{API.PRODUCT} <- variable set in TOPOL OPTIONS
  • Method: GET
  • Content-Type: application-json

Params:

keyvalue
idproduct id
searchearch query string
per_pageexpected products per page (default is 10)
current_pagecurrent page of paginated products
feedactive 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": "from id of the resource",
  "to": "to ide 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:

keyvalue
idproduct id
searchearch query string
per_pageexpected products per page (default is 10)
current_pagecurrent page of paginated products

Response:

json
{
  "success": true
  "data": [
    {
      "id": "id of the feed",
      "name": "name of the feed"
    }
  ],
  //pagination helpers
  "from": "from id of the resource",
  "to": "to ide 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",
}