Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Update category

Updates an existing category in the Catalog.

Catalog Management
PUT/api/v1/categories

UpdateCategory updates the display name of an existing category in Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs (PUT /catalog/api/v1/categories) and returns 204 No Content. Callers pass both id and name in the JSON request body rather than as a path parameter.

Overview

PropertyValue
Bounded ContextCatalog
Owner ServiceCatalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs
Protocol / FormatHTTP PUT, application/json request and empty response (204 No Content)
Gateway EndpointPUT /catalog/api/v1/categories (service path /api/v1/categories)
Authentication & AuthorizationMicrosoft Entra ID JWT — business_user policy (role business_user or admin and scopes catalog_read, catalog_write)
Idempotency / ConcurrencyNaturally idempotent for repeated requests with the same id and name; no x-request-id header is enforced
Rate Limit / CachingGlobal concurrency (100) and fixed-window (30 req/min) limiters plus per-user token bucket; invalidates category and book caches
Contract Version1.0.0 (ApiVersions.V1)

Request & Response Contract

Request Body (application/json)

Leading and trailing whitespace is trimmed from string properties during deserialization.

NameTypeRequiredConstraintsDescription
idstring (uuid)YesNon-empty UUIDIdentifier of the category to update
namestringYesNon-empty, max 50 characters, uniqueReplacement display name for the category

Behavior & Side Effects

  • Persistence & uniqueness: Updates the CategoryEntityv1.0.0CategorySingle-level taxonomy classification grouping books by subject or genre within the product catalog.Ownercatalog-experience-teamOpen docs display name; category names are unique-indexed, so renaming to an existing category’s name fails with 500 Internal Server Error.
  • Cache invalidation: Clears catalog:categories:v1 and invalidates book and books:list cache tags.
  • Vector index queueing: Database triggers enqueue all linked book IDs for asynchronous vector embedding refresh by Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs.

Error Responses

Status / CodeConditionClient Recovery Action
400 Bad Requestid is empty or invalid UUID, or name is missing, empty, whitespace-only, or exceeds 50 charactersFix the request body; do not retry unchanged input
401 UnauthorizedMissing, expired, or invalid Entra ID JWTAcquire a valid Entra ID access token and retry
403 ForbiddenToken lacks role business_user or admin, or lacks scopes catalog_read and catalog_writeRequest the required Entra ID app role and scopes
404 Not FoundNo category exists with the supplied idVerify the UUID; do not treat 404 as a completed update
429 Too Many RequestsRate limit quota exceeded (Retry-After header included)Wait for the Retry-After interval before retrying
500 Internal Server ErrorDuplicate name violating the unique constraint or unhandled server error (traceId included)Check for a conflicting category name and inspect logs using traceId

Update category schema

2 properties

Payload for updating a category.

Additional properties: not allowed
idstring<uuid>
required

Identifier of the category to update.

namestring
required

New display name for the category.

Min length: 1