Calculate freight margin
calculate_marginRead-onlyIdempotent
Margin on a load from the buy rate (carrier cost) and sell rate (what the shipper pays): margin in dollars and percent of sell, the per-mile spread when miles are given, and the sell price needed to hit a target margin. Pure arithmetic; does not count toward the allowance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buy | Yes | Carrier cost (buy rate) for the load, all-in, in dollars. | |
| sell | Yes | Shipper price (sell rate) for the load, all-in, in dollars. | |
| miles | Yes | Loaded miles, or null. | |
| target_margin_pct | Yes | Target margin as a percent of sell, e.g. 15, or null. |