Place orderv1.0.0 · JSON Schema
Shared Finance order-placement command consumed by Notification to render and submit a new-order email.
1. Trigger Post-Checkout Basket Cleanup and Order Confirmation Email
After Ordering API emits UserCheckedOutIntegrationEvent, Finance’s Durable Functions OrderOrchestrator publishes PlaceOrderCommand to bookworm.{env}.finance.place-order so Basket API deletes the customer’s basket and Notification sends an order confirmation email.
Payload details
id: UUIDv7 generated byIntegrationEvent(Guid.CreateVersion7()).creationDate: UTC ISO 8601 timestamp (DateTime.UtcNow).basketId: UUID of the shopper’s Redis basket to delete.orderId: UUID of the placed order (Kafka partition key and Basket deduplication key).fullName: Optional customer display name (nulldefaults to"Customer"in Notification).email: Optional recipient email address (nullor whitespace skips email delivery).totalMoney: Order total (decimal).
Example payload
{ "id": "01960a1b-6a03-7b00-8a9b-0c1d2e3f4d03", "creationDate": "2026-11-25T16:14:58Z", "basketId": "01960a1b-2c3d-7e4f-8a9b-0c1d2e3f4a01", "orderId": "01960a1b-3c4d-7e00-8a9b-0c1d2e3f4a99", "fullName": "Minh Nguyen", "email": "minh.nguyen@bookworm.dev", "totalMoney": 59.98}Using this example
Basket API deletes the Redis basket and publishes BasketDeletedCompleteIntegrationEvent (or BasketDeletedFailedIntegrationEvent), while Notification independently renders and dispatches the new-order confirmation email.
using BookWorm.Chassis.EventBus;using BookWorm.Chassis.EventBus.Idempotency;using BookWorm.Contracts;using Wolverine;using Wolverine.Attributes;
// Integration command contract (BookWorm.Contracts)[IntegrationMessageOwner(ServiceName = Services.Finance, TopicName = "place-order")][MessageIdentity("BookWorm.Contracts.PlaceOrderCommand")]public sealed record PlaceOrderCommand( Guid BasketId, Guid OrderId, string? FullName, string? Email, decimal TotalMoney) : IntegrationEvent;
// 1. Publishing from Finance Durable Functions activity via Wolverine IMessageBusawait bus.PublishAsync( new PlaceOrderCommand( Guid.Parse("01960a1b-2c3d-7e4f-8a9b-0c1d2e3f4a01"), Guid.Parse("01960a1b-3c4d-7e00-8a9b-0c1d2e3f4a99"), "Minh Nguyen", "minh.nguyen@bookworm.dev", 59.98m ));
// 2. Consuming in Notification with Wolverine + IIntegrationEventIdempotencyGuardinternal sealed class PlaceOrderCommandHandler( ISender sender, IIntegrationEventIdempotencyGuard idempotencyGuard){ [WolverineHandler] public async Task Handle(PlaceOrderCommand command, CancellationToken cancellationToken) { await idempotencyGuard.ExecuteAsync( command.Id, nameof(PlaceOrderCommandHandler), async ct => { if (!string.IsNullOrWhiteSpace(command.Email)) { await sender.SendEmailAsync(command, ct); } }, cancellationToken: cancellationToken ); }}1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "PlaceOrderCommand",
4 "type": "object",
5 "additionalProperties": false,
6 "required": ["id", "creationDate", "basketId", "orderId", "totalMoney"],
7 "properties": {
8 "id": { "type": "string", "format": "uuid" },
9 "creationDate": { "type": "string", "format": "date-time" },
10 "basketId": { "type": "string", "format": "uuid" },
11 "orderId": { "type": "string", "format": "uuid" },
12 "fullName": { "type": ["string", "null"] },
13 "email": { "type": ["string", "null"] },
14 "totalMoney": { "type": "number" }
15 }
16}
17