› compliance_grid.aiCOMPLIANCEGRIDGOV · COMPLIANCE · INTELLIGENCE
Freight Risk Scoring

Score one shipment against its freight benchmark

POST/freight-risk/score$0.05 per call

Scores one shipment against its freight benchmark and returns a 0-99 score, the deviation and percentile behind it, reason codes, and the points it would add to a composite score. Authenticate with `Authorization: Bearer <API key>` or the `x-api-key` header. This release accepts USD only (convert first), does not post to a counterparty's composite score (`contribution.posted_to` is null), and serves the 24-month benchmark window. Errors use RFC 9457 problem details.

Send an Idempotency-Key header to retry safely.

Request body

FieldTypeDescription
originrequiredstringUN/LOCODE or ISO 3166-1 alpha-2 country code
destinationrequiredstringUS port or US in v1
moderequiredstringone of "ocean", "ocean_container", "air"
hs_coderequiredstring4–10 digits; dots and spaces are stripped
weight_kgrequirednumber
goods_valuerequiredobject
goods_value.amountrequirednumbermin 0
goods_value.currencyrequiredstringISO 4217. This release accepts USD only; other currencies return 422 `unsupported_currency`.
freightrequiredobject
freight.amountrequirednumbermin 0
freight.currencyrequiredstringISO 4217. This release accepts USD only; other currencies return 422 `unsupported_currency`.
freight_scopeoptionalstringone of "port_to_port", "door_to_door" · default "port_to_port"
incotermoptionalstringone of "EXW", "FCA", "FAS", "FOB", "CFR", "CIF", "CPT", "CIP", "DAP", "DPU", "DDP"
shipment_dateoptionalstringformat date
shipment_refoptionalstringmax length 128
counterparty_idoptionalstringAccepted and stored with the score. Posting the score to that entity's composite score is not enabled in this release.
optionsoptionalobject
options.include_bandsoptionalbooleandefault true
options.benchmark_as_ofoptionalstringformat date

Response fields

FieldTypeDescription
idstring
objectstring
created_atstring
shipment_refstring or null
scoreinteger
levelstring
driving_measurestring
measuresobject
measures.freight_per_kgobject
measures.freight_per_kg.valuenumber
measures.freight_per_kg.unitstring
measures.freight_per_kg.znumberRobust z-score against the band
measures.freight_per_kg.percentilenumber
measures.freight_per_kg.bandobject
measures.freight_per_kg.band.p5number
measures.freight_per_kg.band.p10number
measures.freight_per_kg.band.p25number
measures.freight_per_kg.band.p50number
measures.freight_per_kg.band.p75number
measures.freight_per_kg.band.p90number
measures.freight_per_kg.band.p95number
measures.freight_per_kg.band.robust_sigmanumber(p75 - p25) / 1.349
measures.freight_per_kg.band.n_cellsinteger
measures.freight_per_kg.band.weight_kg_coverednumber
measures.freight_pct_of_valueobject
measures.freight_pct_of_value.valuenumber
measures.freight_pct_of_value.unitstring
measures.freight_pct_of_value.znumberRobust z-score against the band
measures.freight_pct_of_value.percentilenumber
measures.freight_pct_of_value.bandobject
measures.freight_pct_of_value.band.p5number
measures.freight_pct_of_value.band.p10number
measures.freight_pct_of_value.band.p25number
measures.freight_pct_of_value.band.p50number
measures.freight_pct_of_value.band.p75number
measures.freight_pct_of_value.band.p90number
measures.freight_pct_of_value.band.p95number
measures.freight_pct_of_value.band.robust_sigmanumber(p75 - p25) / 1.349
measures.freight_pct_of_value.band.n_cellsinteger
measures.freight_pct_of_value.band.weight_kg_coverednumber
measures.value_per_kgobject
measures.value_per_kg.valuenumber
measures.value_per_kg.unitstring
measures.value_per_kg.znumberRobust z-score against the band
measures.value_per_kg.percentilenumber
measures.value_per_kg.bandobject
measures.value_per_kg.band.p5number
measures.value_per_kg.band.p10number
measures.value_per_kg.band.p25number
measures.value_per_kg.band.p50number
measures.value_per_kg.band.p75number
measures.value_per_kg.band.p90number
measures.value_per_kg.band.p95number
measures.value_per_kg.band.robust_sigmanumber(p75 - p25) / 1.349
measures.value_per_kg.band.n_cellsinteger
measures.value_per_kg.band.weight_kg_coverednumber
reasonsarray of object
reasons[].codestringStable within v1; new codes may be added, so treat unknown codes as info.
reasons[].severitystring
reasons[].measurestring
reasons[].messagestring
contributionobject
contribution.factorstring
contribution.weightnumberFactor weight in the composite (default 0.15)
contribution.confidence_multipliernumberThe multiplier already applied to the score (1.0 high, 0.8 medium, 0.6 low). Reported for transparency.
contribution.pointsnumberscore × weight. The score already includes the confidence multiplier, so it is not applied a second time.
contribution.composite_modelstring
contribution.posted_tostring or nullcounterparty_id the points were posted to
benchmarkobject
benchmark.idstring
benchmark.lane_requestedstring
benchmark.lane_usedstringThe lane the benchmark was built for. A district benchmark is written CN-US:27-ocean_container.
benchmark.hs_usedstring
benchmark.resolutionstring
benchmark.windowobject
benchmark.window.fromstring
benchmark.window.tostring
benchmark.as_ofstring
benchmark.confidencestring
benchmark.sourcesarray of string
benchmark.districtobjectPresent when the benchmark is at customs-district level: the U.S. Customs district of unlading.
benchmark.district.codestring
benchmark.district.namestring or null
benchmark.cellsobjectThe data behind the bands.
benchmark.cells.n_cellsinteger
benchmark.cells.weight_kg_coverednumber
benchmark.next_refreshstring or nullWhen the next version is expected (Census publishes about 28 days after the month following the data month); null when that date has passed without a new version.
modelobject
model.namestring
model.versionstring
sandboxbooleanPresent and true on the sandbox host, where bands are fixed fixtures.

Fields are read from a real response captured 2026-11-04. Optional fields may be absent in other responses.

Errors

  • 400 invalid request
  • 401 missing or bad key
  • 403 not in your plan
  • 429 rate limited, see Retry-After
  • 402 payment required
  • 404 not found
  • 409 conflict or not ready
  • 422 validation failed
  • 500 server error, retry with backoff
  • 503 temporarily unavailable
  • 5xx retry with backoff

This endpoint reports errors as RFC 9457 problem details (application/problem+json) with a stable code and a request_id.