Payment Processed

Emitted when a payment has been successfully processed and funds have been captured

Overview

The PaymentProcessed event signals that a payment transaction has completed successfully. The funds have been authorized and captured from the customer’s payment method.

When is this event emitted?

This event is published after:

  1. Payment authorization is successful
  2. Payment capture is completed
  3. Transaction is recorded in the payment system
  4. All validation checks pass

Event Schema

Schema Definition

{
"eventId": "uuid",
"eventType": "PaymentProcessed",
"timestamp": "2025-12-11T10:30:00Z",
"version": "1.0.0",
"data": {
"paymentId": "string",
"transactionId": "string",
"customerId": "string",
"amount": {
"value": "number",
"currency": "string"
},
"paymentMethod": {
"type": "string",
"last4": "string"
},
"invoiceId": "string (optional)",
"gatewayReference": "string",
"processedAt": "timestamp",
"metadata": {
"orderId": "string (optional)",
"description": "string"
}
}
}

Example Payload

{
"eventId": "e7f8a9b0-c1d2-3e4f-5a6b-7c8d9e0f1a2b",
"eventType": "PaymentProcessed",
"timestamp": "2025-12-11T10:30:00Z",
"version": "1.0.0",
"data": {
"paymentId": "pay_1234567890",
"transactionId": "txn_abcdef123456",
"customerId": "cus_johndoe",
"amount": {
"value": 99.99,
"currency": "USD"
},
"paymentMethod": {
"type": "credit_card",
"last4": "4242"
},
"invoiceId": "INV-2025-000123",
"gatewayReference": "ch_stripe_abc123",
"processedAt": "2025-12-11T10:30:00Z",
"metadata": {
"orderId": "ORD-12345",
"description": "Payment for Order #12345"
}
}
}

Downstream Actions

When this event is consumed:

  • Ledger Service: Creates journal entries (debit Cash, credit Accounts Receivable)
  • Invoice Service: Updates invoice status to “Paid” or “Partially Paid”
  • Analytics Service: Updates payment metrics and revenue reports
  • Notification Service: Sends payment confirmation to customer

Business Rules

  • Event must be published within 5 seconds of payment completion
  • Event is immutable once published
  • Idempotency key ensures no duplicate events
  • Includes audit trail information for compliance
20 properties
eventIdstring<uuid>
required

Unique identifier for this event

eventTypestringconstant: PaymentProcessed
required
timestampstring<date-time>
required

When the event occurred

versionstring
required

Event schema version

Match pattern: ^\d+\.\d+\.\d+$
dataobject
required