API Reference
Complete API documentation for BrainPredict Commerce with endpoints, parameters, and response examples.
Authentication
All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer bp_commerce_live_your_api_key_here
Base URL
https://api.brainpredict.ai/v1/commerce
Endpoints
/api/commerce/recommend-bundleGenerate intelligent product bundle recommendations using association rule mining and collaborative filtering
Endpoints
Parameters:
product_idcustomer_segmenttransaction_historyExample Response:
{
"success": true,
"model": "BundleOptimizer",
"accuracy": 94.2,
"prediction": {
"bundle_id": "bundle_123",
"product_ids": [
"prod_A",
"prod_B",
"prod_C"
],
"confidence": 0.92,
"expected_uplift": 0.25
}
}/api/commerce/allocate-inventoryOptimize inventory allocation across locations using demand forecasting and optimization algorithms
Endpoints
Parameters:
sku_idavailable_quantitylocationsdemand_forecastExample Response:
{
"success": true,
"model": "InventoryAllocationAI",
"accuracy": 93.8,
"prediction": {
"allocation_plan": {
"location_1": 200,
"location_2": 150
},
"optimization_score": 0.89
}
}/api/commerce/predict-return-riskPredict return probability for orders and identify high-risk products
Endpoints
Parameters:
order_idcustomer_idproduct_idsorder_valueExample Response:
{
"success": true,
"model": "ReturnPredictor",
"accuracy": 91.5,
"prediction": {
"return_probability": 0.15,
"risk_level": "low",
"high_risk_products": []
}
}/api/commerce/optimize-loyaltyOptimize loyalty program rewards and tier progression for maximum engagement
Endpoints
Parameters:
customer_idcurrent_tierpurchase_historyengagement_dataExample Response:
{
"success": true,
"model": "LoyaltyOptimizer",
"accuracy": 92.7,
"prediction": {
"recommended_rewards": [
"10% discount",
"free shipping"
],
"tier_progression_path": "silver_to_gold",
"engagement_score": 0.85
}
}/api/commerce/hyper-personalizeGenerate hyper-personalized shopping experiences based on context, behavior, and preferences
Endpoints
Parameters:
customer_idcontextbrowsing_historypreferencesExample Response:
{
"success": true,
"model": "HyperPersonalizationEngine",
"accuracy": 95.1,
"prediction": {
"personalized_homepage": {
"featured_products": [
"prod_X",
"prod_Y"
]
},
"personalization_score": 0.93
}
}/api/commerce/process-voice-commandProcess voice commands for voice commerce interactions
Endpoints
Parameters:
customer_idvoice_inputcontextExample Response:
{
"success": true,
"model": "VoiceCommerceAI",
"accuracy": 89.3,
"prediction": {
"intent": "search_product",
"entities": {
"product_category": "shoes",
"size": "42"
},
"action": "show_products"
}
}/api/commerce/ar-sessionAnalyze AR/VR shopping sessions and provide product recommendations
Endpoints
Parameters:
customer_idproduct_idsession_dataExample Response:
{
"success": true,
"model": "ARVRShoppingIntelligence",
"accuracy": 90.8,
"prediction": {
"engagement_score": 0.87,
"purchase_intent": 0.72,
"recommended_products": [
"prod_Z"
]
}
}/api/commerce/optimize-subscriptionOptimize subscription pricing, billing cycles, and retention strategies
Endpoints
Parameters:
customer_idsubscription_idusage_databilling_historyExample Response:
{
"success": true,
"model": "SubscriptionOptimizationAI",
"accuracy": 93.4,
"prediction": {
"optimal_price": 29.99,
"recommended_billing_cycle": "monthly",
"churn_risk": 0.12
}
}/api/v1/commerce/strategic/benchmarking/performanceBenchmark commerce performance against industry standards and identify optimization opportunities
Endpoints
Parameters:
organization_dataindustrytime_period_daysExample Response:
{
"benchmarking_results": {
"conversion_rate": {
"value": 2.5,
"industry_avg": 2.1,
"percentile": 65
},
"average_order_value": {
"value": 85.5,
"industry_avg": 75,
"percentile": 72
}
},
"performance_gaps": [
"cart_abandonment_rate"
],
"recommendations": [
"Implement cart recovery emails",
"Optimize checkout flow"
]
}/api/v1/commerce/strategic/intelligence/aggregateAggregate insights across all commerce data for strategic decision-making
Endpoints
Parameters:
time_period_daysinclude_predictionsaggregation_levelExample Response:
{
"aggregated_intelligence": {
"total_revenue": 1250000,
"total_orders": 15000,
"average_order_value": 83.33
},
"key_insights": [
"Revenue up 15% vs last period",
"Mobile conversion improving"
],
"strategic_recommendations": [
"Invest in mobile optimization",
"Expand product catalog"
]
}/api/v1/commerce/strategic/benchmarking/industry-standardsGet industry benchmark standards for all supported sectors
Endpoints
Parameters:
Example Response:
{
"industries": [
"retail",
"fashion",
"electronics",
"food_beverage"
],
"benchmarks": {
"retail": {
"conversion_rate": 2.1,
"average_order_value": 75
}
},
"metrics": [
"conversion_rate",
"average_order_value",
"cart_abandonment_rate"
]
}/api/v1/commerce/strategic/intelligence/portfolio-summaryGet summary of commerce portfolio intelligence capabilities
Endpoints
Parameters:
Example Response:
{
"total_models": 20,
"active_models": 20,
"average_accuracy": 0.932,
"capabilities": [
"Bundle Optimization",
"Inventory Allocation",
"Return Prediction",
"Loyalty Optimization"
]
}Rate Limits
API rate limits vary by plan:
- Starter: 1,000 requests/hour
- Professional: 10,000 requests/hour
- Enterprise: Unlimited
Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
SDKs & Libraries
We provide official SDKs for popular programming languages:
Python
pip install brainpredict-commerceNode.js
npm install @brainpredict/commerceJava
mvn install brainpredict-commercePHP
composer require brainpredict/commerce