company_customer_profitability
Build a customer profitability report for a period, computing revenue, costs, contribution, margin, AOV, return rate, and customer class, with concentration and reconciliation to margin totals.
Instructions
Build the sealed customer profitability for the window: per customer (the opaque ref each persisted order was captured with) orders, units, returns, net revenue, landed cost, fees, fulfilment, return handling, contribution, margin, average order value, return rate, rank, share, and a class (core, promising, drain, long tail), with the concentration and whether the totals tie to the margin report (payload: optional window_start, window_end, target_margin_percent, return_rate_threshold_percent, core_share_percent).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>",
"bundle_json": "<bundle_json>"
},
"name": "company_customer_profitability"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| now | No | ||
| engine | No | ||
| operation | No | build | |
| entity_ref | No | ||
| project_id | Yes | ||
| bundle_json | Yes | ||
| payload_json | No | {} |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |