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

Read the architecture guide →

Create book

Creates a book listing and returns its generated UUID.

Catalog Management
POST/api/v1/books

CreateBook creates a new book listing 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 (POST /catalog/api/v1/books) from a multipart/form-data payload, optionally associates a cover image, and returns 201 Created with the generated UUIDv7 and a Location header.

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 POST, multipart/form-data request, JSON string response
Gateway EndpointPOST /catalog/api/v1/books (service path /api/v1/books)
Authentication & AuthorizationMicrosoft Entra ID JWT — business_user policy (role business_user or admin and scopes catalog_read, catalog_write)
Idempotency / ConcurrencyNot idempotent; no x-request-id header is required or enforced
Rate Limit / CachingGlobal concurrency (100) and fixed-window (30 req/min) limiters plus per-user token bucket; invalidates book list and search caches
Contract Version1.0.0 (ApiVersions.V1)

Request & Response Contract

Request Form Fields (multipart/form-data)

NameTypeRequiredConstraintsDescription
namestringYesNon-empty, max 50 charactersBook title
descriptionstringNoDefault "", max 500 charactersBook summary text
pricenumberYesStrictly > 0 (numeric(18,2))Regular catalog price
priceSalenumber | nullNoWhen provided: strictly > 0 and <= priceOptional promotional sale price
categoryIdstring (uuid)YesNon-empty UUID; must reference an existing categoryCategory identifier
publisherIdstring (uuid)YesNon-empty UUID; must reference an existing publisherPublisher identifier
authorIdsstring[] (uuid[])YesNon-empty array (>= 1 UUID); repeat authorIds form fields for multiple authorsAuthor identifiers associated with the book
imagestring (binary)NoMax 1,048,576 bytes (1 MB); image/jpeg (.jpg, .jpeg), image/png (.png), or image/webp (.webp); extension must match content typeOptional cover image upload

Success Response (201 Created)

NameTypeRequiredConstraintsDescription
Location headerstringYesRelative path /api/v1/books/{id}URI of the created book resource
Root bodystringYesUUIDv7Generated unique identifier of the created book

Behavior & Side Effects

  • Transactional persistence: Saves the BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs with initial status InStock, averageRating = 0.0, totalReviews = 0, and isDeleted = false.
  • Cache invalidation: Invalidates cached book lists (books:list) and search results (books:search).
  • Vector index queueing: Database triggers enqueue the new book ID 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 (every 5 minutes via Process Vector Batch ChannelChannelv1.0.0Process Vector Batch ChannelUnprefixed Kafka trigger topic owned by the platform team used by Scheduler Service every five minutes to initiate Catal...Ownerai-capabilities-teamOpen docs).
Warning

Known runtime behavior: Due to a response-type mismatch in the mediator pre-processing pipeline for this command, the cover image upload step does not execute automatically during book creation. Upload or update cover images via Update bookCommandv1.0.0Update bookUpdates an existing book listing, including optional image and catalog relationships.Ownercatalog-experience-teamSchemaDiagramOpen docs until the pipeline registration is aligned.

Error Responses

Status / CodeConditionClient Recovery Action
400 Bad RequestValidation failure (missing required fields, price <= 0, priceSale <= 0 or > price, length exceeded, invalid image size/type/extension) or malformed multipart payloadFix invalid form fields or file upload; 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
429 Too Many RequestsRate limit quota exceeded (Retry-After header included)Wait for the Retry-After interval before retrying
500 Internal Server ErrorForeign-key violation (non-existent categoryId, publisherId, or authorIds), blob upload failure, or unhandled server error (traceId included)Verify referenced IDs exist and inspect service logs using traceId

Create book schema

8 properties

Multipart payload for creating a book listing.

Additional properties: not allowed
namestring
required

Book title.

Min length: 1
descriptionstring

Book description.

Min length: 1
imagestring | null

Optional cover image file.

pricenumber
required

Regular price.

Minimum: 0
priceSalenumber | null

Optional sale price.

Minimum: 0
categoryIdstring<uuid>
required

Category UUID.

publisherIdstring<uuid>
required

Publisher UUID.

authorIdsarray[string]
required

Authors associated with the book.