E-commerce API Endpoints
Industry-specific endpoints optimized for e-commerce use cases. Get from integration to revenue impact in minutes, not weeks.
90%
Less integration code
< 5min
Time to first recommendation
15-30%
Typical CTR improvement
Homepage Recommendations
Optimized recommendations for e-commerce homepage with intelligent strategy
POST
/api/v1/recommendations/ecommerce/homepage
Optimizations
Relevancia optimizada
In-stock products only
12 items optimal
No explanations (performance)
// SDK (3 lines)
const client = new Rayuela({ apiKey: "YOUR_API_KEY" });
const recs = await client.ecommerce("user-123", {
page: "homepage",
limit: 12
});Product Page Cross-sell
Cross-sell and related product recommendations for product detail pages
POST
/api/v1/recommendations/ecommerce/product-page
Optimizations
Engagement-focused strategy
Excludes current product
Includes explanations
8 items optimal
// SDK (3 lines)
const client = new Rayuela({ apiKey: "YOUR_API_KEY" });
const recs = await client.ecommerce("user-123", {
page: "product",
limit: 8
});Shopping Cart Add-ons
Complementary product recommendations for shopping cart page
POST
/api/v1/recommendations/ecommerce/cart
Optimizations
Complementary items focus
Excludes cart items
Quick decision optimized
6 items optimal
// SDK (3 lines)
const client = new Rayuela({ apiKey: "YOUR_API_KEY" });
const recs = await client.ecommerce("user-123", {
page: "cart",
limit: 6
});Checkout Upsells
Last-chance upsell recommendations for checkout page
POST
/api/v1/recommendations/ecommerce/checkout
Optimizations
Price capped at 30% of order
Quick-add items focus
Minimal distraction
4 items optimal
// SDK (3 lines)
const client = new Rayuela({ apiKey: "YOUR_API_KEY" });
const recs = await client.ecommerce("user-123", {
page: "checkout",
limit: 4
});Complete E-commerce Integration Example
Full implementation showing all endpoints in a typical e-commerce flow
// Complete E-commerce Integration
import Rayuela from "rayuela-sdk";
const client = new Rayuela({ apiKey: "YOUR_API_KEY" });
// 1. Homepage recommendations
const homepage = await client.ecommerce("user-123", {
page: "homepage",
limit: 12,
inStockOnly: true
});
// 2. Product page cross-sell
const crossSell = await client.ecommerce("user-123", {
page: "product",
limit: 8
});
// 3. Cart add-ons
const cartAddons = await client.ecommerce("user-123", {
page: "cart",
limit: 6
});
// 4. Checkout upsells
const upsells = await client.ecommerce("user-123", {
page: "checkout",
limit: 4
});
// 5. Track interactions
await client.track({
userId: "user-123",
productId: "product-456",
type: "purchase",
value: 99.99
});
// 6. Get business impact
const metrics = await client.getMetrics();
console.log(`Revenue impact: $${metrics.revenueAttribution}`);