Categories
The single, versioned category tree (CategoryTree).
Introduction
REST contract of the product-content bounded context of the digital storefront (model: warehouse-docs storefront/model/model.yaml, contexts[product-content], with the FINAL model-gap decisions applied). Product Content enriches the network's catalogue item with description, bullets (<= 10), attributes (<= 50), media (<= 12, URLs to static assets only; upload is out of scope) and the category tree. The title stays the item master's. Content publishes only when complete: a description, exactly one PRIMARY medium and a category. Content lifecycle: DRAFT (revisable, discardable) -> PUBLISHED (revisable, publishable again with the new revision) -> RETIRED (terminal). The category tree is ONE live aggregate without a draft state: every category write applies to the live tree and publishes a new version (CategoryTreePublished). Categories are never deleted. Errors are RFC 9457 problem details (application/problem+json) whose type is /problems/<slug>; shared types are not-found (404), illegal-transition (409), concurrent-update (409) and validation-failed (422), plus one kebab-case slug per Err of the model. Every POST takes an Idempotency-Key header (24 hours); PUT and DELETE are idempotent by method. A 2xx and a FINAL refusal are stored under the key and replayed to a retry; a RETRYABLE refusal (nothing committed, the answer depends on state that can change) is not stored: the key is released, a retry executes again, and another request under the released key is new. Routes follow the fleet REST API guideline: nouns, never verbs (a lifecycle transition is a transition resource such as /revisions or /publications). No authentication.
Categories
Categories
Create a category in the live tree
CreateCategory. Applies to the live tree and publishes a new tree version (CategoryTreePublished). The tree is at most four levels deep and never contains a cycle; siblings never share a name (compared case-insensitively). The category id is minted by the service.
Create the draft content of a catalogue item
CreateProductContent. The item must exist in the local CatalogItemView (fed by offer-availability events) and must not be discontinued. The content starts DRAFT at revision 1; the body may be incomplete (the publish gate is checked by POST /product-contents/{catalogItemId}/publications). A second create for the same item is a 409 concurrent-update.
Discard the draft content of a catalogue item
DiscardDraft. DRAFT to RETIRED with retiredReason DISCARDED. Nothing was ever published, so no event is raised. DELETE is idempotent by method and takes no Idempotency-Key; a repeat finds the content already RETIRED and answers 409 illegal-transition.
Get the content of one catalogue item
Returns the ProductContent with its current revision.
Get the category tree
Returns the categories of the current CategoryTree version, ordered by path (parents before children). Before the first category the tree is version 0 and empty. Not paged (x-pagination-exempt: view): the tree is ONE versioned aggregate, so one response is one consistent snapshot of one version; the tree is at most four levels deep.
List product contents, paged (projection bootstrap)
Keyset-paged list of product contents of every state, ordered by catalogItemId. Used by product-discovery's projection rebuild (snapshot + catch-up); not part of a user request path. Follow nextCursor until it is absent. Any query parameter other than limit and cursor is a 400 unknown-query-parameter.
Move a category under a new parent
MoveCategory. Replaces the parent of the category; the subtree moves with it. Moving never creates a cycle and never exceeds depth four. Publishes a new tree version. PUT is idempotent by method and takes no Idempotency-Key.
ProductContents
ProductContents
Publish the category tree again
PublishCategoryTree. Publishes the live tree under a new version (PUBLISHED to PUBLISHED), for example to re-send it to a consumer. Every category write already publishes; this call changes no category.
Publish the content of a catalogue item
PublishContent. DRAFT to PUBLISHED, or PUBLISHED to PUBLISHED when a revision is waiting. Publish needs a description, exactly one PRIMARY medium and a category (ErrIncompleteContent) and a catalogue item that is not discontinued. Publishes ProductContentPublished with the current revision. PUBLISHED content whose current revision is already published is returned unchanged and publishes nothing.
Rename a category
RenameCategory. Replaces the name of the category. Siblings never share a name. The paths of the subtree follow. Publishes a new tree version. PUT is idempotent by method and takes no Idempotency-Key.
Retire the published content of a catalogue item
RetireContent. PUBLISHED to RETIRED (terminal). A DRAFT is discarded with DELETE /product-contents/{catalogItemId}/draft instead. RetireOnDiscontinue retires content automatically when the network discontinues the item. Publishes ProductContentRetired.
Revise the content of a catalogue item
ReviseDraft (DRAFT to DRAFT) or ReviseContent (PUBLISHED to PUBLISHED), chosen by the state. The body replaces the whole editable content and takes a new revision. PUBLISHED content must stay complete (incomplete-content otherwise) and shoppers see the revision only after POST /product-contents/{catalogItemId}/publications publishes it. Revising RETIRED content is a 409 content-retired.