Skip to main content

Data Source "Endpoints" - General Overview

A guide to Rebuy's built-in datasource endpoints: AI-powered recommendations, Top Sellers, Recently Viewed, and more.

Written by Christian Sokolowski
Updated over a week ago

Rebuy Datasource Endpoints

Rebuy has created different endpoints that will return pre-built, custom rules when selected, saving you time when building your personalized widgets. The endpoints built with AI are training and learning, giving updated recommendations based on individual and collective customer data. The Category endpoints pull data and recommend products that meet a set of specific characteristics.

AI Endpoints

Rebuy's AI Endpoints will watch and respond to customer trends without needing any additional effort from you. Recommendations to customers shift as needed based on the data that Rebuy's proprietary AI is pulling from.

Pro tip: Use an AI endpoint as the last rule in any custom ruleset to make sure the widget is always displaying product recommendations.

Recommended (AI) Endpoint

The Recommended (AI) endpoint looks at the input product and cross-references it with other products that customers have purchased together. It continuously trains on your store's order data to keep recommendations current and aligned with actual buying behavior, without any manual updates needed.

Pro tip: Use this endpoint as a dynamic "Customers Also Bought" section anywhere on your storefront.

The Recommended (AI) endpoint supports a configurable lookback window that controls how far back in order history the algorithm looks when identifying co-purchase patterns.

By default, the Recommended (AI) endpoint uses a 90-day lookback window. You can adjust this to any value between 1 and 90 days.

Choosing a lookback window:

  • A shorter window (for example, 7 or 30 days) weights the algorithm toward recent purchasing trends. This works well for stores with fast-moving inventory, seasonal catalogs, or frequent product turnover.

  • A longer window (closer to 90 days) gives the AI a broader dataset to learn from, which tends to produce more stable recommendations for stores with slower purchase cycles or smaller order volume.

Note: Changing the lookback window does not reset the AI model. It adjusts which order data is included in the next training cycle. Existing datasources using Recommended (AI) will remain at the 90-day default until you manually change the setting.

How to Set the Recommended (AI) Endpoint Lookback Window

  1. In the Rebuy Admin, open the datasource you want to configure.

  2. Locate or create the Recommended (AI) endpoint rule.

  3. Set the RETURN statement to Products (Endpoint), then select Recommended (AI) from the endpoint dropdown.

  4. Set the FOR THE LAST field to your desired number of days between 1 and 90.

  5. Save the datasource.

Similar Products (AI) Endpoint

The Similar Products (AI) endpoint enhances product discovery by recommending items that closely match the product a customer is currently viewing. This feature leverages various data sources to make its recommendations highly relevant and personalized.

How Similar Products (AI) Endpoint Works

The Similar Products (AI) endpoint analyzes data from three key areas:

  1. Product Data: Tags, types, and other product attributes.

  2. Customer-Specific Data: Information such as cart contents and past orders.

  3. Storefront-Wide Data: General product details, conversion metrics, and overall store performance.

Pro tip: Use this endpoint on Product Detail Pages (PDPs) to offer alternatives to the product being viewed. It also works well in Post-Purchase to recommend a product similar to one the customer just purchased.

Trending Products (AI) Endpoint

The Trending Products endpoint identifies and highlights products that are gaining popularity based on recent sales data. This endpoint is well suited for showcasing items currently in demand, driving urgency, and boosting sales.

How Trending Products (AI) Endpoint Works

  • The endpoint analyzes sales data over a 30-day sales period.

  • It compares the current sales period to the previous one, focusing on products with a noticeable increase in sales volume.

  • Products with a significant and sustained surge in purchase activity are identified as trending.

Trending products may differ significantly from your top-selling items. If no trending products are found in the results, the endpoint defaults to Top Sellers as the closest alternative, ensuring the widget always returns results.


Category Endpoints

Category endpoints pull and display product recommendations to customers based on specific characteristics. Rebuy regularly checks and updates data to ensure that Category endpoints are displaying the most up-to-date information.

Top Sellers Endpoint

The Top Sellers endpoint dynamically displays the products from your store with the highest sales volume over a selected period. By default, this endpoint pulls sales data from the past 90 days, but you can customize the time frame to display sales rankings from any period between 1 and 90 days.

How Top Sellers Endpoint Works

  • Rebuy automatically collects and updates sales history on a regular basis.

  • The default lookback window for all Top Sellers calls is 90 days, but you can modify it to suit your needs.

Customizing the Top Sellers Endpoint Time Frame

  • Select a time frame between 1 and 90 days in the datasource settings.

  • The system will recalculate and update the rankings based on the selected period.

Pro tip: Use this endpoint paired with a widget on your home page to show customers the most popular items in your store. Learn more about creating a Home Page widget.

The Top Sellers endpoint ranks products by total sales count over the selected "FOR THE LAST" lookback window and does not factor in product price. A lower-priced item purchased frequently may rank above a higher-priced item with fewer total sales.

Buy It Again Endpoint

The Buy It Again endpoint displays items that a customer has previously purchased, making it easy for them to reorder their favorites. This endpoint is only available when the customer is logged into their store account.

How Buy It Again Endpoint Works

  • When a logged-in customer visits your store, the endpoint retrieves their past purchase history to recommend products they've bought before.

  • The endpoint can be paired with other customer-based input rules for enhanced personalization and relevance.

Pro tip: Use this endpoint with an account page widget.

Recently Viewed Endpoint

The Recently Viewed endpoint showcases products that a customer has previously navigated to and viewed on your store. This feature helps customers quickly return to items they're interested in, improving their shopping experience and driving conversions.

How Recently Viewed Endpoint Works

  • The endpoint tracks the products a customer has visited during their session.

  • It dynamically updates to display the most recently viewed items, keeping the list relevant and timely.

Complementary to Items You've Viewed Endpoint

The Complementary to Items You've Viewed endpoint generates product recommendations based on items the customer has previously viewed, as tracked by the Rebuy analytics engine.

Note: This endpoint uses a fallback chain to ensure results are always returned. If viewed products are found but not enough recommendations can be generated, the endpoint falls back to Similar Products (AI). If no products have been viewed, or if both recommended and similar products responses fall short of the requested number, the endpoint falls back to Top Sellers.


Custom Endpoints

Custom endpoints allow you to point a Datasource rule to another pre-configured Datasource, essentially creating a nested set of rules. This is helpful for consolidating your rule sets and reducing the total number of rules in a single Datasource. By arranging rules based on priority, merchants can guide the logic to align with specific business objectives.

To get started, set the RETURN statement in your rule to Endpoint, then select Custom Endpoints.

Then search for and select your pre-existing Datasource from the Custom Endpoints dropdown.

If custom rules do not seem to be applying, check the widget's settings to confirm it is using the correct Datasource. Test configurations by refreshing the page in an incognito browser to avoid caching issues.


Rebuy Datasource Rule-Based Priority and Sequential Evaluation

Rebuy datasources evaluate rules sequentially, from top to bottom, applying each matched rule's returned products to fill the widget's product slots. If a rule matches but doesn't return enough products to fill all slots, evaluation continues down the list until the widget is fully populated.

To stop evaluation once a rule matches, enable Exit If Matched on that rule. This prevents any subsequent rules from running, even if the widget hasn't been fully filled yet.

For best results, arrange rules from most specific to most general, placing your highest-priority logic at the top.


Frequently Asked Questions: Data Source Endpoints

This section covers common questions and issues merchants encounter when working with Data Source endpoints in Rebuy. Each question addresses a specific behavior or configuration challenge that affects how endpoint rules return and display products.

Can I filter the results of an endpoint rule using multiple rules?

Endpoint rules in Rebuy Data Sources cannot be filtered after they run.

Data Source rules run top to bottom, one at a time, until the widget's items-to-show limit is filled. Each rule adds products to the result set independently. There is no post-processing step that filters the combined output — once a rule's products are added to the result set, they are there.

This means that conditions like "And Products With Tags" apply within a single rule, but do not act as a global filter on the products already returned by rules above them. If your first rule is an endpoint rule (such as "Top Sellers" or "Recommended Products"), any filtering condition on a rule below it has no effect on those endpoint results.

What to do instead:

  • Use a Custom Endpoint rule to nest one Data Source inside another. This lets you apply filtering logic at the Data Source level before the results are passed to your widget.

  • Break your logic across multiple widgets, each with its own tightly scoped Data Source, rather than trying to filter a broad endpoint result set within a single Data Source.

What does "Exit If Matched" do in a Data Source rule?

Exit If Matched is a setting on individual Data Source rules that stops all rules below the matched rule from running. When a rule with Exit If Matched enabled returns at least one product, Rebuy treats that rule as the final result and ignores every rule below it in the list.

Why this matters for endpoint rules:

By default, if a rule returns fewer products than the widget's items-to-show limit, Rebuy automatically moves to the next rule to fill the remaining slots. This refill behavior is intentional — it ensures the widget always displays a full set of products when possible.

Enabling Exit If Matched overrides this refill behavior. Use it when you want a specific rule to be the only source of products for the widget, even if it returns fewer items than the display limit.

Example: If your first rule is a "Recently Viewed" endpoint and you only want to show recently viewed products — with no fallback results — enable Exit If Matched on that rule. Without it, Rebuy will fill any empty slots with products from the next rule in the list.

My endpoint isn't returning the products I expect — how do I troubleshoot the cache?

If a Data Source endpoint is not returning expected results after a configuration change, the most likely cause is a stale cache. Rebuy uses several caches to improve performance, and knowing which ones to clear — and which to avoid — is important.

Safe to clear:

  • Product Cache — Clears cached product data. Safe to reset when product information (titles, tags, prices, availability) is not reflecting recent Shopify changes.

  • Product Engine Cache — Clears cached data used by Rebuy's recommendation engine. Safe to reset when recommendation logic is not reflecting recent rule changes.

  • Collections, Metafields, Presentment Prices Cache — Clears cached product collections, product metafield values, and currency-specific pricing data. Safe to reset when collection or metafield changes made in Shopify are not reflected in Rebuy results.

Do not clear (resets metrics):

  • API Endpoint Cache

  • Top Sellers Cache

  • Trending Products Cache

  • Recommended Products Cache

Clearing any of the above metric caches will reset the underlying data those endpoints depend on. For example, clearing the Top Sellers Cache wipes the sales volume data used to rank products, resetting the endpoint results to zero until new data accumulates.

Where to find the Cache Manager:

The Cache Manager is located at Rebuy Admin > Data Sources > Cache Manager

If cache clearing does not resolve the issue:

After clearing the Product Cache and Product Engine Cache, wait a few minutes and reload the widget preview. If the endpoint still does not return expected results, verify that your Data Source rules are saved correctly and that the products being returned match the rule conditions (tags, collections, product IDs) as currently configured in Shopify.

Note: New stores with little or no sales history will not see significant variation in AI Endpoint results right away. Rebuy's personalization engine requires accumulated customer purchase data to generate meaningful recommendations. Result variation improves over time as your store collects sales and browsing data.

Did this answer your question?