Skip to content

Payments — event contract

binding spec asyncapi/payments.asyncapi.yaml @ 2.0.0 is the spec of record. It states what must be; implementations converge on it, never the reverse.

Enforced by
  • any change must bump the artifact and service versions (check:version); a silent edit fails CI
  • a breaking change must take a major version (check:compat)
  • Spectral lint, house naming rules included
  • Microcks contract tests hold mocks and implementations to these messages
Version history
VersionFirst releasedService version
2.0.02026-08-273.0.0
1.1.02026-08-242.1.0
1.0.02026-08-232.0.0
0.7.02026-08-231.0.0
Consume it

payments.settled.v2

Emitted once funds have irrevocably settled for an order.

sequenceDiagram
    autonumber
    participant payments as Payments
    participant chan as payments.settled.v2
    participant orders as Orders
    payments-)chan: PaymentSettled
    Note right of chan: com.hungovercoders.payments.settled.v2
    chan--)orders: PaymentSettled

PaymentSettled

Payment settled

Event type com.hungovercoders.payments.settled.v2

Payload (data)

FieldTypeRequiredConstraints
payment_idstring (uuid)required—
order_idstring (uuid)required—
settled_atstring (date-time)required—
amount_penceintegerrequired≥ 0
CloudEvents envelope
FieldTypeRequiredConstraints
specversionstringrequiredalways '1.0'
idstring (uuid)required—
sourcestringrequiredalways '/payments'
typestringrequiredalways 'com.hungovercoders.payments.settled.v2'
subjectstring (uuid)required—
timestring (date-time)required—
datacontenttypestringrequiredalways 'application/json'
Example events (Microcks fixtures)
settled
{
  "specversion": "1.0",
  "id": "cccccccc-3333-4333-8333-cccccccccccc",
  "source": "/payments",
  "type": "com.hungovercoders.payments.settled.v2",
  "subject": "44444444-4444-4444-4444-444444444444",
  "time": "2026-08-23T09:01:30Z",
  "datacontenttype": "application/json",
  "data": {
    "payment_id": "44444444-4444-4444-4444-444444444444",
    "order_id": "11111111-1111-1111-1111-111111111111",
    "settled_at": "2026-08-23T09:01:30Z",
    "amount_pence": 2500
  }
}

Full rendered contract