Skip to main content
Version: 1.0.0

Seller Inbound API

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)<sscc>, 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

seller-inbound maintainers:

URL: https://github.com/IQVO/seller-inbound

License