Skip to content

Product from Feeds

The Plugin supports fetching product lists from external feeds via predefined endpoints. These feeds must be configured and connected beforehand on your end. Once enabled, users see a dropdown selector in the Product block within the Topol editor, making it easy to populate the email with relevant product data.

You must configure two API endpoints:

  • /{API.FEEDS} – for retrieving a list of feeds.
  • /{API.PRODUCTS} – for retrieving products from a specific feed.

Both endpoints should return structured JSON responses and support pagination and filtering.

WARNING

Before implementing the endpoints, check how to work with API endpoints.

List Feeds

Fetches all available product feeds for the user to select from.

  • URL: /{API.FEEDS}
  • Method: GET
  • Content-Type: application-json

Params:

keyvalue
idFeed ID
searchText search across feed names
per_pageNumber of feeds per page (default: 10)
current_pageWhich page of paginated data to return

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"
}

List Products

Returns a paginated list of products for a specific feed. This endpoint is triggered when a feed is selected in the editor UI.

  • URL: /{API.PRODUCTS}
  • Method: GET
  • Content-Type: application-json

Params:

keyvalue
idProduct ID
searchSearch string to filter products
per_pageNumber of products per page (default: 10)
current_pageCurrent page of paginated products
feedThe ID of the selected 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"
}