invoice-created

Summary

An invoice has been created in Sirius

Context

Supervision Payments needs to know when an invoice is created in order to apply the customer credit balance,
and conditionally create a Direct Debit schedule via the Allpay API.

Trigger

An invoice is created.

Effect

Supervision Payments applies any credit balance to the invoice, and conditionally creates a Direct Debit schedule via the Allpay API.

Examples

{
  "clientId": 1,
  "invoiceId": 2,
  "invoiceType": "B2"
}

Schema

{
  "$id": "https://opg.service.justice.gov.uk/opg.supervision.sirius/client-created.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "opg.supervision.sirius/invoice-created",
  "type": "object",
  "properties": {
    "clientId": {
      "type": "integer",
      "description": "The client's ID"
    },
    "invoiceId": {
      "type": "integer",
      "description": "The invoice ID"
    },
    "invoiceType": {
      "type": "string",
      "description": "The invoice's fee type"
    }
  },
  "required": [
    "clientId",
    "invoiceId",
    "invoiceType"
  ]
}

Event Flow