Subscription Payment Due (v0.0.1)

Emitted when a subscription payment is due for collection

Overview

The SubscriptionPaymentDue event is emitted by the Billing Service when a subscription’s billing cycle is due for payment. This event triggers the payment collection process in the Payment domain.

Cross-Domain Communication

This event facilitates communication between:

  • Source: Subscriptions Domain (BillingService)
  • Target: Payment Domain (PaymentService, FraudDetectionService)

Schema

Event Flow

  1. BillingService calculates when payment is due
  2. Emits SubscriptionPaymentDue event
  3. PaymentService receives and initiates payment
  4. FraudDetectionService performs risk assessment
  5. Payment is processed through PaymentGatewayService

Example Payload

{
  "subscriptionId": "sub_ABC123",
  "customerId": "cust_XYZ789",
  "invoiceId": "inv_123456",
  "amount": 49.99,
  "currency": "USD",
  "dueDate": "2024-02-01T00:00:00Z",
  "billingPeriod": {
    "start": "2024-02-01",
    "end": "2024-02-29"
  },
  "planId": "pro-monthly",
  "retryAttempt": 0
}
Event-driven architecture documentation: FlowMart