Delete buyerv1.0.0 · JSON Schema
Deletes a Buyer profile by identifier; the operation is restricted to administrators.
1. Delete a Buyer Profile
An admin removes a Buyer record by its UUID via Ordering API.
Payload details
id: Required Buyer UUID passed as the route parameter (/api/v1/buyers/{id}).- Request body: None.
Using this example
Returns 204 No Content and removes the Buyer record from PostgreSQL.
using BookWorm.Chassis.Utilities.Configurations;using BookWorm.Constants.Aspire;using Refit;
public interface IOrderApiClient{ [Delete("/api/v1/buyers/{id}")] Task DeleteBuyerAsync(Guid id, CancellationToken cancellationToken = default);}
// DI registration following BookWorm.Chassis Refit patternbuilder.Services .AddRefitGeneratedClient<IOrderApiClient>(settings, Services.Ordering) .ConfigureHttpClient(client => client.BaseAddress = new($"https+http://{Services.Ordering}")) .ConfigurePrimaryHttpMessageHandler(() => new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(5) } );
// Typed invocationawait orderApiClient.DeleteBuyerAsync( Guid.Parse("01960a1b-2c3d-7e4f-8a9b-0c1d2e3f4a01"), cancellationToken);import buyersApiClient from "@workspace/api-client/ordering/buyers";import useDeleteBuyer from "@workspace/api-hooks/ordering/buyers/useDeleteBuyer";
const buyerId = "01960a1b-2c3d-7e4f-8a9b-0c1d2e3f4a01";
// 1. Direct @workspace/api-client (Axios) callawait buyersApiClient.delete(buyerId);
// 2. React / TanStack Query hook (@workspace/api-hooks)const { mutate: deleteBuyer, isPending } = useDeleteBuyer({ onSuccess: () => { console.log(`Deleted buyer ${buyerId}`); },});
deleteBuyer(buyerId);1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "DeleteBuyerRequest",
4 "description": "Path identifier for the Buyer to delete. The operation has no request body.",
5 "type": "string"
6}
7