Delete basketv1.0.0 · JSON Schema
Deletes the current basket.
1. Clear the Authenticated Shopper’s Basket
An authenticated shopper clears their shopping basket from the storefront cart drawer. The basket owner is resolved from the Entra ID JWT subject claim, so no request body or path ID is required.
Payload details
- Request body: Empty (
additionalProperties: falseinschema.json). - Identity: Extracted server-side from the authenticated
Authorization: Bearer <token>header.
Using this example
Returns 204 No Content and deletes the shopper’s basket key from Redis.
using BookWorm.Chassis.Utilities.Configurations;using BookWorm.Constants.Aspire;using Refit;
public interface IBasketApiClient{ [Delete("/api/v1/baskets")] Task DeleteBasketAsync(CancellationToken cancellationToken = default);}
// DI registration following BookWorm.Chassis Refit patternbuilder.Services .AddRefitGeneratedClient<IBasketApiClient>(settings, Services.Basket) .ConfigureHttpClient(client => client.BaseAddress = new($"https+http://{Services.Basket}")) .ConfigurePrimaryHttpMessageHandler(() => new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(5) } );
// Typed invocationawait basketApiClient.DeleteBasketAsync(cancellationToken);import basketApiClient from "@workspace/api-client/basket/baskets";import useDeleteBasket from "@workspace/api-hooks/basket/useDeleteBasket";
// 1. Direct @workspace/api-client (Axios) callawait basketApiClient.delete();
// 2. React / TanStack Query hook (@workspace/api-hooks)const { mutate: deleteBasket, isPending } = useDeleteBasket({ onSuccess: () => { console.log("Shopping basket cleared"); },});
deleteBasket();1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "DeleteBasketRequest",
4 "description": "The OpenAPI operation defines no request body or parameters.",
5 "type": "object",
6 "additionalProperties": false
7}
8