openapi: 3.0.3 info: title: Seller Inbound API version: 1.0.0 description: | This is the **seller API** of the `seller-inbound` bounded context (retail network, partner tier): the front door through which a seller gets stock into the network. A seller declares an **inbound plan** (what it will send, to which node, `INDIVIDUAL` or `CASE_PACKED`), confirms it, opens an **inbound shipment** against the plan, adds **cartons** (each with an SSCC and its contents), has the labels produced, and ships. The vendor that runs the receiving node later reports what it received (over the event stream, not this API) and the shipment closes. Rules of the contract: - **Quantities are always eaches** (`qtyEaches`). A case-packed carton holds one item at one quantity, and that quantity must equal the units per pack the case GTIN declares (`case-qty-mismatches-gtin`). - **GTIN** is 14 digits and **SSCC** is 18 digits, both with a GS1 mod-10 check digit. - **SSCC.** The seller may supply an SSCC on `POST /inbound-shipments/{id}/cartons`; it is accepted only when valid (`invalid-sscc` otherwise) and unique network-wide (`sscc-not-unique` otherwise). Without one, the network issues an SSCC from its own GS1 company prefix and returns it (`ssccIssued: true`). - **Labels.** `POST /inbound-shipments/{id}/labels` moves a `DRAFT` shipment to `LABELLED` once the cartons add up to the confirmed plan (`carton-contents-mismatch-plan` otherwise). `GET /inbound-shipments/{id}/labels` returns the **label data** per carton (SSCC, the GS1-128 element string `(00)`, the human readable line, the content summary in eaches and the destination node). Rendering a printable label is the seller's concern. - **Destination node.** The plan's node must be `ACTIVE` and have the INBOUND capability in the local view fed by node-topology events (`node-cannot-receive`). Cartons are checked against the node's declared inbound limits (`carton-overweight`, `carton-oversize`). - **Suspension.** A suspended seller creates no plan, shipment or carton and ships nothing (`seller-suspended`). - **Scorecard.** `GET /sellers/{sellerId}/scorecard?window=7d|30d` answers the seller's rolling-window compliance scorecard, computed from the facts this service recorded when it applied the vendor's receipts (shipments closed, cartons received, discrepancies by kind, compliance violations). It is **informational**: the derived `complianceTier` (`GOOD`, `WATCH`, `AT_RISK`) suspends and blocks nothing; suspension stays the human `POST /sellers/{sellerId}/suspensions` command (ADR 0005). A rate whose denominator is zero is omitted, never `NaN`. - **No authentication** (consistent with the fleet): the seller is named in the request body and checked against its account. - Every `POST` takes `Idempotency-Key` (1 to 128 printable ASCII characters; missing is `400 idempotency-key-required`, malformed `400 idempotency-key-invalid`); a repeat replays the first response with `Idempotency-Replayed: true` when that response was a success or a refusal that is final for the request (`invalid-cover-days`, `invalid-sscc`), and the same key on a different method, path or body is `409 idempotency-key-reused`. A refusal that depends on state that can change (`validation-failed`, `case-pack-not-uniform`, `case-qty-mismatches-gtin`, `carton-overweight`, `carton-oversize`, `carton-contents-mismatch-plan`, `inbound-capacity-exceeded`, `network-split-destination`, `network-split-unavailable`, `not-found`, `seller-suspended`, `seller-exists`, `node-cannot-receive`, `sscc-not-unique`, `shipment-not-labelled`, `illegal-transition` and `concurrent-update`) is NOT stored: the key is released and the same `Idempotency-Key` executes the request again. - A NUL character (U+0000) is refused before anything else runs: in a path it is `404 not-found`; in a query string or a JSON body it is `422 validation-failed`, and the `Idempotency-Key` of such a request is not recorded. Request bodies are decoded strictly: an unknown field, malformed JSON, an empty body where one is required, trailing data or a body over 4 MiB is `422 validation-failed`. - Errors are RFC 9457 `application/problem+json`; the shared problem types are `not-found` 404, `illegal-transition` 409, `concurrent-update` 409 and `validation-failed` 422, plus one slug per model `Err...` name. - Suspending a suspended seller and reinstating an active one answer `200` with the account and publish no event (ADR 0002 A3). Every other command finds the state it needs or answers `illegal-transition`. - Events (AsyncAPI `apis/asyncapi.yaml`): ten types. `InboundShipmentLabelled`, `InboundShipmentShipped`, `InboundShipmentReceived`, `PlacementPlanSuggested`, `SellerSuspended` and `SellerReinstated` go only to the events topic; the other four (`SellerOnboarded`, `InboundPlanConfirmed`, `InboundDiscrepancyRecorded`, `SellerComplianceViolationRecorded`) go to the analytics topic. contact: name: seller-inbound maintainers url: https://github.com/IQVO/seller-inbound license: name: UNLICENSED servers: - url: http://localhost:8000/api/seller-inbound tags: - name: Sellers description: Seller onboarding, suspension and reinstatement (network partner managers), and the seller's informational compliance scorecard. - name: Inbound Plans description: What a seller will send, to which node, in eaches. - name: Inbound Shipments description: Cartons with SSCCs, label data and the ship command. - name: Placement description: Roadmap feature F6 (ADR 0012). Where forward stock belongs. - name: Reports description: Read-only analytics reports (ADR 0017), served by the separate `si-reports` process over the analytics projection of this context's own events. Off by default in the chart. paths: /sellers: post: tags: - Sellers operationId: onboardSeller summary: Onboard a seller (OnboardSeller) description: Used by network partner managers. Creates the account `ACTIVE` and publishes `SellerOnboarded`. A `sellerId` that already exists is `seller-exists`. parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/OnboardSellerRequest' example: sellerId: seller-77 name: Acme Goods responses: '201': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The seller account, ACTIVE. content: application/json: schema: $ref: '#/components/schemas/SellerAccount' example: sellerId: seller-77 name: Acme Goods state: ACTIVE onboardedAt: '2026-10-24T13:00:00Z' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '409': $ref: '#/components/responses/StateConflict' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' /sellers/{sellerId}/suspensions: post: tags: - Sellers operationId: suspendSeller summary: Suspend a seller (SuspendSeller) description: Moves the account `ACTIVE` to `SUSPENDED` and publishes `SellerSuspended`. A seller already `SUSPENDED` gets the account back unchanged with `200` and no event. While suspended, the seller creates no plan, shipment or carton and ships nothing. parameters: - $ref: '#/components/parameters/SellerIdPath' - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/SuspendSellerRequest' example: reason: repeated label violations responses: '200': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The seller account. content: application/json: schema: $ref: '#/components/schemas/SellerAccount' example: sellerId: seller-77 name: Acme Goods state: SUSPENDED onboardedAt: '2026-10-24T13:00:00Z' suspendedAt: '2026-10-24T13:00:00Z' suspendReason: repeated label violations '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' /sellers/{sellerId}/reinstatements: post: tags: - Sellers operationId: reinstateSeller summary: Reinstate a seller (ReinstateSeller) description: Moves the account `SUSPENDED` to `ACTIVE` and publishes `SellerReinstated`. A seller already `ACTIVE` gets the account back unchanged with `200` and no event. parameters: - $ref: '#/components/parameters/SellerIdPath' - $ref: '#/components/parameters/IdempotencyKey' responses: '200': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The seller account. content: application/json: schema: $ref: '#/components/schemas/SellerAccount' example: sellerId: seller-77 name: Acme Goods state: ACTIVE onboardedAt: '2026-10-24T13:00:00Z' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '500': $ref: '#/components/responses/InternalError' /sellers/{sellerId}/scorecard: get: tags: - Sellers operationId: getSellerScorecard summary: Get a seller's compliance scorecard (GetSellerScorecard) description: | The seller's compliance scorecard over a rolling window that ends now, derived from this service's own facts (ADR 0005): the shipments that closed in the window, the cartons they reported and how many were `RECEIVED`, the discrepancies recorded by kind, and the compliance violations recorded. Facts are dated by the instant this service recorded them, not by the `receivedAt` the vendor reports. `receiptAccuracyRate` is `cartonsReceived / cartonsReported` and is omitted when no carton was reported; `discrepancyRatePerShipment` is the discrepancies recorded divided by `shipmentsReceived` and is omitted when no shipment closed. Rates are rounded to four decimals. `complianceTier` is the worst of three signals (thresholds are declared in code and in ADR 0005 A3): `AT_RISK` when `receiptAccuracyRate` is below 0.90, `discrepancyRatePerShipment` is 2.0 or more, or there are 5 or more violations; otherwise `WATCH` when the rate is below 0.98, the discrepancy rate is 0.5 or more, or there is at least 1 violation; otherwise `GOOD`. The tier is **informational**: it changes nothing about the seller, who stays `ACTIVE` or `SUSPENDED` by the human commands only. A suspended seller has a scorecard too. The read publishes no event. parameters: - $ref: '#/components/parameters/SellerIdPath' - $ref: '#/components/parameters/ScorecardWindow' responses: '200': description: The seller's scorecard. content: application/json: schema: $ref: '#/components/schemas/SellerScorecard' examples: withDiscrepancies: summary: A seller with a short carton and a damaged carton value: sellerId: seller-77 window: 30d windowStart: '2026-09-24T13:00:00Z' windowEnd: '2026-10-24T13:00:00Z' shipmentsReceived: 4 cartonsReported: 40 cartonsReceived: 38 receiptAccuracyRate: 0.95 discrepancyRatePerShipment: 0.75 discrepanciesByKind: Damaged: 1 Short: 2 complianceViolations: 1 complianceTier: WATCH noShipments: summary: A seller with no closed shipment in the window; the rates are omitted value: sellerId: seller-78 window: 7d windowStart: '2026-10-17T13:00:00Z' windowEnd: '2026-10-24T13:00:00Z' shipmentsReceived: 0 cartonsReported: 0 cartonsReceived: 0 discrepanciesByKind: {} complianceViolations: 0 complianceTier: GOOD '400': $ref: '#/components/responses/InvalidWindow' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' /sellers/{sellerId}/capacity-allocations: get: tags: - Sellers operationId: getSellerCapacityAllocations summary: Get a seller's inbound capacity reservations (GetSellerCapacityAllocations) x-pagination-exempt: report description: | The seller's inbound capacity reservations of one calendar month (ADR 0015): the dm3 its `DRAFT` and `CONFIRMED` plans promise to each node. `CreateInboundPlan` reserves, `CancelInboundPlan` releases, confirmation keeps the hold; a reservation lives in the month of the plan's `createdAt`, so the allocation rolls over with the key. The read is the operator-facing honesty surface of the monthly capacity gate and publishes no event. `month` is a `YYYY-MM` key and defaults to the current month. The gate itself is enforced only when the node's declared monthly volume AND every line's seller-declared `unitVolumeDm3` are known; otherwise the plan is allowed and carries `capacityEnforced: false` (record-and-allow, ADR 0015). parameters: - $ref: '#/components/parameters/SellerIdPath' - name: month in: query required: false description: The calendar month, `YYYY-MM`; defaults to the current month. schema: type: string pattern: '^[0-9]{4}-(0[1-9]|1[0-2])$' example: '2026-11' responses: '200': description: The seller's reservations of the month, ordered by nodeId. content: application/json: schema: $ref: '#/components/schemas/CapacityAllocations' example: sellerId: seller-77 month: '2026-11' items: - nodeId: node-0f3a91 reservedDm3: 490 updatedAt: '2026-11-14T13:00:00Z' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' /inbound-plans: post: tags: - Inbound Plans operationId: createInboundPlan summary: Create an inbound plan (CreateInboundPlan) description: |- Declares what the seller will send to one destination node. The plan starts `DRAFT`. The seller must be `ACTIVE`; the node must be `ACTIVE` with the INBOUND capability (`node-cannot-receive`). Every line is in eaches; for `CASE_PACKED` each line's quantity must be a whole number of the case GTIN's units per pack. Under ADR 0015, when the node declared `monthlyVolumeDm3` AND every line carries `unitVolumeDm3`, the plan's total volume is checked against the node's tier-factored monthly limit (`inbound-capacity-exceeded`); either side unknown records `capacityEnforced: false` and never blocks the plan. A `NETWORK_SPLIT` placementOption must destination an ACTIVE `INBOUND_CROSS_DOCK` and records the redistribution and the fee basis as facts. parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateInboundPlanRequest' example: sellerId: seller-77 destinationNodeId: node-0f3a91 packingOption: CASE_PACKED placementOption: SELLER_SPLIT lines: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 24 unitVolumeDm3: 8 responses: '201': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The inbound plan, DRAFT. content: application/json: schema: $ref: '#/components/schemas/InboundPlan' example: planId: pln-0f3a91 sellerId: seller-77 destinationNodeId: node-0f3a91 packingOption: CASE_PACKED placementOption: SELLER_SPLIT state: DRAFT capacityEnforced: false lines: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 24 createdAt: '2026-10-24T13:00:00Z' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' /inbound-plans/{planId}: get: tags: - Inbound Plans operationId: getInboundPlan summary: Get an inbound plan (GetInboundPlan) description: Reads one inbound plan. parameters: - $ref: '#/components/parameters/PlanIdPath' responses: '200': description: The inbound plan. content: application/json: schema: $ref: '#/components/schemas/InboundPlan' example: planId: pln-0f3a91 sellerId: seller-77 destinationNodeId: node-0f3a91 packingOption: CASE_PACKED placementOption: SELLER_SPLIT state: CONFIRMED capacityEnforced: true lines: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 24 createdAt: '2026-10-24T13:00:00Z' confirmedAt: '2026-10-24T13:00:00Z' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalError' /inbound-plans/{planId}/confirmations: post: tags: - Inbound Plans operationId: confirmInboundPlan summary: Confirm an inbound plan (ConfirmInboundPlan) description: Moves a `DRAFT` plan to `CONFIRMED` and publishes `InboundPlanConfirmed`. Shipments are opened only against a confirmed plan. Confirming a confirmed or cancelled plan is `illegal-transition`. parameters: - $ref: '#/components/parameters/PlanIdPath' - $ref: '#/components/parameters/IdempotencyKey' responses: '200': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The inbound plan. content: application/json: schema: $ref: '#/components/schemas/InboundPlan' example: planId: pln-0f3a91 sellerId: seller-77 destinationNodeId: node-0f3a91 packingOption: CASE_PACKED placementOption: SELLER_SPLIT state: CONFIRMED capacityEnforced: true lines: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 24 createdAt: '2026-10-24T13:00:00Z' confirmedAt: '2026-10-24T13:00:00Z' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '500': $ref: '#/components/responses/InternalError' /inbound-plans/{planId}/cancellations: post: tags: - Inbound Plans operationId: cancelInboundPlan summary: Cancel an inbound plan (CancelInboundPlan) description: Moves a `DRAFT` plan to `CANCELLED`. Only a `DRAFT` plan can be cancelled (`illegal-transition` otherwise). parameters: - $ref: '#/components/parameters/PlanIdPath' - $ref: '#/components/parameters/IdempotencyKey' responses: '200': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The inbound plan. content: application/json: schema: $ref: '#/components/schemas/InboundPlan' example: planId: pln-0f3a91 sellerId: seller-77 destinationNodeId: node-0f3a91 packingOption: CASE_PACKED placementOption: SELLER_SPLIT state: CANCELLED capacityEnforced: false lines: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 24 createdAt: '2026-10-24T13:00:00Z' cancelledAt: '2026-10-24T13:00:00Z' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '500': $ref: '#/components/responses/InternalError' /inbound-plans/{planId}/shipments: post: tags: - Inbound Shipments operationId: createInboundShipment summary: Open an inbound shipment (CreateInboundShipment) description: Opens a `DRAFT` shipment against a `CONFIRMED` plan of an `ACTIVE` seller. The shipment inherits the plan's destination node. parameters: - $ref: '#/components/parameters/PlanIdPath' - $ref: '#/components/parameters/IdempotencyKey' responses: '201': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The inbound shipment, DRAFT, without cartons. content: application/json: schema: $ref: '#/components/schemas/InboundShipment' example: shipmentId: shp-0f3a91 planId: pln-0f3a91 sellerId: seller-77 nodeId: node-0f3a91 state: DRAFT cartons: [] createdAt: '2026-10-24T13:00:00Z' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '500': $ref: '#/components/responses/InternalError' /inbound-shipments/{shipmentId}/cartons: post: tags: - Inbound Shipments operationId: addCarton summary: Add a carton (AddCarton) description: 'Adds one carton to a `DRAFT` shipment. `sscc` is optional: a supplied SSCC must be valid and unique network-wide, otherwise the network issues one and returns it. `kind` is `HOMOGENEOUS_CASE` (one item at one quantity, matching the case GTIN) or `MIXED`. `parentSscc` names the pallet SSCC when the node accepts pallets. The carton is checked against the node''s inbound limits. The response carries the carton and its label data.' parameters: - $ref: '#/components/parameters/ShipmentIdPath' - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AddCartonRequest' example: kind: HOMOGENEOUS_CASE contents: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 12 lot: L7 expiry: '2027-10-24' grossWeightG: 5200 dimsMm: l: 400 w: 300 h: 200 responses: '201': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The carton and its label data. content: application/json: schema: $ref: '#/components/schemas/AddedCarton' example: shipmentId: shp-0f3a91 carton: sscc: '006141420000000011' kind: HOMOGENEOUS_CASE contents: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 12 lot: L7 expiry: '2027-10-24' grossWeightG: 5200 dimsMm: l: 400 w: 300 h: 200 sealed: false ssccIssued: true label: labelRef: LBL-006141420000000011 sscc: '006141420000000011' gs1128: (00)006141420000000011 humanReadable: (00) 0 0614 1420 0000 0001 1 kind: HOMOGENEOUS_CASE contents: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 12 lot: L7 expiry: '2027-10-24' contentSummary: '12 eaches: item-004512 x12' totalEaches: 12 destinationNodeId: node-0f3a91 '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' /inbound-shipments/{shipmentId}/labels: post: tags: - Inbound Shipments operationId: labelInboundShipment summary: Label an inbound shipment (LabelShipment) description: 'Moves a `DRAFT` shipment to `LABELLED`: the cartons must add up to the confirmed plan (`carton-contents-mismatch-plan`) and the manifest is frozen. Publishes `InboundShipmentLabelled`. Only a `DRAFT` shipment can be labelled (`illegal-transition` otherwise).' parameters: - $ref: '#/components/parameters/ShipmentIdPath' - $ref: '#/components/parameters/IdempotencyKey' responses: '200': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The inbound shipment, LABELLED. content: application/json: schema: $ref: '#/components/schemas/InboundShipment' example: shipmentId: shp-0f3a91 planId: pln-0f3a91 sellerId: seller-77 nodeId: node-0f3a91 state: LABELLED cartons: - sscc: '006141420000000011' kind: HOMOGENEOUS_CASE contents: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 12 lot: L7 expiry: '2027-10-24' grossWeightG: 5200 dimsMm: l: 400 w: 300 h: 200 sealed: true createdAt: '2026-10-24T13:00:00Z' labelledAt: '2026-10-24T13:00:00Z' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' get: tags: - Inbound Shipments operationId: getShipmentLabels x-pagination-exempt: view summary: Get the label data (GetLabels) description: 'Returns the label DATA of every carton: SSCC, the GS1-128 element string `(00)`, the human readable line, the contents summary in eaches and the destination node.' parameters: - $ref: '#/components/parameters/ShipmentIdPath' responses: '200': description: The label data per carton. content: application/json: schema: $ref: '#/components/schemas/ShipmentLabels' example: shipmentId: shp-0f3a91 state: LABELLED destinationNodeId: node-0f3a91 labels: - labelRef: LBL-006141420000000011 sscc: '006141420000000011' gs1128: (00)006141420000000011 humanReadable: (00) 0 0614 1420 0000 0001 1 kind: HOMOGENEOUS_CASE contents: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 12 lot: L7 expiry: '2027-10-24' contentSummary: '12 eaches: item-004512 x12' totalEaches: 12 destinationNodeId: node-0f3a91 '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalError' /inbound-shipments/{shipmentId}/dispatches: post: tags: - Inbound Shipments operationId: shipInboundShipment summary: Ship an inbound shipment (ShipInboundShipment) description: Moves a `LABELLED` shipment to `SHIPPED` and publishes `InboundShipmentShipped`. A shipment that is not labelled is `shipment-not-labelled`; a suspended seller ships nothing (`seller-suspended`). Only a `LABELLED` shipment ships. parameters: - $ref: '#/components/parameters/ShipmentIdPath' - $ref: '#/components/parameters/IdempotencyKey' responses: '200': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The inbound shipment, SHIPPED. content: application/json: schema: $ref: '#/components/schemas/InboundShipment' example: shipmentId: shp-0f3a91 planId: pln-0f3a91 sellerId: seller-77 nodeId: node-0f3a91 state: SHIPPED cartons: - sscc: '006141420000000011' kind: HOMOGENEOUS_CASE contents: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 12 lot: L7 expiry: '2027-10-24' grossWeightG: 5200 dimsMm: l: 400 w: 300 h: 200 sealed: true createdAt: '2026-10-24T13:00:00Z' labelledAt: '2026-10-24T13:00:00Z' shippedAt: '2026-10-24T13:00:00Z' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/StateConflict' '500': $ref: '#/components/responses/InternalError' /placement-plans: post: tags: - Placement operationId: computePlacementPlan summary: Compute a placement plan for one seller item (ComputePlacementPlan) description: >- Roadmap feature F6 (ADR 0012): reads the DemandHeatView (fulfilments locked per (item, region) over the observation window and current listing availability per node) and records a deterministic placement advisory. For each region with demand, suggested units per node = max(0, ceil(demand x coverDays / windowDays) - region availability) split across the region's ACTIVE vendor fulfilment centres proportionally to their availability (evenly when all zero). An item with no demand anywhere yields an EMPTY plan, which is legal. A new plan for the same (sellerId, catalogItemId) supersedes the previous one. Publishes PlacementPlanSuggested (analytics-only consumer in v1). A coverDays outside 1 to 90 is rejected with 400 invalid-cover-days. parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ComputePlacementPlanRequest' example: sellerId: seller-77 catalogItemId: item-1 coverDays: 14 responses: '201': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The computed plan (or replayed for a known Idempotency-Key, when the first answer was stored). content: application/json: schema: $ref: '#/components/schemas/PlacementPlan' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '409': $ref: '#/components/responses/IdempotencyKeyProblem' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' get: tags: - Placement operationId: listPlacementPlans summary: Page the placement plans of one seller item, newest first description: 'Keyset pagination: `limit` (1..100, default 50) and `cursor` = the `createdAt|planId` pair of the last item; the body carries {items, nextCursor}.' parameters: - name: sellerId in: query required: true schema: type: string - name: catalogItemId in: query required: true schema: type: string - name: limit in: query required: false schema: type: integer minimum: 1 maximum: 100 default: 50 - name: cursor in: query required: false schema: type: string responses: '200': description: One page of plans. content: application/json: schema: $ref: '#/components/schemas/PlacementPlanPage' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' /placement-plans/{planId}: get: tags: - Placement operationId: getPlacementPlan summary: Read one placement plan in any state description: Read-only; an unknown plan fails with not-found. parameters: - name: planId in: path required: true schema: type: string responses: '200': description: The plan. content: application/json: schema: $ref: '#/components/schemas/PlacementPlan' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalError' /placement-plans/{planId}/acceptances: post: tags: - Placement operationId: acceptPlacementPlan summary: Accept a SUGGESTED plan (AcceptPlacementPlan) description: >- The seller accepts the advisory. Advisory-only in v1 (ADR 0012): no downstream effect; the seller ships through the existing inbound-plan flow. Refused with illegal-transition once ACCEPTED or SUPERSEDED. parameters: - $ref: '#/components/parameters/IdempotencyKey' - name: planId in: path required: true schema: type: string responses: '200': headers: Idempotency-Replayed: $ref: '#/components/headers/IdempotencyReplayed' description: The ACCEPTED plan. content: application/json: schema: $ref: '#/components/schemas/PlacementPlan' '400': $ref: '#/components/responses/IdempotencyKeyProblem' '409': $ref: '#/components/responses/IdempotencyKeyProblem' '422': $ref: '#/components/responses/ValidationProblem' '500': $ref: '#/components/responses/InternalError' /inbound-shipments/{shipmentId}: get: tags: - Inbound Shipments operationId: getInboundShipment summary: Get an inbound shipment (GetInboundShipment) description: Reads one shipment with its cartons and, once the vendor reported, the receipt status of each carton. parameters: - $ref: '#/components/parameters/ShipmentIdPath' responses: '200': description: The inbound shipment. content: application/json: schema: $ref: '#/components/schemas/InboundShipment' example: shipmentId: shp-0f3a91 planId: pln-0f3a91 sellerId: seller-77 nodeId: node-0f3a91 state: DRAFT cartons: - sscc: '006141420000000011' kind: HOMOGENEOUS_CASE contents: - catalogItemId: item-004512 gtin: '00614141000036' qtyEaches: 12 lot: L7 expiry: '2027-10-24' grossWeightG: 5200 dimsMm: l: 400 w: 300 h: 200 sealed: false createdAt: '2026-10-24T13:00:00Z' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalError' /reports/seller-inbound-performance: servers: - url: http://localhost:8092 get: tags: - Reports operationId: getSellerInboundPerformanceReport summary: Seller-inbound performance, per UTC day (GetSellerInboundPerformanceReport) x-pagination-exempt: report description: | Per UTC day of each fact's own business instant, folded from this context's OWN events only (ADR 0017); days without any fact are omitted. Served by the reports process (`si-reports`, port 8092), not by the seller API; `from` and `to` are UTC dates, both inclusive (neither = the 30 days ending today, at most 366 days). - `inbound_plans_confirmed`: `InboundPlanConfirmed` events of the day (`confirmedAt`). Plan creation publishes no event, so confirmation is the inbound announcement the model records. - `placement_advisories_issued`: `PlacementPlanSuggested` events of the day (`createdAt`). - `shipments_received`: `InboundShipmentReceived` events of the day (`receivedAt`). - `received_eaches` and `received_item_count`: the eaches and the distinct GTINs of EVERY `received` line of the day's receipts (ADR 0014). `received_by_item` lists at most 10 of them, most eaches first, ties by GTIN; `publications` is the number of receipts that listed the GTIN, `catalog_item_id` is present when a line of that day resolved it. A receipt published before ADR 0014 has no lines. - `advisory_to_receipt_samples`, `advisory_to_receipt_p50_seconds`, `advisory_to_receipt_p95_seconds`: for every received line that resolved its `catalogItemId`, the seconds from the LATEST placement advisory of the same seller and item at or before the receipt to the receipt (continuous percentiles); a line without such an advisory is not a sample. Nothing in the own facts links an advisory to a shipment, so this is the time since the seller's latest advice about the item, not a causal lead time. Both percentiles are `null` on a day without a sample. Not reported, because this context publishes no event for it: inbound capacity allocations granted or refused and the reasons of a refusal (the capacity gate answers `inbound-capacity-exceeded` and publishes nothing). parameters: - $ref: '#/components/parameters/ReportFrom' - $ref: '#/components/parameters/ReportTo' responses: '200': description: The report for the range; `days` is empty when no fact falls in it. content: application/json: schema: $ref: '#/components/schemas/SellerInboundPerformanceReport' example: from: '2026-11-01' to: '2026-11-07' days: - day: '2026-11-03' inbound_plans_confirmed: 2 placement_advisories_issued: 3 shipments_received: 1 received_eaches: 19 received_item_count: 2 received_by_item: - gtin: '00614141000012' catalog_item_id: item-1 publications: 2 qty_eaches: 15 - gtin: '00614141000036' publications: 1 qty_eaches: 4 advisory_to_receipt_samples: 2 advisory_to_receipt_p50_seconds: 9000 advisory_to_receipt_p95_seconds: 13860 '400': $ref: '#/components/responses/InvalidReportRange' '500': $ref: '#/components/responses/InternalError' /reports/freshness: servers: - url: http://localhost:8092 get: tags: - Reports operationId: getReportFreshness summary: How far the analytics projection is behind (GetReportFreshness) description: '`as_of` is the CloudEvents time of the newest event the projector applied; `lag_seconds` is now minus `as_of`, never negative. Both are `null` until the first event. One endpoint for every report: they all read the same projection.' responses: '200': description: The projection's freshness. content: application/json: schema: $ref: '#/components/schemas/ReportFreshness' example: as_of: '2026-11-08T18:28:30Z' lag_seconds: 90 '500': $ref: '#/components/responses/InternalError' components: parameters: SellerIdPath: name: sellerId in: path required: true description: The seller id. schema: type: string example: seller-77 PlanIdPath: name: planId in: path required: true description: The inbound plan id. schema: type: string example: pln-0f3a91 ShipmentIdPath: name: shipmentId in: path required: true description: The inbound shipment id. schema: type: string example: shp-0f3a91 ScorecardWindow: name: window in: query required: false description: The rolling window that ends now. Defaults to `30d`. Any other value is `invalid-window`. schema: type: string enum: - 7d - 30d default: 30d example: 30d IdempotencyKey: name: Idempotency-Key in: header required: true description: Client-generated key, 1 to 128 printable ASCII characters (a UUID per logical submit). A retry with the same key and the same request replays the first response with `Idempotency-Replayed true` when it was a 2xx or a refusal that is final for the request (`invalid-cover-days`, `invalid-sscc`); the same key on a different method, path or body is `409 idempotency-key-reused`. A refusal that depends on state that can change (`validation-failed`, `case-pack-not-uniform`, `case-qty-mismatches-gtin`, `carton-overweight`, `carton-oversize`, `carton-contents-mismatch-plan`, `inbound-capacity-exceeded`, `network-split-destination`, `network-split-unavailable`, `not-found`, `seller-suspended`, `seller-exists`, `node-cannot-receive`, `sscc-not-unique`, `shipment-not-labelled`, `illegal-transition` and `concurrent-update`) and every 5xx is not stored, so the key is released, the retry executes again, and a different request under a released key is a new request, not `idempotency-key-reused`. schema: type: string minLength: 1 maxLength: 128 example: 3f6c2a9e-8b1d-4c7a-9e55-0d2f6b7a1c40 ReportFrom: name: from in: query required: false description: First UTC day of the range, `YYYY-MM-DD`, inclusive. Omitted = 29 days before `to` (a 30-day range). schema: type: string format: date example: '2026-11-01' ReportTo: name: to in: query required: false description: Last UTC day of the range, `YYYY-MM-DD`, inclusive. Omitted = today. At most 366 days from `from`; `from` after `to` is `invalid-report-range`. schema: type: string format: date example: '2026-11-07' headers: IdempotencyReplayed: description: Present, with the value `true`, only when this answer is a replay of the stored response of an earlier request with the same `Idempotency-Key`. A refusal whose problem type is RETRYABLE is never stored, so it is never replayed. schema: type: string enum: - 'true' responses: IdempotencyKeyProblem: description: 'The `Idempotency-Key` header is missing (`idempotency-key-required`) or is not 1 to 128 printable ASCII characters (`idempotency-key-invalid`).' content: application/problem+json: schema: $ref: '#/components/schemas/Problem' example: type: idempotency-key-required title: Idempotency-Key header is required status: 400 detail: send an Idempotency-Key header of 1 to 128 printable ASCII characters with a unique value per logical request instance: /sellers NotFound: description: The resource does not exist (`not-found`). content: application/problem+json: schema: $ref: '#/components/schemas/Problem' InvalidWindow: description: The `window` query value is not `7d` or `30d` (`invalid-window`). content: application/problem+json: schema: $ref: '#/components/schemas/Problem' example: type: invalid-window title: The window must be 7d or 30d status: 400 detail: 'validation failed: window: "90d" (use 7d or 30d)' instance: /sellers/seller-77/scorecard InternalError: description: An unexpected failure (`internal-error`); the `detail` never carries the internal message. A 5xx is never stored by the idempotency middleware, so the same `Idempotency-Key` retries the real work. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' example: type: internal-error title: Internal server error status: 500 detail: an unexpected error occurred instance: /inbound-plans StateConflict: description: 'The write conflicts with the state of a resource. Problem types: `seller-exists`, `seller-suspended` (`ErrSellerSuspended`), `node-cannot-receive` (`ErrNodeCannotReceive`), `sscc-not-unique` (`ErrSsccNotUnique`), `shipment-not-labelled` (`ErrShipmentNotLabelled`), `illegal-transition` and `concurrent-update` (optimistic-concurrency conflict; re-read and retry), and `idempotency-key-reused` (the `Idempotency-Key` was already used with a different method, path or body; a client bug, do not retry).' content: application/problem+json: schema: $ref: '#/components/schemas/Problem' ValidationProblem: description: 'The request is malformed or breaks a rule. Problem types: `validation-failed`, `case-pack-not-uniform` (`ErrCasePackNotUniform`), `case-qty-mismatches-gtin` (`ErrCaseQtyMismatchesGtin`), `carton-overweight` (`ErrCartonOverweight`), `carton-oversize` (`ErrCartonOversize`), `invalid-sscc` (`ErrInvalidSscc`), `carton-contents-mismatch-plan` (`ErrCartonContentsMismatchPlan`), `inbound-capacity-exceeded` (`ErrInboundCapacityExceeded`, ADR 0015), `network-split-destination` (`ErrNetworkSplitDestination`, ADR 0015) and `network-split-unavailable` (`ErrNetworkSplitUnavailable`, ADR 0015).' content: application/problem+json: schema: $ref: '#/components/schemas/Problem' InvalidReportRange: description: 'The `from` / `to` range is not valid (`invalid-report-range`): not a `YYYY-MM-DD` date, `from` after `to`, or more than 366 days.' content: application/problem+json: schema: $ref: '#/components/schemas/Problem' example: type: invalid-report-range title: The report range is invalid status: 400 detail: from must not be after to instance: /reports/seller-inbound-performance schemas: Problem: type: object description: RFC 9457 problem details. required: - type - title - status - detail - instance properties: type: type: string description: 'Problem type slug: the shared `not-found`, `illegal-transition`, `concurrent-update` and `validation-failed`, or one slug per `Err...` name of this context, for example `sscc-not-unique`.' example: sscc-not-unique title: type: string example: The SSCC is already used status: type: integer example: 409 detail: type: string example: 'sscc not unique: 006141420000000011 is already in this shipment' instance: type: string example: /inbound-shipments/shp-0f3a91/cartons OnboardSellerRequest: type: object required: - sellerId - name properties: sellerId: type: string minLength: 1 maxLength: 64 pattern: ^[A-Za-z0-9._-]+$ example: seller-77 name: type: string minLength: 1 maxLength: 120 description: Trimmed, non-blank, at most 120 characters, no control characters. example: Acme Goods SuspendSellerRequest: type: object properties: reason: type: string maxLength: 200 description: Optional. When present it is trimmed, non-blank, at most 200 characters, no control characters. example: repeated label violations SellerAccount: type: object required: - sellerId - name - state - onboardedAt properties: sellerId: type: string minLength: 1 maxLength: 64 pattern: ^[A-Za-z0-9._-]+$ example: seller-77 name: type: string maxLength: 120 example: Acme Goods state: type: string enum: - ACTIVE - SUSPENDED example: ACTIVE onboardedAt: type: string format: date-time example: '2026-10-24T13:00:00Z' suspendedAt: type: string format: date-time example: '2026-10-24T13:00:00Z' suspendReason: type: string example: repeated label violations SellerScorecard: type: object description: The informational compliance scorecard of a seller over a rolling window (ADR 0005). Additive; no event carries it. required: - sellerId - window - windowStart - windowEnd - shipmentsReceived - cartonsReported - cartonsReceived - discrepanciesByKind - complianceViolations - complianceTier properties: sellerId: type: string example: seller-77 window: type: string enum: - 7d - 30d example: 30d windowStart: type: string format: date-time description: The start of the window (inclusive). example: '2026-09-24T13:00:00Z' windowEnd: type: string format: date-time description: The end of the window (inclusive); the instant the scorecard was computed. example: '2026-10-24T13:00:00Z' shipmentsReceived: type: integer minimum: 0 description: Shipments that closed (`CLOSED` or `CLOSED_WITH_DISCREPANCY`) in the window. example: 4 cartonsReported: type: integer minimum: 0 description: Cartons the closing receipts reported, whatever their status. example: 40 cartonsReceived: type: integer minimum: 0 description: Of those, the cartons with status `RECEIVED`. example: 38 receiptAccuracyRate: type: number minimum: 0 maximum: 1 description: '`cartonsReceived / cartonsReported`, four decimals. Omitted when `cartonsReported` is 0.' example: 0.95 discrepancyRatePerShipment: type: number minimum: 0 description: Discrepancies recorded in the window divided by `shipmentsReceived`, four decimals. Omitted when `shipmentsReceived` is 0. example: 0.75 discrepanciesByKind: type: object description: Discrepancies recorded in the window per kind. The kind is the carton discrepancy kind string passed through (`MissingCarton`, `UnexpectedCarton`, `Damaged`, `Short`, `Over`); an open vocabulary. Always present, empty when there is none. additionalProperties: type: integer minimum: 1 example: Damaged: 1 Short: 2 complianceViolations: type: integer minimum: 0 description: Compliance violations recorded in the window. example: 1 complianceTier: type: string description: Derived, informational. The worst of three signals; it suspends and blocks nothing. enum: - GOOD - WATCH - AT_RISK example: WATCH PlanLine: type: object description: One line of an inbound plan, in eaches. required: - catalogItemId - gtin - qtyEaches properties: catalogItemId: type: string maxLength: 64 pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$ example: item-004512 gtin: type: string pattern: ^[0-9]{14}$ description: 14 digits with a GS1 mod-10 check digit. example: '00614141000036' qtyEaches: type: integer minimum: 1 maximum: 2147483647 example: 24 description: Eaches, never cases. unitVolumeDm3: type: integer minimum: 1 maximum: 100000 example: 8 description: 'The seller-declared volume of one each, in cubic decimetres (ADR 0015). Omitted or 0 = undeclared: the capacity gate then records itself unenforced and never blocks the plan.' PlacementOption: type: string enum: - SELLER_SPLIT - NETWORK_SPLIT default: SELLER_SPLIT example: NETWORK_SPLIT description: '`SELLER_SPLIT` (the default) sends everything to the destination the seller picked; `NETWORK_SPLIT` destinations an ACTIVE `INBOUND_CROSS_DOCK` and records a redistribution of the plan''s eaches across the region''s fulfilment centres (ADR 0015). The redistribution is a recorded fact: nothing downstream executes it.' RedistributionLine: type: object description: One (node, line) share of a NETWORK_SPLIT plan's recorded redistribution (capacity-split-v1, ADR 0015). required: - nodeId - lineNo - qtyEaches properties: nodeId: type: string maxLength: 64 pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$ example: node-b41 lineNo: type: integer minimum: 1 example: 1 description: The line's 1-based position in the plan. qtyEaches: type: integer minimum: 1 example: 20 PlacementFeeBasis: type: object description: The recorded placement fee basis of a NETWORK_SPLIT plan (ADR 0015) - a fact for a future vendor-settlement context, never a charge. required: - basis - month - dm3 - nodeIds properties: basis: type: string enum: - NETWORK_SPLIT month: type: string pattern: '^[0-9]{4}-(0[1-9]|1[0-2])$' example: '2026-11' dm3: type: integer format: int64 minimum: 0 example: 160 description: The plan's total declared volume; 0 when any line's unit volume is undeclared. nodeIds: type: array items: type: string description: The redistribution's recipients, unique and sorted. CapacityAllocation: type: object description: One row of the reservation table (ADR 0015) - the dm3 a seller's DRAFT and CONFIRMED plans of the month promise to one node. required: - nodeId - reservedDm3 - updatedAt properties: nodeId: type: string example: node-0f3a91 reservedDm3: type: integer format: int64 minimum: 0 example: 490 updatedAt: type: string format: date-time CapacityAllocations: type: object description: The seller's inbound capacity reservations of one calendar month (ADR 0015). required: - sellerId - month - items properties: sellerId: type: string example: seller-77 month: type: string pattern: '^[0-9]{4}-(0[1-9]|1[0-2])$' example: '2026-11' items: type: array items: $ref: '#/components/schemas/CapacityAllocation' ComputePlacementPlanRequest: type: object required: - sellerId - catalogItemId properties: sellerId: type: string catalogItemId: type: string coverDays: type: integer minimum: 1 maximum: 90 default: 14 description: Days of forward demand the suggestions should cover. PlacementSuggestion: type: object required: - nodeId - regionId - suggestedUnits - regionDemandUnits - nodeAvailabilityUnits - coverDays properties: nodeId: type: string regionId: type: string suggestedUnits: type: integer minimum: 0 regionDemandUnits: type: integer minimum: 0 nodeAvailabilityUnits: type: integer minimum: 0 coverDays: type: integer minimum: 1 maximum: 90 PlacementPlan: type: object required: - planId - sellerId - catalogItemId - coverDays - windowDays - basis - state - suggestions - createdAt properties: planId: type: string sellerId: type: string catalogItemId: type: string coverDays: type: integer windowDays: type: integer description: The observation window the demand figures cover. basis: type: string description: The formula version the plan was computed under. state: type: string enum: - SUGGESTED - ACCEPTED - SUPERSEDED suggestions: type: array items: $ref: '#/components/schemas/PlacementSuggestion' createdAt: type: string format: date-time acceptedAt: type: string format: date-time supersededAt: type: string format: date-time PlacementPlanPage: type: object required: - items - nextCursor properties: items: type: array items: $ref: '#/components/schemas/PlacementPlan' nextCursor: type: string description: Empty on the last page; else the `createdAt|planId` pair of the last item. CreateInboundPlanRequest: type: object required: - sellerId - destinationNodeId - packingOption - lines properties: sellerId: type: string minLength: 1 maxLength: 64 pattern: ^[A-Za-z0-9._-]+$ example: seller-77 destinationNodeId: type: string maxLength: 64 pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$ example: node-0f3a91 packingOption: $ref: '#/components/schemas/PackingOption' placementOption: $ref: '#/components/schemas/PlacementOption' lines: type: array minItems: 1 maxItems: 500 items: $ref: '#/components/schemas/PlanLine' PackingOption: type: string enum: - INDIVIDUAL - CASE_PACKED example: CASE_PACKED description: '`CASE_PACKED` cartons hold one item at the case GTIN''s units per pack; `INDIVIDUAL` cartons are packed by the seller as it sees fit.' InboundPlan: type: object required: - planId - sellerId - destinationNodeId - packingOption - placementOption - state - lines - capacityEnforced - createdAt properties: planId: type: string example: pln-0f3a91 sellerId: type: string example: seller-77 destinationNodeId: type: string example: node-0f3a91 packingOption: $ref: '#/components/schemas/PackingOption' placementOption: $ref: '#/components/schemas/PlacementOption' state: type: string enum: - DRAFT - CONFIRMED - CANCELLED example: DRAFT lines: type: array items: $ref: '#/components/schemas/PlanLine' redistribution: type: array description: The recorded capacity-split-v1 redistribution; present only for NETWORK_SPLIT (ADR 0015). items: $ref: '#/components/schemas/RedistributionLine' placementFeeBasis: description: The recorded fee-basis fact; present only for NETWORK_SPLIT (ADR 0015). allOf: - $ref: '#/components/schemas/PlacementFeeBasis' capacityEnforced: type: boolean example: true description: Whether the monthly capacity gate was actually applied - both the node's declared monthly volume and every line's unit volume known (ADR 0015). false never blocks the plan; the unenforced fact is recorded. createdAt: type: string format: date-time example: '2026-10-24T13:00:00Z' confirmedAt: type: string format: date-time example: '2026-10-24T13:00:00Z' cancelledAt: type: string format: date-time example: '2026-10-24T13:00:00Z' Dims: type: object description: Outer dimensions in millimetres. required: - l - w - h properties: l: type: integer minimum: 1 maximum: 2147483647 example: 400 w: type: integer minimum: 1 maximum: 2147483647 example: 300 h: type: integer minimum: 1 maximum: 2147483647 example: 200 CartonContent: type: object description: What a carton holds of one item, in eaches. required: - catalogItemId - gtin - qtyEaches properties: catalogItemId: type: string maxLength: 64 pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$ example: item-004512 gtin: type: string pattern: ^[0-9]{14}$ description: 14 digits with a GS1 mod-10 check digit. example: '00614141000036' qtyEaches: type: integer minimum: 1 maximum: 2147483647 example: 12 lot: type: string maxLength: 20 example: L7 expiry: type: string format: date example: '2027-10-24' AddCartonRequest: type: object required: - kind - contents - grossWeightG - dimsMm properties: sscc: type: string pattern: ^[0-9]{18}$ description: Optional. Accepted only when valid and unique network-wide; otherwise the network issues one. example: '006141420000000011' parentSscc: type: string pattern: ^[0-9]{18}$ description: The pallet SSCC, when the node accepts pallets. example: '006141420000000028' kind: type: string enum: - HOMOGENEOUS_CASE - MIXED example: HOMOGENEOUS_CASE contents: type: array minItems: 1 maxItems: 100 items: $ref: '#/components/schemas/CartonContent' grossWeightG: type: integer minimum: 1 maximum: 2147483647 example: 5200 dimsMm: $ref: '#/components/schemas/Dims' Carton: type: object required: - sscc - kind - contents - grossWeightG - dimsMm - sealed properties: sscc: type: string pattern: ^[0-9]{18}$ description: 18 digits with a GS1 mod-10 check digit. example: '006141420000000011' parentSscc: type: string pattern: ^[0-9]{18}$ description: 18 digits with a GS1 mod-10 check digit. example: '006141420000000028' kind: type: string enum: - HOMOGENEOUS_CASE - MIXED example: HOMOGENEOUS_CASE contents: type: array items: $ref: '#/components/schemas/CartonContent' grossWeightG: type: integer example: 5200 dimsMm: $ref: '#/components/schemas/Dims' sealed: type: boolean example: false description: 'True once the shipment is labelled: the manifest is frozen.' receiptStatus: type: string enum: - RECEIVED - MISSING - UNEXPECTED - DAMAGED example: RECEIVED description: Set once the vendor reported its receipt. InboundShipment: type: object required: - shipmentId - planId - sellerId - nodeId - state - cartons - createdAt properties: shipmentId: type: string example: shp-0f3a91 planId: type: string example: pln-0f3a91 sellerId: type: string example: seller-77 nodeId: type: string example: node-0f3a91 state: type: string enum: - DRAFT - LABELLED - SHIPPED - RECEIVING - CLOSED - CLOSED_WITH_DISCREPANCY example: DRAFT cartons: type: array items: $ref: '#/components/schemas/Carton' createdAt: type: string format: date-time example: '2026-10-24T13:00:00Z' labelledAt: type: string format: date-time example: '2026-10-24T13:00:00Z' shippedAt: type: string format: date-time example: '2026-10-24T13:00:00Z' receivedAt: type: string format: date-time example: '2026-10-24T13:00:00Z' Label: type: object description: The data a printer needs for one carton label. required: - labelRef - sscc - gs1128 - humanReadable - kind - contents - contentSummary - totalEaches - destinationNodeId properties: labelRef: type: string example: LBL-006141420000000011 sscc: type: string pattern: ^[0-9]{18}$ description: 18 digits with a GS1 mod-10 check digit. example: '006141420000000011' gs1128: type: string example: (00)006141420000000011 description: 'The GS1-128 element string for AI 00: `(00)`.' humanReadable: type: string example: (00) 0 0614 1420 0000 0001 1 parentSscc: type: string pattern: ^[0-9]{18}$ description: 18 digits with a GS1 mod-10 check digit. example: '006141420000000028' kind: type: string enum: - HOMOGENEOUS_CASE - MIXED example: HOMOGENEOUS_CASE contents: type: array items: $ref: '#/components/schemas/CartonContent' contentSummary: type: string example: '12 eaches: item-004512 x12' totalEaches: type: integer example: 12 destinationNodeId: type: string example: node-0f3a91 AddedCarton: type: object required: - shipmentId - carton - ssccIssued - label properties: shipmentId: type: string example: shp-0f3a91 carton: $ref: '#/components/schemas/Carton' ssccIssued: type: boolean example: true description: True when the network issued the SSCC. label: $ref: '#/components/schemas/Label' ShipmentLabels: type: object required: - shipmentId - state - destinationNodeId - labels properties: shipmentId: type: string example: shp-0f3a91 state: type: string example: LABELLED destinationNodeId: type: string example: node-0f3a91 labels: type: array items: $ref: '#/components/schemas/Label' SellerInboundPerformanceReport: type: object required: - from - to - days properties: from: type: string format: date description: The first UTC day of the range (inclusive). to: type: string format: date description: The last UTC day of the range (inclusive). days: type: array description: One row per UTC day that has any fact, ordered by day. items: $ref: '#/components/schemas/SellerInboundPerformanceDay' SellerInboundPerformanceDay: type: object required: - day - inbound_plans_confirmed - placement_advisories_issued - shipments_received - received_eaches - received_item_count - received_by_item - advisory_to_receipt_samples - advisory_to_receipt_p50_seconds - advisory_to_receipt_p95_seconds properties: day: type: string format: date inbound_plans_confirmed: type: integer minimum: 0 placement_advisories_issued: type: integer minimum: 0 shipments_received: type: integer minimum: 0 received_eaches: type: integer minimum: 0 description: The eaches of every received line of the day, not only of the listed items. received_item_count: type: integer minimum: 0 description: The distinct GTINs received that day, not only the listed ones. received_by_item: type: array maxItems: 10 description: At most 10 items, most eaches first, ties by GTIN. items: $ref: '#/components/schemas/ReceivedItem' advisory_to_receipt_samples: type: integer minimum: 0 description: The received lines of the day that had a preceding placement advisory of the same seller and item. advisory_to_receipt_p50_seconds: type: number nullable: true description: Median seconds from that advisory to the receipt; null without a sample. advisory_to_receipt_p95_seconds: type: number nullable: true description: 95th-percentile seconds from that advisory to the receipt; null without a sample. ReceivedItem: type: object required: - gtin - publications - qty_eaches properties: gtin: type: string pattern: ^[0-9]{14}$ description: The EACH-level GTIN when the receipt resolved it, otherwise the carton GTIN (ADR 0014). catalog_item_id: type: string description: Present when a received line of that day resolved the catalogue item. publications: type: integer minimum: 1 description: The receipts of the day that listed this GTIN. qty_eaches: type: integer minimum: 1 ReportFreshness: type: object required: - as_of - lag_seconds properties: as_of: type: string format: date-time nullable: true lag_seconds: type: number minimum: 0 nullable: true