/api/propensity_buy_product

Header
X-Customer-Api-Id: <uuid>
X-Secret: <secret>
Content-Type: application/json
Request Body Schema
{
  "product_sku": "string",           // required
  "customers": [                     // required
    {
      "customer_id": "string",       // required
      "features": {                  // required: flat numeric feature vector (≤50 fields)
        "<feature_name>": number,
        ...
      },
      "label_buy": 0|1               // optional: ground-truth flag for training
    },
    ...
  ]
}
Example Request Body
{
  "product_sku": "SKU-A123",
  "customers": [
    {
      "customer_id": "C-1001",
      "features": {
        "age": 34,
        "tenure_months": 27,
        "category_views_last_30d": 15,
        "avg_ticket": 185.3
      },
      "label_buy": 1
    },
    {
      "customer_id": "C-1002",
      "features": {
        "age": 57,
        "tenure_months": 3,
        "category_views_last_30d": 2,
        "avg_ticket": 42.1
      }
    }
  ]
}
Example Response Body
{
  "predictions": [
    {
      "customer_id": "C-1001",
      "probability": null,
      "propensity_tier": "Very Low",
      "interpretation": "Very low propensity – deprioritise in current cycle."
    },
    {
      "customer_id": "C-1002",
      "probability": null,
      "propensity_tier": "Very Low",
      "interpretation": "Very low propensity – deprioritise in current cycle."
    }
  ],
  "model_info": {
    "note": "not enough labelled rows to train (need ≥20 & both classes)"
  }
}
Description

Predict each customer’s probability of buying a specific SKU next cycle and assign them to one of five tiers (Very High, High, Medium, Low, Very Low) to drive targeted campaigns, look-alike audiences, and personalised recommendations.

Business Usage

• Email optimisations: Target only High & Very High tiers for SKU promotions. • On-site personalisation: Show product banners to users with propensity ≥ 0.7. • Paid media: Export top 10% to seed look-alike audiences. • Sales prioritisation: Push “Very High” B2B accounts into call lists.

← Back to all routes