Basket deletion completedv1.0.0 · JSON Schema
Indicates that Basket successfully deleted the submitted basket during checkout cleanup.
1. Post-Checkout Basket Cleanup Succeeded
After Finance dispatches PlaceOrderCommand, Basket API deletes the shopper’s Redis basket and publishes BasketDeletedCompleteIntegrationEvent so OrderOrchestrator can advance the checkout saga.
Payload details
id: UUIDv7 generated byIntegrationEvent(Guid.CreateVersion7()).creationDate: UTC ISO 8601 timestamp (DateTime.UtcNow).orderId: UUID of the placed order (also used as the Kafka partition key).basketId: UUID of the deleted Redis basket.totalMoney: Non-negative order total (decimal).
Example payload
{ "id": "01960a1b-4d5e-7f01-8a9b-0c1d2e3f4b01", "creationDate": "2026-11-25T16:15:00Z", "orderId": "01960a1b-3c4d-7e00-8a9b-0c1d2e3f4a99", "basketId": "01960a1b-2c3d-7e4f-8a9b-0c1d2e3f4a01", "totalMoney": 59.98}Using this example
Basket API publishes BasketDeletedCompleteIntegrationEvent to bookworm.{env}.basket.delete-complete partitioned by OrderId, and Finance resumes OrderOrchestrator to emit DeleteBasketCompleteCommand.
using BookWorm.Chassis.EventBus;using BookWorm.Chassis.EventBus.Idempotency;using BookWorm.Contracts;using Wolverine.Attributes;
// Integration event contract (BookWorm.Contracts)[IntegrationMessageOwner(ServiceName = Services.Basket, TopicName = "delete-complete")][MessageIdentity("BookWorm.Contracts.BasketDeletedCompleteIntegrationEvent")]public sealed record BasketDeletedCompleteIntegrationEvent( Guid OrderId, Guid BasketId, decimal TotalMoney) : IntegrationEvent;
// Publishing from Basket API's PlaceOrderCommandHandler via Wolverine[WolverineHandler]public async Task<IntegrationEvent> Handle( PlaceOrderCommand command, CancellationToken cancellationToken){ var deleted = await repository.DeleteBasketAsync(command.BasketId.ToString());
return deleted ? new BasketDeletedCompleteIntegrationEvent( command.OrderId, command.BasketId, command.TotalMoney ) : new BasketDeletedFailedIntegrationEvent( command.OrderId, command.BasketId, command.Email, command.TotalMoney );}1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "BasketDeletedCompleteIntegrationEvent",
4 "type": "object",
5 "additionalProperties": false,
6 "required": ["id", "creationDate", "orderId", "basketId", "totalMoney"],
7 "properties": {
8 "id": {
9 "type": "string",
10 "format": "uuid",
11 "description": "Unique identifier assigned by the integration-event building block."
12 },
13 "creationDate": {
14 "type": "string",
15 "format": "date-time",
16 "description": "UTC timestamp when the integration event was created."
17 },
18 "orderId": {
19 "type": "string",
20 "format": "uuid",
21 "description": "Identifier of the order whose submitted basket was deleted."
22 },
23 "basketId": {
24 "type": "string",
25 "format": "uuid",
26 "description": "Identifier of the basket deleted during checkout cleanup."
27 },
28 "totalMoney": {
29 "type": "number",
30 "format": "double",
31 "description": "Total purchase amount associated with the order."
32 }
33 }
34}
35