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

Read the architecture guide →

Delete buyer

Deletes a Buyer profile by identifier; the operation is restricted to administrators.

Customer Management
DELETE/api/v1/buyers/{id}

DeleteBuyer permanently removes a BuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docs profile from Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs (DELETE /ordering/api/v1/buyers/{id}) and returns 204 No Content. Access is restricted to callers holding the Microsoft Entra ID admin role.

Overview

PropertyValue
Bounded ContextOrdering
Owner ServiceOrder APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs
Protocol / FormatHTTP DELETE, path parameter only, empty response (204 No Content)
Gateway EndpointDELETE /ordering/api/v1/buyers/{id} (service path /api/v1/buyers/{id})
Authentication & AuthorizationMicrosoft Entra ID JWT — admin policy (role admin plus scopes ordering_read, ordering_write)
Idempotency / ConcurrencyNot idempotent across retries; repeat calls return 404 Not Found; no x-request-id header is required
Rate Limit / CachingGlobal concurrency (100), per-IP fixed-window (30 req/min), and per-user token bucket (30 burst, 20 per 10s, queue 5)
Contract Version1.0.0 (ApiVersions.V1)

Request & Response Contract

Path Parameters

Accepts no request body and requires no x-request-id header.

NameTypeRequiredConstraintsDescription
idstring (uuid)YesPath parameter; valid UUIDUnique identifier of the buyer profile to delete

Success Response (204 No Content)

Empty response body confirms the buyer profile was permanently deleted.

Behavior & Side Effects

  • Permanent hard delete: Permanently removes the BuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docs row from PostgreSQL (unlike orders, buyers are not soft-deleted).
  • No events emitted: Deleting a buyer raises no domain events and publishes no Kafka integration events.
Warning

The orders.buyer_id foreign key column is non-nullable while the relationship is configured with ON DELETE SET NULL. Attempting to delete a buyer who has existing orders will fail at the database layer and return 500 Internal Server Error.

Error Responses

Status / CodeConditionClient Recovery Action
400 Bad RequestPath parameter {id} is not a valid UUIDSupply a valid UUID; do not retry unchanged
401 UnauthorizedMissing, expired, or invalid Entra ID bearer tokenAcquire a fresh Entra ID access token and retry
403 ForbiddenCaller lacks the admin role or ordering_read/ordering_write scopesAuthenticate with an admin token that includes the required scopes
404 Not FoundNo buyer profile exists with the specified {id}Verify the buyer identifier; treat as already absent if retrying a prior deletion
429 Too Many RequestsRate limit quota exceeded (Retry-After header included)Wait for the Retry-After interval before retrying
500 Internal Server ErrorDatabase foreign-key constraint error (e.g., buyer has orders) or unhandled failureInspect service logs and check whether dependent orders reference the buyer

Delete buyer schema

0 properties

Path identifier for the Buyer to delete. The operation has no request body.

Schema does not contain any properties.