Integration
REST API
Server-side API endpoints for Commerce Index integration.
Base URLs
Production
https://commerceindex.com/apiStaging
https://api.staging.commerceindex.comAuthentication
Include your API key in the request headers:
X-CI-Api-Key: your_api_key_here
Content-Type: application/jsonEndpoints
POST
/api/collect/product-view
Track a product page view. Use this for server-side tracking.
Auth: X-CI-Api-Key header (optional)
{
"brand_id": "brand_xyz",
"product": {
"product_id": "prod_123",
"sku": "SKU-123",
"title": "Product Name",
"url": "https://brand.com/products/..."
},
"context": {
"timestamp": "2025-12-22T15:30:00Z",
"session_id": "sess_abc123",
"country": "US",
"locale": "en-US"
}
}POST
/api/collect/product-purchase
Track a completed purchase. Use this for server-side tracking.
Auth: X-CI-Api-Key header (optional)
{
"brand_id": "brand_xyz",
"order": {
"order_id": "order_789",
"currency": "USD",
"total_value": 129.97,
"items": [
{
"product_id": "prod_123",
"sku": "SKU-123",
"title": "Product Name",
"quantity": 2,
"unit_price": 39.99
}
]
},
"context": {
"timestamp": "2025-12-22T15:31:00Z",
"session_id": "sess_abc123"
}
}GET
/api/ci/product-proof
Retrieve social proof data for a specific product.
Auth: X-CI-Api-Key header (optional)
Query Parameters
brand_idstringRequired
Your brand identifierproduct_idstringRequired
The product identifierwindow_viewsintegerMinutes for view count (default: 60)window_purchasesintegerHours for purchase count (default: 24)GET /api/ci/product-proof?brand_id=brand_xyz&product_id=prod_123&window_views=60&window_purchases=24Error Codes
200Success - event accepted or data returned400Bad Request - validation error in request body401Unauthorized - invalid or missing API key404Not Found - brand or product not found500Server Error - internal error, retry later