Skip to main content

Inventory feeds

Vendor inventory feeds for one node, applied in one transaction (aggregate InventoryFeed, in-org call from vendor-connectivity).

📄️Introduction

REST contract of the offer-availability bounded context of the retail network, derived from retail-network-docs model/model.yaml (contexts[offer-availability].rest, .aggregates, .publishes, conventions.errors) and adjusted by the final cross-context decisions (Gap Register G23 and G24). The context owns the catalogue items, one listing per (catalogue item, node) and the vendor-declared available quantity of each listing with its basis. POST /inventory-feeds is an in-organization call made by vendor-connectivity while it processes a vendor's inventory submission; vendors never call this API directly. Network merchandising calls the catalogue and listing writes; the storefront reads GET /catalog (Open Host Service). No authentication, consistent with the fleet. Errors are RFC 9457 problem details. The shared problem types are not-found (404), illegal-transition (409), concurrent-update (409) and validation-failed (422); the others are this context's invariants, one slug per model Err name.

📄️Apply an inventory feed for one node (ApplyInventoryFeed)

In-org call from vendor-connectivity. The feed is applied in ONE transaction (at most 10000 lines per node; larger feeds are split by the vendor). Outcomes (Gap Register G23): APPLIED when every line names a listing of the node and no quantity is negative (a line whose asOf is not after the listing's current asOf is skipped and counted as stale, it does not fail the feed; one ListingAvailabilityChanged per applied line and one InventoryFeedApplied); SUPERSEDED when the feed's asOf is older than the last applied feed of that node (nothing applied, no event); FAILED when a line breaks an invariant (listing-not-on-node or negative-availability: nothing applied, no event, the feed row is kept and the request is answered 422). A full feed (fullUpdate true) sets availableQty 0, keeping the basis and stamping the feed's asOf, on every listing of the node it omits. A FAILED feedId may be sent again; an APPLIED or SUPERSEDED feedId is refused with feed-already-applied.

📄️Create a listing (CreateListing)

Creates the listing of one catalogue item on one node and publishes ListingCreated. The listing starts LIVE when the node is ACTIVE in the local node status view. Otherwise (node proposed, suspended, retired or not yet known) it starts SUPPRESSED with reason NODE_NOT_SELLABLE; for a DISCONTINUED item it starts SUPPRESSED with reason DISCONTINUED (Gap Register G24); for an ownerRef whose seller the local seller status view says is SUSPENDED it starts SUPPRESSED with reason OWNER_SUSPENDED (ADR 0013). The highest cause wins: DISCONTINUED, then NODE_NOT_SELLABLE, then OWNER_SUSPENDED. Its availability starts at 0, basis UNKNOWN, with no asOf.

📄️Declare a pack level of a catalogue item (DeclarePackLevel)

Declares the pack level (EACH, INNER, CASE or PALLET) identified by a GS1 GTIN and publishes CatalogItemPackagingDeclared (ADR 0006). unitsPerPack is in eaches: 1 for EACH, at least 2 above it and at least twice the child's. A level above EACH names the childGtin of an active lower level of the same item. The unitsPerPack of a GTIN is immutable: re-declaring an active GTIN with another count is 409 pack-quantity-immutable (a new count is a new GTIN). Declaring a NEW GTIN at a level that has an active one retires the old level (CatalogItemPackLevelRetired, then CatalogItemPackagingDeclared, one aggregate version). The identical declaration changes nothing and publishes nothing; new dimsMm or grossWeightG on an active GTIN are updated in place. A GTIN identifies one item or pack level, forever (409 gtin-already-assigned). A DISCONTINUED item takes no packaging change (409 illegal-transition).