Skip to main content

API contract (fulfillment-execution)

Source of truth: apis/openapi.yaml in IQVO/fulfillment-execution (read from origin/develop). All paths are under /api/fulfillment-execution at this app's own origin (Kong). The client code is src/api/fulfillmentExecution.ts; the wider picture of every edge is on Integration.

Endpoints used​

ActionRequestSuccessNotes
RegisterPOST /stations {stationId, capabilities[], locationCode?}201 Stationupsert by stationId
Check inPOST /stations/{id}/check-ins {occupantId}200 Station
Check outPOST /stations/{id}/check-outs (no body)200 Station
Claim nextPOST /stations/{id}/task-claims {taskType}200 Task (CLAIMED, leaseStationId, leaseExpiry)AnyTaskType: PICK, PACK, SLAM, REBIN, DISPATCH, ARRIVAL, RELOCATE, REPLENISH. The client offers PICK, RELOCATE, REPLENISH
Renew leasePOST /tasks/{id}/lease-renewals {stationId}204never queued
Pick scanPOST /tasks/{id}/scans {stationId, gtin, count}200 PickScanResult {scannedGtin, sku, level, addedEaches, pickedEaches, plannedEaches}gtin is the 14-digit form; count is packs scanned (the client sends 1 per physical scan; the server multiplies a case)
Break casePOST /tasks/{id}/case-breaks {stationId}204the BREAK_CASE task type, which AnyTaskType does not list yet
CompletePOST /tasks/{id}/completions {stationId, quantity?, fromBin?, toBin?}204quantity/bins for RELOCATE and REPLENISH only

Station is {id, capabilities[], occupied, locationCode?}. Every command also sends Idempotency-Key.

Errors​

Every error is application/problem+json with type (https://errors.fulfillment-execution.warehouse-systems.dev/<code>), title, status, detail, optional instance. The client keys on <code>. It never shows detail or raw JSON.

CodeStatusWhereThe operator sees (what / what to do)
station-not-found404claim, check-in/outThis station is not registered with the system. / Register the station again, then retry.
no-claimable-task409claimNo work is waiting for this station right now. / Nothing is wrong. Wait a moment and ask again.
station-occupied409check-inSomeone is already checked in at this station. / Ask them to check out, or use another station.
station-not-occupied409check-outNobody is checked in at this station. / Check in first. (the screen resyncs)
task-not-found404renew, completeThe system does not know this task any more. / Pull the next task.
task-not-claimed409renew, completeYou no longer hold this task... / Pull the next task. (task dropped)
task-not-owner409renew, completeAnother station now holds this task. / Pull the next task. (task dropped)
task-already-completed409completeThis task was already completed. / Pull the next task. (treated as done)
invalid-request400anyThe system could not accept that... / Check what you scanned or typed and try again.
idempotency-key-required / -invalid / -reused400 / 400 / 409anyThe request could not be matched to your last action. / Reload and try again.
station-location-not-workcenter422registerThat location is not a work center. / Scan a work-center location label, or leave it empty.
relocation-confirmation-required422completeA move is finished with the counted quantity and the bin scans. / ...
invalid-relocation-confirmation422completeThe bins you scanned do not fit the planned move. / Rescan the bins shown on the task.
not-relocation-task422complete(client bug) quantity/bins sent for another task type. / Call your lead.
replenishment-confirmation-required422completeA replenishment is finished with the quantity you counted. / ...
invalid-replenishment-confirmation422completeThe quantity or a scanned bin does not fit the replenishment. / ...
unknown-gtin4xxpick scanThe system does not know that barcode. / Check you scanned the item or case for this pick, then scan it again.
invalid-scanned-gtin4xxpick scanThat barcode is not a valid product code. / Scan it again or use Type instead. Nothing was counted.
scan-sku-mismatch4xxpick scanThat is not the item for this pick. / Put it back and scan the item or case this pick asks for.
scan-level-mismatch4xxpick scanA case where items are picked, or the reverse. / Scan the unit this pick asks for.
pick-over-quantity4xxpick scanThat scan would pick more than the task asks. Not counted. / Put the extra back; if complete, scan the order label and complete.
no-pick-plan4xxpick scanThis task has no pick quantity to scan against. / Scan the order label and complete the task, or ask your lead.
case-break-rejected4xxbreak caseThe storage system refused to break this case. / Check the case is sealed and in its bin, then try again.
not-case-break-task4xxbreak caseThis task is not a case-break task. / Pull the next task; call your lead if it repeats.
case-break-completion-required4xxcompleteA case-break task is finished with Break case, not Complete. / Use Break case.
case-break-unavailable503break caseThe storage system could not be reached. Nothing changed. / Try again; the task is still yours. (retried, not shown as a failure unless it stays)
internal-error500anyThe server hit an unexpected error. / Try again in a moment.
anything else, about:blankanyanygateway 404/405: "cannot be reached at this address" (setup problem); 5xx: "not answering properly"; unknown code: the service's own title plus "call your lead"

The exact text lives in src/api/problemMessages.ts and is covered by src/api/problemMessages.test.ts. 429/502/503/504 are not shown as errors: they are retried (see offline and idempotency).

Cluster routing (not wired by this repo)​

In the kind cluster Kong listens on http://localhost:8000 and the web gateway on http://localhost:80 serves HTML only (it has no /api route, and answers any unknown path with the console's index.html). So FLOOR_API_TARGET defaults to Kong at :8000 in dev. Serving this app in the cluster needs the edge to route /api/* to Kong on the same host; that infra change belongs to warehouse-infra and is not part of this repo.

API contract (inbound-receiving)​

Source of truth: apis/openapi.yaml in IQVO/inbound-receiving (origin/develop). All paths are under /api/inbound-receiving. Flow, copy per finding and retry rules: Receiving flow.

ActionRequestSuccessNotes
List open receiptsGET /receipts?state=Open&limit=50200 {items: Receipt[], nextCursor?}the client follows nextCursor (cursor query parameter) until absent, up to 20 pages
Get a receiptGET /receipts/{receiptId}200 Receipt
Receive by scanPOST /receipts/{receiptId}/scans {kind, id, qty?, lot?, expiry?, countedContents?}201 accepted / 200 refused with findings, both ScanResultIdempotency-Key required. qty = cases for CASE_GTIN, eaches for EACH_GTIN. Fields exactly as ReceiveScanRequest (the raw-scan form is not used)
ClosePOST /receipts/{receiptId}/closures (no body)200 Receipt (Closed, with Short/Over/Damaged)key optional in the spec, sent anyway
Carton label dataGET /receipts/{receiptId}/cartons/{lpn}/label200 {lpn, symbology:"CODE128", humanReadable, sku?, units, receivedAt}404 carton-not-found

Errors are application/problem+json, type = https://errors.inbound-receiving.warehouse-systems.dev/<slug>; the client keys on <slug> and never shows detail. Copy for the slugs a dock operator can meet is in src/api/receivingMessages.ts (receipt-not-found, invalid-receipt-id, receipt-closed, scan-kind-mismatch, invalid-sscc, invalid-gtin, unsupported-gtin, unsupported-pack-level, invalid-scan(-kind), invalid-cases, invalid-quantity, invalid-counted-contents, counted-contents-not-mixed, counted-sku-unknown, carton-not-found, version-mismatch, concurrent-modification, dependency-unavailable, malformed-request); idempotency, 5xx and gateway answers fall back to the shared table above. 429/502/503/504 are retried, not shown.

Idempotency: inbound-receiving does de-duplicate POST /scans by Idempotency-Key (per its OpenAPI); see Receiving flow. Spec observation: its example SSCC has an invalid check digit.

API contract (yard-management)​

Source of truth: apis/openapi.yaml in IQVO/yard-management (its servers list Kong at /api/yard-management). All paths are under /api/yard-management. Flow, trailer rules, keys and the full slug list: Yard flow.

ActionRequestSuccessNotes
Check in a visitPOST /visits CheckInVisitRequest {siteId, carrier, carrierScac?, tractorPlate, driverRef?, purpose, appointmentId?, trailers[]{unitNumber, kind, loadState, sealNumber?, sealClass?}}201 CheckIn {visit, trailers[], moves[]}Idempotency-Key required. trailers[].sealClass is I, S or H (ISO 17712: indicative, security, high security), optional and only with a sealNumber; the client sends it when the clerk states the seal strength and leaves the property out otherwise (never ""). 409 seal-class-too-low when the site yard policy sets minimumSealClass and the seal is of a lower class or has none; 422 invalid-seal-class for a class outside the three. The client sends no unitNumberScheme, hazmatClass, unNumber or requiresTemperatureControl. A seal mismatch under policy REJECT answers 201 with a REJECTED visit and no trailers/moves. A suspended carrier under policy REJECT answers 409 carrier-suspended AFTER recording the REJECTED visit: the truck is turned away, the screen ends it (no form left to send) and the client never retries or suggests a retry. Also 409 placement-rule-violated, 422 invalid-unit-number
Reject at the gatePOST /visit-rejections {siteId, carrier, carrierScac?, tractorPlate, appointmentId?, reason}201 Visitreason is one of APPOINTMENT_REQUIRED, UNKNOWN_APPOINTMENT, SEAL_MISMATCH, TRAILER_ALREADY_ON_SITE, SITE_REQUEST. Visit.rejectionReason can also read CARRIER_SUSPENDED (set by the service, never sent); the client types that field as an open string and shows an unknown value as "reason <CODE>"
Check outPOST /visits/{visitId}/check-outs {trailersOut:[{trailerId}]}200 Visit409 trailer-not-released, 409 seal-required, 409 illegal-transition, 409 trailer-still-secured, 409 inspection-required / inspection-failed
List visitsGET /visits?siteId&state&tractorPlate&limit=500&cursor200 {items, nextCursor?}followed to the end, up to 10 pages
List trailersGET /trailers?siteId&state&unitNumber&locationCode&limit=500&cursor200 {items, nextCursor?}default: not DEPARTED
Get a trailerGET /trailers/{trailerId}200 Trailershows the unit number of a claimed move
List movesGET /moves?siteId&state&trailerId&limit=500&cursor200 {items, nextCursor?}no hostlerRef filter: the client filters
Claim next movePOST /moves/claims {siteId, hostlerRef}201 Move (CLAIMED, leaseExpiresAt)404 no-claimable-move, 409 hostler-busy
Complete a movePOST /moves/{moveId}/completions {hostlerRef?, actualLocation?{kind, code}, deviationNote?}200 MovehostlerRef for a HOSTLER move only; 422 unexplained-destination, 409 location-occupied, 409 not-lease-holder, 409 placement-rule-violated
Start door workPOST /trailers/{trailerId}/door-work-starts (no body)200 Trailer409 trailer-on-hold, 409 illegal-transition, 409 trailer-not-secured, 409 inspection-required / inspection-failed
Complete door workPOST /trailers/{trailerId}/door-work-completions {loadState?}200 Trailer

Errors are application/problem+json, type = https://errors.yard-management.warehouse-systems.dev/<slug>; operator copy is in src/api/yardMessages.ts and a test checks every slug above has some (SLUGS in src/api/yardManagement.test.ts: a slug the service adds to one of these calls goes into that list first). The wording of the newer slugs and the ones left on the fallback: Yard flow, Errors.