@eventcatalog/create-eventcatalog 4.3.12 → 4.3.14-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +0 -10
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
  4. package/templates/amazon-api-gateway/README-template.md +4 -0
  5. package/templates/asyncapi/README-template.md +4 -0
  6. package/templates/asyncapi/env +0 -5
  7. package/templates/confluent/README-template.md +4 -0
  8. package/templates/default/README-template.md +4 -0
  9. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/commands/CreateProduct/examples/index.mdx +194 -0
  10. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/commands/DeleteProduct/examples/index.mdx +161 -0
  11. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/commands/UpdateProduct/examples/index.mdx +182 -0
  12. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/events/ProductCreated/examples/index.mdx +227 -0
  13. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/events/ProductDeleted/examples/index.mdx +175 -0
  14. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/events/ProductUpdated/examples/index.mdx +205 -0
  15. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/queries/GetProduct/examples/index.mdx +205 -0
  16. package/templates/default/domains/Catalog/systems/search-system/services/SearchAPI/queries/SearchProducts/examples/index.mdx +369 -0
  17. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/commands/RegisterCustomer/examples/index.mdx +168 -0
  18. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/commands/UpdateCustomer/examples/index.mdx +168 -0
  19. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/events/CustomerRegistered/examples/index.mdx +201 -0
  20. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/events/CustomerUpdated/examples/index.mdx +194 -0
  21. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/queries/GetCustomer/examples/index.mdx +194 -0
  22. package/templates/default/domains/Customer/systems/identity-provider/services/OAuthAPI/commands/AuthenticateCustomer/examples/index.mdx +198 -0
  23. package/templates/default/domains/Customer/systems/identity-provider/services/OAuthAPI/events/CustomerAuthenticated/examples/index.mdx +276 -0
  24. package/templates/default/domains/Fulfilment/systems/carrier/services/CarrierTrackingAPI/events/ShipmentCreated/examples/index.mdx +184 -0
  25. package/templates/default/domains/Fulfilment/systems/carrier/services/CarrierTrackingAPI/events/ShipmentDelivered/examples/index.mdx +173 -0
  26. package/templates/default/domains/Fulfilment/systems/carrier/services/CarrierTrackingAPI/events/ShipmentFailed/examples/index.mdx +265 -0
  27. package/templates/default/domains/Fulfilment/systems/inventory-system/services/InventoryService/commands/ReleaseInventory/examples/index.mdx +246 -0
  28. package/templates/default/domains/Fulfilment/systems/inventory-system/services/InventoryService/events/InventoryReserved/examples/index.mdx +227 -0
  29. package/templates/default/domains/Fulfilment/systems/inventory-system/services/InventoryService/events/InventoryUnavailable/examples/index.mdx +229 -0
  30. package/templates/default/domains/Fulfilment/systems/inventory-system/services/InventoryService/queries/GetStockLevel/examples/index.mdx +186 -0
  31. package/templates/default/domains/Fulfilment/systems/shipping-system/services/CarrierAdapter/commands/CreateShipment/examples/index.mdx +206 -0
  32. package/templates/default/domains/Fulfilment/systems/warehouse-system/services/PickingWorker/events/OrderPacked/examples/index.mdx +172 -0
  33. package/templates/default/domains/Fulfilment/systems/warehouse-system/services/WarehouseService/events/OrderReadyForShipping/examples/index.mdx +208 -0
  34. package/templates/default/domains/Ordering/systems/checkout-system/services/CheckoutOrchestrator/commands/AuthorizePayment/examples/index.mdx +179 -0
  35. package/templates/default/domains/Ordering/systems/checkout-system/services/CheckoutOrchestrator/commands/ReserveInventory/examples/index.mdx +215 -0
  36. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/commands/CancelOrder/examples/index.mdx +163 -0
  37. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/commands/CreateOrder/examples/index.mdx +246 -0
  38. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/events/OrderCancelled/examples/index.mdx +267 -0
  39. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/events/OrderCompleted/examples/index.mdx +171 -0
  40. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/events/OrderCreated/examples/index.mdx +190 -0
  41. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/queries/GetOrder/examples/index.mdx +343 -0
  42. package/templates/default/domains/Payments/systems/fraud-detection/services/FraudAPI/events/FraudCheckFailed/examples/index.mdx +271 -0
  43. package/templates/default/domains/Payments/systems/fraud-detection/services/FraudAPI/events/FraudCheckPassed/examples/index.mdx +173 -0
  44. package/templates/default/domains/Payments/systems/payment-processing-system/services/PaymentWorker/events/PaymentRequested/examples/index.mdx +191 -0
  45. package/templates/default/domains/Payments/systems/payment-processing-system/services/PaymentWorker/events/RefundRequested/examples/index.mdx +194 -0
  46. package/templates/default/domains/Payments/systems/stripe/services/StripeWebhookEndpoint/events/PaymentFailed/examples/index.mdx +265 -0
  47. package/templates/default/domains/Payments/systems/stripe/services/StripeWebhookEndpoint/events/PaymentSucceeded/examples/index.mdx +190 -0
  48. package/templates/default/domains/Payments/systems/stripe/services/StripeWebhookEndpoint/events/RefundProcessed/examples/index.mdx +186 -0
  49. package/templates/default/domains/Reviews/services/RatingAggregator/events/rating-updated/examples/index.mdx +183 -0
  50. package/templates/default/domains/Reviews/services/ReviewAPI/commands/flag-review/examples/index.mdx +183 -0
  51. package/templates/default/domains/Reviews/services/ReviewAPI/commands/submit-review/examples/index.mdx +195 -0
  52. package/templates/default/domains/Reviews/services/ReviewAPI/commands/vote-review-helpful/examples/index.mdx +178 -0
  53. package/templates/default/domains/Reviews/services/ReviewAPI/events/review-flagged/examples/index.mdx +186 -0
  54. package/templates/default/domains/Reviews/services/ReviewAPI/events/review-helpful-voted/examples/index.mdx +177 -0
  55. package/templates/default/domains/Reviews/services/ReviewAPI/events/review-submitted/examples/index.mdx +194 -0
  56. package/templates/default/domains/Reviews/services/ReviewAPI/queries/get-product-reviews/examples/index.mdx +259 -0
  57. package/templates/default/domains/Reviews/services/ReviewModerationWorker/events/review-published/examples/index.mdx +183 -0
  58. package/templates/default/domains/Reviews/services/ReviewModerationWorker/events/review-rejected/examples/index.mdx +178 -0
  59. package/templates/default/domains/Shopping/systems/cart-system/services/CartAPI/commands/AddItemToCart/examples/index.mdx +171 -0
  60. package/templates/default/domains/Shopping/systems/cart-system/services/CartAPI/commands/CheckoutCart/examples/index.mdx +168 -0
  61. package/templates/default/domains/Shopping/systems/cart-system/services/CartAPI/commands/RemoveItemFromCart/examples/index.mdx +170 -0
  62. package/templates/default/domains/Shopping/systems/cart-system/services/CartAPI/events/CartCheckedOut/examples/index.mdx +275 -0
  63. package/templates/default/domains/Shopping/systems/promotion-system/services/PromotionService/commands/CalculateDiscount/examples/index.mdx +207 -0
  64. package/templates/default/domains/Shopping/systems/promotion-system/services/PromotionService/events/DiscountCalculated/examples/index.mdx +190 -0
  65. package/templates/default/env +0 -5
  66. package/templates/empty/README-template.md +4 -0
  67. package/templates/empty/env +0 -5
  68. package/templates/eventbridge/README-template.md +4 -0
  69. package/templates/graphql/README-template.md +4 -0
  70. package/templates/graphql/env +0 -5
  71. package/templates/openapi/README-template.md +4 -0
  72. package/templates/openapi/env +0 -5
@@ -0,0 +1,206 @@
1
+ <Columns cols={2}>
2
+
3
+ <Column>
4
+
5
+ ## 1. Send a next-day shipment for one parcel
6
+
7
+ The Carrier Adapter sends this command once an order is ready for shipping and the customer paid for next-day delivery. The carrier creates the shipment and replies with `ShipmentCreated`.
8
+
9
+ ### Payload details
10
+
11
+ - `orderId` is the packed order being dispatched.
12
+ - `carrier` is `Royal Mail`, the carrier chosen for UK next-day orders.
13
+ - `service` is `NEXT_DAY`, the fastest of the three service levels.
14
+ - `parcelCount` is `1`: two T-shirts and a cap fit in one mailing bag.
15
+ - `destination` is a UK address, so `country` is the two-letter code `GB`.
16
+
17
+ ### Using this example
18
+
19
+ A carrier stub should accept this command and book one next-day parcel to the Manchester address. Use it to check that `service` and `parcelCount` are passed to the carrier unchanged.
20
+
21
+ The examples use a **fictional Acme Events SDK** to send a payload matching the CreateShipment schema. The package names and send methods are illustrative.
22
+
23
+ </Column>
24
+
25
+ <Column>
26
+
27
+ <CodeGroup dropdown>
28
+
29
+ ```typescript send-create-shipment.ts
30
+ import { EventsClient } from '@acme/events';
31
+ import type { CreateShipment } from './schemas/create-shipment';
32
+
33
+ const client = new EventsClient({
34
+ apiKey: process.env.ACME_API_KEY!,
35
+ });
36
+
37
+ const command: CreateShipment = {
38
+ orderId: '3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27',
39
+ carrier: 'Royal Mail',
40
+ service: 'NEXT_DAY',
41
+ parcelCount: 1,
42
+ destination: {
43
+ line1: '14 Victoria Road',
44
+ city: 'Manchester',
45
+ postcode: 'M14 5RT',
46
+ country: 'GB',
47
+ },
48
+ };
49
+
50
+ await client.send('CreateShipment', command);
51
+ ```
52
+
53
+ ```python send_create_shipment.py
54
+ import os
55
+ from acme_events import EventsClient
56
+
57
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
58
+
59
+ command = {
60
+ "orderId": "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27",
61
+ "carrier": "Royal Mail",
62
+ "service": "NEXT_DAY",
63
+ "parcelCount": 1,
64
+ "destination": {
65
+ "line1": "14 Victoria Road",
66
+ "city": "Manchester",
67
+ "postcode": "M14 5RT",
68
+ "country": "GB",
69
+ },
70
+ }
71
+
72
+ client.send("CreateShipment", command)
73
+ ```
74
+
75
+ ```java SendCreateShipment.java
76
+ import com.acme.events.EventsClient;
77
+ import java.util.Map;
78
+
79
+ public class SendCreateShipment {
80
+ public static void main(String[] args) {
81
+ var client = new EventsClient(
82
+ System.getenv("ACME_API_KEY")
83
+ );
84
+
85
+ var command = Map.of(
86
+ "orderId", "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27",
87
+ "carrier", "Royal Mail",
88
+ "service", "NEXT_DAY",
89
+ "parcelCount", 1,
90
+ "destination", Map.of(
91
+ "line1", "14 Victoria Road",
92
+ "city", "Manchester",
93
+ "postcode", "M14 5RT",
94
+ "country", "GB"
95
+ )
96
+ );
97
+
98
+ client.send("CreateShipment", command);
99
+ }
100
+ }
101
+ ```
102
+
103
+ </CodeGroup>
104
+
105
+ </Column>
106
+
107
+ </Columns>
108
+
109
+ ---
110
+
111
+ <Columns cols={2}>
112
+
113
+ <Column>
114
+
115
+ ## 2. Send a shipment with only the required fields
116
+
117
+ This is the smallest valid command: the order and where it is going. It is used when the order has no delivery preference and the Carrier Adapter leaves carrier and service selection to its own configuration.
118
+
119
+ ### Payload details
120
+
121
+ - `orderId` and `destination` are the only required fields.
122
+ - `carrier`, `service` and `parcelCount` are omitted, not set to null.
123
+ - `destination.country` is `IE` for an order going to Dublin.
124
+
125
+ ### Using this example
126
+
127
+ Use this payload to test that the handler accepts a command without the optional fields and does not fail on missing `carrier` or `service`.
128
+
129
+ The examples use a **fictional Acme Events SDK** to send a payload matching the CreateShipment schema. The package names and send methods are illustrative.
130
+
131
+ </Column>
132
+
133
+ <Column>
134
+
135
+ <CodeGroup dropdown>
136
+
137
+ ```typescript send-create-shipment.ts
138
+ import { EventsClient } from '@acme/events';
139
+ import type { CreateShipment } from './schemas/create-shipment';
140
+
141
+ const client = new EventsClient({
142
+ apiKey: process.env.ACME_API_KEY!,
143
+ });
144
+
145
+ const command: CreateShipment = {
146
+ orderId: 'c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53',
147
+ destination: {
148
+ line1: '22 Harcourt Street',
149
+ city: 'Dublin',
150
+ postcode: 'D02 H364',
151
+ country: 'IE',
152
+ },
153
+ };
154
+
155
+ await client.send('CreateShipment', command);
156
+ ```
157
+
158
+ ```python send_create_shipment.py
159
+ import os
160
+ from acme_events import EventsClient
161
+
162
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
163
+
164
+ command = {
165
+ "orderId": "c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53",
166
+ "destination": {
167
+ "line1": "22 Harcourt Street",
168
+ "city": "Dublin",
169
+ "postcode": "D02 H364",
170
+ "country": "IE",
171
+ },
172
+ }
173
+
174
+ client.send("CreateShipment", command)
175
+ ```
176
+
177
+ ```java SendCreateShipment.java
178
+ import com.acme.events.EventsClient;
179
+ import java.util.Map;
180
+
181
+ public class SendCreateShipment {
182
+ public static void main(String[] args) {
183
+ var client = new EventsClient(
184
+ System.getenv("ACME_API_KEY")
185
+ );
186
+
187
+ var command = Map.of(
188
+ "orderId", "c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53",
189
+ "destination", Map.of(
190
+ "line1", "22 Harcourt Street",
191
+ "city", "Dublin",
192
+ "postcode", "D02 H364",
193
+ "country", "IE"
194
+ )
195
+ );
196
+
197
+ client.send("CreateShipment", command);
198
+ }
199
+ }
200
+ ```
201
+
202
+ </CodeGroup>
203
+
204
+ </Column>
205
+
206
+ </Columns>
@@ -0,0 +1,172 @@
1
+ <Columns cols={2}>
2
+
3
+ <Column>
4
+
5
+ ## 1. Publish an order packed from a picking job
6
+
7
+ The Picking Worker publishes this event when every item in a picking job is picked and packed. The Warehouse Service consumes it and publishes `OrderReadyForShipping`.
8
+
9
+ ### Payload details
10
+
11
+ - `orderId` is the order that was packed.
12
+ - `pickingJobId` is the picking job that collected the items from the shelves.
13
+ - `parcelCount` is `1`: two T-shirts and a cap fit in one mailing bag.
14
+ - `packedAt` is the UTC time the parcel was sealed.
15
+
16
+ ### Using this example
17
+
18
+ A Warehouse Service consumer should mark the order as ready and publish `OrderReadyForShipping` with the same `orderId`.
19
+
20
+ The examples use a **fictional Acme Events SDK** to publish a payload matching the OrderPacked schema. The package names and publish methods are illustrative.
21
+
22
+ </Column>
23
+
24
+ <Column>
25
+
26
+ <CodeGroup dropdown>
27
+
28
+ ```typescript publish-order-packed.ts
29
+ import { EventsClient } from '@acme/events';
30
+ import type { OrderPacked } from './schemas/order-packed';
31
+
32
+ const client = new EventsClient({
33
+ apiKey: process.env.ACME_API_KEY!,
34
+ });
35
+
36
+ const event: OrderPacked = {
37
+ orderId: '3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27',
38
+ pickingJobId: 'e8d2a7b4-1c9f-4a6e-b3d5-7f0c2e9a8b61',
39
+ parcelCount: 1,
40
+ packedAt: '2026-09-14T09:42:08Z',
41
+ };
42
+
43
+ await client.publish('OrderPacked', event);
44
+ ```
45
+
46
+ ```python publish_order_packed.py
47
+ import os
48
+ from acme_events import EventsClient
49
+
50
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
51
+
52
+ event = {
53
+ "orderId": "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27",
54
+ "pickingJobId": "e8d2a7b4-1c9f-4a6e-b3d5-7f0c2e9a8b61",
55
+ "parcelCount": 1,
56
+ "packedAt": "2026-09-14T09:42:08Z",
57
+ }
58
+
59
+ client.publish("OrderPacked", event)
60
+ ```
61
+
62
+ ```java PublishOrderPacked.java
63
+ import com.acme.events.EventsClient;
64
+ import java.util.Map;
65
+
66
+ public class PublishOrderPacked {
67
+ public static void main(String[] args) {
68
+ var client = new EventsClient(
69
+ System.getenv("ACME_API_KEY")
70
+ );
71
+
72
+ var event = Map.of(
73
+ "orderId", "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27",
74
+ "pickingJobId", "e8d2a7b4-1c9f-4a6e-b3d5-7f0c2e9a8b61",
75
+ "parcelCount", 1,
76
+ "packedAt", "2026-09-14T09:42:08Z"
77
+ );
78
+
79
+ client.publish("OrderPacked", event);
80
+ }
81
+ }
82
+ ```
83
+
84
+ </CodeGroup>
85
+
86
+ </Column>
87
+
88
+ </Columns>
89
+
90
+ ---
91
+
92
+ <Columns cols={2}>
93
+
94
+ <Column>
95
+
96
+ ## 2. Publish an order packed by hand
97
+
98
+ Some orders are packed at a manual packing bench without a picking job, for example a replacement hoodie. The event then carries only the order and the time.
99
+
100
+ ### Payload details
101
+
102
+ - `orderId` and `packedAt` are the only required fields.
103
+ - `pickingJobId` is omitted because no picking job was used.
104
+ - `parcelCount` is omitted, not set to null.
105
+
106
+ ### Using this example
107
+
108
+ Use this payload to check that the Warehouse Service still marks the order ready when `pickingJobId` and `parcelCount` are missing.
109
+
110
+ The examples use a **fictional Acme Events SDK** to publish a payload matching the OrderPacked schema. The package names and publish methods are illustrative.
111
+
112
+ </Column>
113
+
114
+ <Column>
115
+
116
+ <CodeGroup dropdown>
117
+
118
+ ```typescript publish-order-packed.ts
119
+ import { EventsClient } from '@acme/events';
120
+ import type { OrderPacked } from './schemas/order-packed';
121
+
122
+ const client = new EventsClient({
123
+ apiKey: process.env.ACME_API_KEY!,
124
+ });
125
+
126
+ const event: OrderPacked = {
127
+ orderId: 'c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53',
128
+ packedAt: '2026-09-14T11:17:30Z',
129
+ };
130
+
131
+ await client.publish('OrderPacked', event);
132
+ ```
133
+
134
+ ```python publish_order_packed.py
135
+ import os
136
+ from acme_events import EventsClient
137
+
138
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
139
+
140
+ event = {
141
+ "orderId": "c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53",
142
+ "packedAt": "2026-09-14T11:17:30Z",
143
+ }
144
+
145
+ client.publish("OrderPacked", event)
146
+ ```
147
+
148
+ ```java PublishOrderPacked.java
149
+ import com.acme.events.EventsClient;
150
+ import java.util.Map;
151
+
152
+ public class PublishOrderPacked {
153
+ public static void main(String[] args) {
154
+ var client = new EventsClient(
155
+ System.getenv("ACME_API_KEY")
156
+ );
157
+
158
+ var event = Map.of(
159
+ "orderId", "c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53",
160
+ "packedAt", "2026-09-14T11:17:30Z"
161
+ );
162
+
163
+ client.publish("OrderPacked", event);
164
+ }
165
+ }
166
+ ```
167
+
168
+ </CodeGroup>
169
+
170
+ </Column>
171
+
172
+ </Columns>
@@ -0,0 +1,208 @@
1
+ <Columns cols={2}>
2
+
3
+ <Column>
4
+
5
+ ## 1. Publish a packed single-parcel order
6
+
7
+ The Warehouse Service publishes this event after `OrderPacked` arrives for an order. The Shipping System consumes it and sends `CreateShipment` to the carrier.
8
+
9
+ ### Payload details
10
+
11
+ - `orderId` and `customerId` link the event back to the order and the customer.
12
+ - `parcelCount` is `1`, so the carrier books a single parcel.
13
+ - `shippingAddress` is a UK address with `country` set to `GB`.
14
+ - `readyAt` is the UTC time the order was marked ready, three minutes after packing finished.
15
+
16
+ ### Using this example
17
+
18
+ A Shipping System consumer should turn this event into a `CreateShipment` command with the same `orderId`, parcel count and address.
19
+
20
+ The examples use a **fictional Acme Events SDK** to publish a payload matching the OrderReadyForShipping schema. The package names and publish methods are illustrative.
21
+
22
+ </Column>
23
+
24
+ <Column>
25
+
26
+ <CodeGroup dropdown>
27
+
28
+ ```typescript publish-order-ready-for-shipping.ts
29
+ import { EventsClient } from '@acme/events';
30
+ import type { OrderReadyForShipping } from './schemas/order-ready-for-shipping';
31
+
32
+ const client = new EventsClient({
33
+ apiKey: process.env.ACME_API_KEY!,
34
+ });
35
+
36
+ const event: OrderReadyForShipping = {
37
+ orderId: '3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27',
38
+ customerId: 'a4c9e2f1-6b7d-4c3e-8f5a-2d1b9e7c6a40',
39
+ parcelCount: 1,
40
+ shippingAddress: {
41
+ line1: '14 Victoria Road',
42
+ city: 'Manchester',
43
+ postcode: 'M14 5RT',
44
+ country: 'GB',
45
+ },
46
+ readyAt: '2026-09-14T09:45:12Z',
47
+ };
48
+
49
+ await client.publish('OrderReadyForShipping', event);
50
+ ```
51
+
52
+ ```python publish_order_ready_for_shipping.py
53
+ import os
54
+ from acme_events import EventsClient
55
+
56
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
57
+
58
+ event = {
59
+ "orderId": "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27",
60
+ "customerId": "a4c9e2f1-6b7d-4c3e-8f5a-2d1b9e7c6a40",
61
+ "parcelCount": 1,
62
+ "shippingAddress": {
63
+ "line1": "14 Victoria Road",
64
+ "city": "Manchester",
65
+ "postcode": "M14 5RT",
66
+ "country": "GB",
67
+ },
68
+ "readyAt": "2026-09-14T09:45:12Z",
69
+ }
70
+
71
+ client.publish("OrderReadyForShipping", event)
72
+ ```
73
+
74
+ ```java PublishOrderReadyForShipping.java
75
+ import com.acme.events.EventsClient;
76
+ import java.util.Map;
77
+
78
+ public class PublishOrderReadyForShipping {
79
+ public static void main(String[] args) {
80
+ var client = new EventsClient(
81
+ System.getenv("ACME_API_KEY")
82
+ );
83
+
84
+ var event = Map.of(
85
+ "orderId", "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b27",
86
+ "customerId", "a4c9e2f1-6b7d-4c3e-8f5a-2d1b9e7c6a40",
87
+ "parcelCount", 1,
88
+ "shippingAddress", Map.of(
89
+ "line1", "14 Victoria Road",
90
+ "city", "Manchester",
91
+ "postcode", "M14 5RT",
92
+ "country", "GB"
93
+ ),
94
+ "readyAt", "2026-09-14T09:45:12Z"
95
+ );
96
+
97
+ client.publish("OrderReadyForShipping", event);
98
+ }
99
+ }
100
+ ```
101
+
102
+ </CodeGroup>
103
+
104
+ </Column>
105
+
106
+ </Columns>
107
+
108
+ ---
109
+
110
+ <Columns cols={2}>
111
+
112
+ <Column>
113
+
114
+ ## 2. Publish with only the required fields
115
+
116
+ The Warehouse Service may not have the customer or parcel details to hand, for example when an order was packed by hand. The event then carries only the order, the address and the time.
117
+
118
+ ### Payload details
119
+
120
+ - `orderId`, `shippingAddress` and `readyAt` are the only required fields.
121
+ - `customerId` and `parcelCount` are omitted, not set to null.
122
+ - `shippingAddress.country` is `IE` for an order going to Dublin.
123
+
124
+ ### Using this example
125
+
126
+ Use this payload to check that consumers handle a missing `parcelCount` and `customerId` without failing.
127
+
128
+ The examples use a **fictional Acme Events SDK** to publish a payload matching the OrderReadyForShipping schema. The package names and publish methods are illustrative.
129
+
130
+ </Column>
131
+
132
+ <Column>
133
+
134
+ <CodeGroup dropdown>
135
+
136
+ ```typescript publish-order-ready-for-shipping.ts
137
+ import { EventsClient } from '@acme/events';
138
+ import type { OrderReadyForShipping } from './schemas/order-ready-for-shipping';
139
+
140
+ const client = new EventsClient({
141
+ apiKey: process.env.ACME_API_KEY!,
142
+ });
143
+
144
+ const event: OrderReadyForShipping = {
145
+ orderId: 'c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53',
146
+ shippingAddress: {
147
+ line1: '22 Harcourt Street',
148
+ city: 'Dublin',
149
+ postcode: 'D02 H364',
150
+ country: 'IE',
151
+ },
152
+ readyAt: '2026-09-14T11:20:03Z',
153
+ };
154
+
155
+ await client.publish('OrderReadyForShipping', event);
156
+ ```
157
+
158
+ ```python publish_order_ready_for_shipping.py
159
+ import os
160
+ from acme_events import EventsClient
161
+
162
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
163
+
164
+ event = {
165
+ "orderId": "c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53",
166
+ "shippingAddress": {
167
+ "line1": "22 Harcourt Street",
168
+ "city": "Dublin",
169
+ "postcode": "D02 H364",
170
+ "country": "IE",
171
+ },
172
+ "readyAt": "2026-09-14T11:20:03Z",
173
+ }
174
+
175
+ client.publish("OrderReadyForShipping", event)
176
+ ```
177
+
178
+ ```java PublishOrderReadyForShipping.java
179
+ import com.acme.events.EventsClient;
180
+ import java.util.Map;
181
+
182
+ public class PublishOrderReadyForShipping {
183
+ public static void main(String[] args) {
184
+ var client = new EventsClient(
185
+ System.getenv("ACME_API_KEY")
186
+ );
187
+
188
+ var event = Map.of(
189
+ "orderId", "c7e41d92-5b3a-4f86-a1d4-8e2f9b6c0d53",
190
+ "shippingAddress", Map.of(
191
+ "line1", "22 Harcourt Street",
192
+ "city", "Dublin",
193
+ "postcode", "D02 H364",
194
+ "country", "IE"
195
+ ),
196
+ "readyAt", "2026-09-14T11:20:03Z"
197
+ );
198
+
199
+ client.publish("OrderReadyForShipping", event);
200
+ }
201
+ }
202
+ ```
203
+
204
+ </CodeGroup>
205
+
206
+ </Column>
207
+
208
+ </Columns>