Delete basket
Deletes the current basket.
/api/v1/basketsDeleteBasket removes the authenticated customer’s active BasketEntityv1.0.0BasketCustomer-scoped, mutable pre-order collection of requested books and quantities managed prior to checkout.Ownercommerce-fulfillment-teamOpen docs from Redis in Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets,
Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs (DELETE /basket/api/v1/baskets) and returns 204 No Content. This endpoint handles customer-initiated deletion only; post-checkout basket cleanup runs asynchronously over Kafka via Place orderCommandv1.0.0Place orderShared Finance order-placement command consumed by Notification to render
and submit a new-order email.
Ownerplatform-engineering-teamSchemaDiagramOpen docs.
Overview
| Property | Value |
|---|---|
| Bounded Context | Shopping |
| Owner Service | Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs |
| Protocol / Format | HTTP DELETE, empty request and response (204 No Content) |
| Gateway Endpoint | DELETE /basket/api/v1/baskets (service path /api/v1/baskets) |
| Authentication & Authorization | Microsoft Entra ID JWT — customer role plus scopes basket_read, basket_write |
| Idempotency / Concurrency | Not idempotent across retries; repeat calls return 404 Not Found |
| Rate Limit / Caching | Global concurrency (100), per-IP fixed-window (30 req/min), and per-user token bucket (30 tokens, +20 per 10s, queue 5) |
| Contract Version | 1.0.0 (ApiVersions.V1) |
Request & Response Contract
Request Parameters
Accepts no path parameters, query parameters, or request body.
Success Response (204 No Content)
Empty response body confirms the basket was deleted.
Behavior & Side Effects
- Existence check before deletion: Checks for an active basket under the authenticated user’s ID in Redis and returns
404 Not Foundif none exists. - No integration events: HTTP deletion does not publish Basket deletion completedEventv1.0.0Basket deletion completedIndicates that Basket successfully deleted the submitted basket during checkout cleanup. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs or Basket deletion failedEventv1.0.0Basket deletion failedIndicates that Basket could not delete the submitted basket during checkout cleanup. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs; post-checkout cleanup is handled separately via Place orderCommandv1.0.0Place orderShared Finance order-placement command consumed by Notification to render and submit a new-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docs.
OpenAPI metadata declares 404 Not Found as application/problem+json, whereas runtime responses return application/json with { "detail": "The requested resource was not found." }.
Error Responses
| Status / Code | Condition | Client Recovery Action |
|---|---|---|
401 Unauthorized | Missing, expired, or invalid Entra ID bearer token | Acquire a valid Entra ID access token and retry |
403 Forbidden | Valid token missing the customer role or basket_read/basket_write scopes | Request a token with the required role and scopes |
404 Not Found | No active basket exists in Redis for the authenticated customer | Treat the basket as already cleared or refresh client state; do not retry unchanged |
429 Too Many Requests | Rate limit quota exceeded (Retry-After header included) | Wait for the Retry-After interval before retrying |
500 Internal Server Error | Unexpected Redis or server failure (traceId included) | Retry with exponential backoff; inspect service logs using traceId |
Related Documentation
- Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs — Service overview, Redis storage, and authorization policy.
- BasketEntityv1.0.0BasketCustomer-scoped, mutable pre-order collection of requested books and quantities managed prior to checkout.Ownercommerce-fulfillment-teamOpen docs — Basket entity model.
- Create basketCommandv1.0.0Create basketCreates a basket containing the supplied item identifiers and quantities.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Initialize a basket.
- Update basketCommandv1.0.0Update basketReplaces a basket's item collection with the supplied items.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Replace all items in an existing basket.
- Get basketQueryv1.0.0Get basketReturns the current basket and its item details.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Retrieve the current basket.
Delete basket schema
The OpenAPI operation defines no request body or parameters.
not allowedSchema does not contain any properties.