Delete order
Soft-deletes an Order by its identifier without changing its business status.
/api/v1/orders/{id}DeleteOrder soft-deletes an OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs in 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/orders/{id}) while leaving its business status unchanged. Access is restricted to callers holding the Microsoft Entra ID admin role.
Overview
| Property | Value |
|---|---|
| Bounded Context | Ordering |
| Owner Service | 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 |
| Protocol / Format | HTTP DELETE, path parameter only, empty response (204 No Content) |
| Gateway Endpoint | DELETE /ordering/api/v1/orders/{id} (service path /api/v1/orders/{id}) |
| Authentication & Authorization | Microsoft Entra ID JWT — admin policy (role admin plus scopes ordering_read, ordering_write) |
| Idempotency / Concurrency | Not idempotent across retries; repeat calls return 404 Not Found; no x-request-id header is required |
| Rate Limit / Caching | Global concurrency (100), per-IP fixed-window (30 req/min), and per-user token bucket (30 burst, 20 per 10s, queue 5) |
| Contract Version | 1.0.0 (ApiVersions.V1) |
Request & Response Contract
Path Parameters
Accepts no request body and requires no x-request-id header.
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | Yes | Path parameter; valid UUID | Unique identifier of the order to soft-delete |
Success Response (204 No Content)
Empty response body confirms the order was soft-deleted.
Behavior & Side Effects
- Soft-delete without status transition: Sets
isDeleted = truewithout changing the order’sstatus(New,Completed, orCancelled). - Global query filter: Soft-deleted orders are hidden from standard read queries and subsequent
DELETEcalls (404 Not Found). - No events emitted: Raises no domain events and publishes no Kafka integration events. To cancel an active order and notify downstream workflows, use Cancel orderCommandv1.0.0Cancel orderMarks an existing Order as Cancelled when its current status is New.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs.
Error Responses
| Status / Code | Condition | Client Recovery Action |
|---|---|---|
400 Bad Request | Path parameter {id} is not a valid UUID | Supply a valid UUID; do not retry unchanged |
401 Unauthorized | Missing, expired, or invalid Entra ID bearer token | Acquire a fresh Entra ID access token and retry |
403 Forbidden | Caller lacks the admin role or ordering_read/ordering_write scopes | Authenticate with an admin token that includes the required scopes |
404 Not Found | Order does not exist or was already soft-deleted | Verify the order identifier; treat as already soft-deleted if retrying a prior call |
429 Too Many Requests | Rate limit quota exceeded (Retry-After header included) | Wait for the Retry-After interval before retrying |
500 Internal Server Error | Unhandled database failure | Retry with backoff and inspect service logs |
Related Documentation
- 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 — Service architecture, persistence, and endpoints.
- OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs — Order aggregate schema and soft-delete behavior.
- Cancel orderCommandv1.0.0Cancel orderMarks an existing Order as Cancelled when its current status is New.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Transition a
Neworder toCancelledand notify downstream workflows. - Handle basket deletion failedCommandv1.0.0Handle basket deletion failedReports Finance's failed basket-cleanup outcome so Order API can soft-delete the affected Order. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Automated compensation command that also soft-deletes an order.
Delete order schema
Path identifier for the Order to soft-delete. The operation has no request body.
Schema does not contain any properties.