Contract standards
The rules Acme teams follow when defining, versioning and changing commands, events and queries.
Commands, events and queries are the public language between Acme systems. A contract is not ready until it is understandable by a team that does not own the implementation.
Contract types
| Type | Meaning | Example |
|---|---|---|
| Command | A request for an owner to do work. | Reserve InventoryCommandv1.0.0Reserve InventoryCommand to reserve stock for the items in a checked-out cart. Ownerordering-platformSchemaDiagramOpen docs, Authorize PaymentCommandv1.0.0Authorize PaymentCommand to authorize payment for the total of a checked-out cart. Ownerordering-platformSchemaDiagramOpen docs, Create OrderCommandv1.0.0Create OrderCommand to create a new order from a checked-out cart. Ownerordering-platformSchemaDiagramOpen docs |
| Event | A fact that already happened. | Order CreatedEventv1.0.0Order CreatedPublished when a new order has been created. Ownerordering-platformSchemaDiagramOpen docs, Payment SucceededEventv1.0.0Payment SucceededPublished by Stripe when a charge succeeds. Ownerpayments-platformSchemaDiagramOpen docs, Inventory ReservedEventv1.0.0Inventory ReservedPublished when stock has been successfully reserved for an order. Ownerfulfilment-platformSchemaDiagramOpen docs |
| Query | A read contract owned by one capability. | Get OrderQueryv1.0.0Get OrderQuery to fetch a single order by its identifier. Ownerordering-platformSchemaDiagramOpen docs, Search ProductsQueryv1.0.0Search ProductsQuery to search the catalog for products matching a term, with optional filters and pagination. Ownersearch-platformSchemaDiagramOpen docs, Get Product ReviewsQueryv1.0.0Get Product ReviewsQuery to fetch the published reviews and aggregate rating for a product. Ownerreviews-platformSchemaDiagramOpen docs |
Required fields
Every contract page should document:
- business purpose,
- producer or handler,
- consumers where known,
- schema or payload reference,
- version and compatibility policy,
- failure semantics for commands and queries,
- replay and ordering assumptions for events.
Versioning rules
Additive fields are allowed when consumers can ignore them. Removing fields, changing meaning, tightening validation or changing delivery semantics is breaking and requires a new version or a migration plan.
Use deprecation before removal. Keep the old contract documented until all consumers have moved.
Review checklist
Before changing a contract, teams must identify all known consumers, confirm whether the change is additive or breaking, update flow pages that depend on the contract, and add an ADR when the change introduces a new integration pattern.
Review a proposed command, event or query contract change for Acme Inc. Decide whether it is additive or breaking, list
known consumer risks, identify missing schema or payload details, and suggest a migration plan if the change is not
backward compatible. Include the catalog pages that need updates.Review a proposed command, event or query contract change for Acme Inc. Decide whether it is additive or breaking, list known consumer risks, identify missing schema or payload details, and suggest a migration plan if the change is not backward compatible. Include the catalog pages that need updates.