All Posts

Product Discovery APIs and UCP: The Layer Before Checkout

AI agents need to find the right product before they can buy it. Here is how product search and discovery APIs connect to UCP checkout and what the integration pattern looks like in practice.

November 16, 2026UCPList Team
product discoverysearch APIUCPAI agentsecommerce searchagentic commerce

The Gap Between Search and Purchase

UCP standardizes checkout. It does not standardize product search.

When a buyer tells an agent "find me a rain jacket under $150, size medium, in stock," the agent has to figure out where to look, how to query, and how to interpret the results before it can initiate a UCP checkout. That first phase, finding the product, runs on top of whatever search infrastructure the merchant has deployed.

This is the discovery layer. It is the part of agentic commerce that does not get standardized by the protocol. Every merchant's search API is different. Understanding how these APIs work, and how to connect them to UCP checkout, is practical knowledge for any agent developer.

What Discovery APIs Do

Product discovery APIs handle catalog search. You send a query, they return a ranked list of products with attributes. That is the core of it.

The details matter a lot in practice:

Faceted filtering lets you narrow results by structured attributes: size, color, price range, brand, availability. Good search APIs expose facet counts so you know how many results remain after each filter is applied.

Ranking determines what order results appear in. Most search platforms combine text relevance with behavioral signals (what buyers clicked and purchased) and merchandiser rules (what the retailer manually configured). Agent queries hit the same ranking as human queries.

Natural language handling varies widely. Some platforms require exact keyword matches. Others use semantic similarity to match "affordable waterproof jacket" to products that contain neither "affordable" nor "waterproof" in their titles if contextual signals align.

Recommendations surface related products given a product ID or user context. These are useful when the agent needs to suggest alternatives or complementary items alongside a purchase decision.

The API Pattern

Most ecommerce search APIs follow a consistent pattern, regardless of the underlying platform.

// Generic pattern: query, filter, get structured results
const results = await searchApi.query({
  q: 'running shoes',
  filters: {
    size: '10',
    available: true,
    price: { max: 150 },
  },
  limit: 10,
});

// Result structure: array of products with attributes
for (const product of results.items) {
  console.log(product.name, product.price, product.sku, product.url);
}

The specific client and endpoint vary. Algolia uses an npm package. Klevu uses a REST endpoint with a JSON body. Doofinder uses query parameters. But the shape of the problem is the same: send a structured query, receive structured product data.

Connecting Discovery to UCP Checkout

Once an agent selects a product from a search result, it needs to connect that selection to a UCP checkout. The connection is the product identifier, typically a SKU or product ID, that maps from the search result to the UCP checkout payload.

// 1. Search for the product
const searchResults = await algoliaIndex.search('rain jacket', {
  facetFilters: ['size:M', 'available:true'],
  numericFilters: ['price<=150'],
  attributesToRetrieve: ['sku', 'name', 'price', 'ucp_endpoint'],
});

const selected = searchResults.hits[0];
console.log('Selected:', selected.name, '$' + selected.price);

// 2. Verify the merchant has a UCP endpoint
const manifest = await fetch(selected.ucp_endpoint + '/.well-known/ucp')
  .then(r => r.json());

console.log('UCP capabilities:', manifest.capabilities);

// 3. Initiate UCP checkout with the selected SKU
const order = await fetch(selected.ucp_endpoint + '/checkout', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    items: [{ sku: selected.sku, quantity: 1 }],
    payment_token: agentPaymentToken,
    shipping_address: buyerAddress,
  }),
}).then(r => r.json());

console.log('Order created:', order.order_id);

The search result provides the SKU. The UCP endpoint is either stored in the search index (if the merchant has added it as a custom attribute) or discovered separately via the merchant's domain. The checkout call uses the SKU from the search result to identify what to purchase.

Storing UCP Endpoints in the Search Index

One pattern that simplifies agent integration: store the UCP endpoint as a custom attribute in the search index alongside other product data.

When a Shopify merchant enables UCP, their store exposes a UCP endpoint at a predictable path. The merchant or their developer can add this endpoint as a product attribute in Algolia, Constructor, or any other search platform they use.

{
  "objectID": "prod-001",
  "name": "Trail Runner Pro",
  "sku": "TRP-M-BLK",
  "price": 129.99,
  "available": true,
  "ucp_endpoint": "https://outdoorgear.example.com/api/ucp"
}

An agent searching this index gets the UCP endpoint directly in the search result. No separate lookup is needed. The search result and the checkout target are co-located in the same API response.

This is not a requirement. Many agents discover UCP endpoints via the /.well-known/ucp path or through the UCPList directory. But for agents that rely heavily on search APIs, embedding the endpoint in the index reduces round trips.

When the Merchant Does Not Have a Search API

Not every UCP-enabled merchant has a dedicated search API. Many Shopify stores do not run Algolia or Constructor. They rely on Shopify's built-in search, which has a GraphQL API.

// Shopify Storefront API product search
const SHOPIFY_API = 'https://your-store.myshopify.com/api/2024-01/graphql.json';
const token = process.env.SHOPIFY_STOREFRONT_TOKEN!;

const query = `
  query searchProducts($query: String!) {
    search(query: $query, types: [PRODUCT], first: 10) {
      edges {
        node {
          ... on Product {
            title
            handle
            priceRange { minVariantPrice { amount } }
            variants(first: 1) {
              edges { node { sku availableForSale } }
            }
          }
        }
      }
    }
  }
`;

const result = await fetch(SHOPIFY_API, {
  method: 'POST',
  headers: {
    'X-Shopify-Storefront-Access-Token': token,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ query, variables: { query: 'rain jacket size M' } }),
}).then(r => r.json());

const products = result.data?.search?.edges?.map((e: any) => e.node) || [];
console.log('Found', products.length, 'products via Shopify GraphQL');

The Shopify Storefront API is available for all Shopify stores that have issued a public storefront token. For UCP-enabled Shopify merchants, you can search their catalog through the Storefront API and then proceed to UCP checkout using the discovered endpoint.

Ranking and Merchandising Awareness

Agent developers should be aware that search results are not neutral. Every search platform applies ranking logic that reflects a mix of algorithmic relevance, behavioral signals, and merchandiser intent.

Merchandisers configure boost rules, pin rules, and promotional insertions. An agent searching for "headphones" might get a promoted product at position one that the retailer is pushing for margin reasons, not because it is the best match for the query.

This is not inherently a problem. Agents can treat search results the same way a buyer does: results are ranked by a combination of relevance and business logic. But it is useful context when evaluating whether the top result is truly the best match for the buyer's criteria or whether additional filtering is warranted.

One approach: combine search API results with explicit attribute filtering to narrow candidates before applying the platform's ranking. Use the search API's facet filters to constrain to products that meet the buyer's hard requirements (size, price, availability), then let the platform's ranking sort among the qualifying candidates.

The UCPList Search and Discovery Category

The Search and Discovery category on UCPList tracks the search platforms operating in the UCP ecosystem. Coverage includes enterprise platforms like Algolia, Constructor, Bloomreach, and Coveo, mid-market tools like Searchspring and Klevu, and SMB-focused platforms like Doofinder.

Each listing includes a code example showing how to query that platform's API. Browse the category to find the platforms your target merchants are likely to use and understand the specific API patterns for each one.

Discovery and checkout are two separate integrations. Getting both right is what makes an agent capable of end-to-end commerce.

Read next