Send a shipping request, get ranked options back, pick one (or let Treoir pick for you), and track it through delivery. Three endpoints cover the whole lifecycle.
http://localhost:3000/api/v1/api/v1/fulfillment/optimizeEvaluate all feasible carrier × warehouse × service combinations for a shipment and return ranked fulfillment strategies. This is the core endpoint - send your logistics intent, get back the optimal options.
Weights are normalized values from 0 to 1 that tell the optimizer how much you care about each objective. A weight of 0.6 on cost and 0.4 on reliability means you want the cheapest option that is still reliable. The weights don't need to sum to 1. They're normalized internally.
Instead of vague “3-5 days” estimates, Treoir returns probability distributions. The p50 date means there's a 50% chance it arrives by then; p90 means 90% confidence; p99 means near-certain. Constraint checking uses p90 by default.
Each strategy gets a 0-1 composite score based on your weighted objectives. Higher is better. Strategies are Pareto-ranked, meaning no returned option is strictly worse than another on all dimensions.
Strategies that violate your constraints (budget, deadline, carrier exclusions) are still returned but marked with meets_constraints: false and sorted below feasible options. This lets you see what would work if you relaxed a constraint.
Shipments progress through these statuses. In production, you'd receive webhook callbacks for each transition.