Skip to content

Multiple primary products

A primary product is a capacity type on the same departure (passenger seats, cabins, lane metres). It is not an assignment key. V1 does not support multiple primaries on one service; V2 does via service-scoped assignments.

DomainPatternExamples
Several primaries{primary}_{capability}cabin_recommendation, lane_meter_forecast
One primary{capability}recommendation, forecast
  • Primary and capability are tenant-defined slugs. PIE does not maintain a fixed list of either.
  • Each key binds to one active model version. Only create keys you actually use.

Handler input and output come from the assigned model’s contracts in the registry, not from the key name. Several current strategy handlers share one live input shape; see Assignments and the API reference for the model you run.

SettingValue
Client / domainspirit_of_tasmania
Service (one sailing)DEV2026-05-18T09-00

Example primaries: passenger_seat, cabin, lane_meter.
Example capabilities: recommendation, optimal_policy, forecast (names are illustrative).

Keys look like passenger_seat_recommendation, cabin_forecast, etc. A single-primary domain would use recommendation, forecast, instead.

  1. POST .../service/init once per departure.
  2. Operator binds each key: PUT .../service/{service_id}/assignments/{assignment_key}.
  3. Integrator runs jobs: POST .../assignments/{assignment_key}/jobs with that model’s input.

For p primaries and one capability, issue p job calls — same route shape, different keys and per-primary capacity in input (when the model expects it).

Terminal window
export API="https://test-pie.streamline.enterprises"
export TOKEN="<access_token>"
export CLIENT="spirit_of_tasmania"
export DOMAIN="spirit_of_tasmania"
export SERVICE_ID="DEV2026-05-18T09-00"
ASSIGNMENT_KEY="cabin_recommendation" # {primary}_{capability}
curl -X POST "${API}/v2/clients/${CLIENT}/domains/${DOMAIN}/service/${SERVICE_ID}/assignments/${ASSIGNMENT_KEY}/jobs" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"input": {
"departure": "2026-05-18T09:00:00+10:00",
"now": "2026-05-17T14:30:00+10:00",
"state": 18.0
}
}'

Repeat with passenger_seat_recommendation / lane_meter_recommendation (and other capabilities) as needed. Poll GET /v2/jobs/{job_id}.

One recommendation per service_id; multiple primaries ⇒ multiple service ids. Prefer V2 assignments for new integrations.