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).
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 |