json icon

Charge Installment Settled

v1.0.0events

The money of a credit card payment reached the school for an installment of a charge it receives: the installment PAID, received in a bank account of the school on the day it was expected, with its charge and the payment. Published by cna-one's settlement routine, one message per installment it settles. No consumer yet.

1{
2  "$schema": "https://json-schema.org/draft/2020-12/schema",
3  "title": "ChargeInstallmentSettled payload",
4  "type": "object",
5  "additionalProperties": false,
6  "properties": {
7    "id": {
8      "type": "string",
9      "description": "Id (UUID) of the installment (financial.charge_installments). Kafka message key."
10    },
11    "franchiseId": {
12      "type": "string",
13      "description": "School (franchise) the installment belongs to."
14    },
15    "chargeId": {
16      "type": "string",
17      "description": "Charge (financial.charges) the installment belongs to."
18    },
19    "chargeCode": {
20      "type": "string",
21      "description": "Code of the charge, unique per school: COB-<year>-<number>, e.g. COB-2026-0012."
22    },
23    "contractId": {
24      "type": ["string", "null"],
25      "description": "Contract (school_ops.contracts) the charge bills, or null for a charge with no contract."
26    },
27    "studentId": {
28      "type": ["string", "null"],
29      "description": "Student (school_ops.students) the charge is for, or null."
30    },
31    "enrollmentId": {
32      "type": ["string", "null"],
33      "description": "Enrollment (module) the installment is owed for. Set only when its charge bills a single item of the contract; null otherwise."
34    },
35    "contractItemId": {
36      "type": ["string", "null"],
37      "description": "Contract line the installment is owed for. Set only when its charge bills a single item of the contract; null otherwise."
38    },
39    "payerPersonId": {
40      "type": "string",
41      "description": "Person (common.persons) who pays the charge. For the charges of a contract, the contract holder."
42    },
43    "revenueType": {
44      "type": "string",
45      "enum": [
46        "ENROLLMENT_FEE",
47        "OTHER_FEE",
48        "LEARNING_BOOK",
49        "TUITION",
50        "TERMINATION_SETTLEMENT",
51        "AD_HOC"
52      ],
53      "description": "Kind of revenue the installment is (cna-one RevenueType)."
54    },
55    "number": {
56      "type": "integer",
57      "description": "Position of the installment in its schedule, from 1."
58    },
59    "totalNumber": {
60      "type": "integer",
61      "description": "How many installments the schedule has."
62    },
63    "dueOn": {
64      "type": "string",
65      "format": "date",
66      "description": "Day the installment is due, YYYY-MM-DD, no time zone."
67    },
68    "originalAmount": {
69      "type": "string",
70      "description": "Decimal as a string with two places: the amount of the installment before discounts, late fee and interest."
71    },
72    "status": {
73      "type": "string",
74      "enum": [
75        "PENDING",
76        "PAID",
77        "PENDING_SETTLEMENT",
78        "UNDER_RENEGOTIATION",
79        "CANCELLED",
80        "REVERSED"
81      ],
82      "description": "Status of the installment after the settlement (cna-one ChargeInstallmentStatus): always PAID."
83    },
84    "expectedSettlementOn": {
85      "type": ["string", "null"],
86      "format": "date",
87      "description": "Day the credit card payment was expected to reach the school and was received on, YYYY-MM-DD. Always set in this event."
88    },
89    "payment": {
90      "type": "object",
91      "additionalProperties": false,
92      "description": "The credit card payment the installment was pending on. It still covers the installment; the settlement does not change it.",
93      "properties": {
94        "id": {
95          "type": "string",
96          "description": "Id (UUID) of the payment (financial.charge_payments). Shared by every installment the payment covers."
97        },
98        "origin": {
99          "type": "string",
100          "enum": ["SCHOOL", "INTEGRATION"],
101          "description": "Who registered the payment, unchanged by the settlement: SCHOOL when an employee registered it; INTEGRATION when it has no author, such as one a payment gateway confirms."
102        },
103        "paymentMethod": {
104          "type": "string",
105          "enum": [
106            "PIX",
107            "BANK_SLIP",
108            "CREDIT_CARD",
109            "DEBIT_CARD",
110            "CASH",
111            "BANK_TRANSFER"
112          ],
113          "description": "How the payer paid (cna-one PaymentMethod). Always CREDIT_CARD in this event: only a credit card payment leaves an installment pending settlement."
114        },
115        "amount": {
116          "type": "string",
117          "description": "Decimal as a string with two places: the total of the payment, which can cover several installments. Not the amount of this installment."
118        },
119        "paidOn": {
120          "type": "string",
121          "format": "date",
122          "description": "Day of the payment at the school, YYYY-MM-DD, no time zone."
123        },
124        "externalReference": {
125          "type": ["string", "null"],
126          "description": "Transaction identifier, as the method requires: the Pix end-to-end id (E2E) or the card NSU. Null otherwise."
127        },
128        "cardInstallments": {
129          "type": ["integer", "null"],
130          "description": "How many card installments the credit card payment has. Always set in this event."
131        },
132        "undoneAt": {
133          "type": ["string", "null"],
134          "format": "date-time",
135          "description": "Instant the payment was undone. Always null in this event."
136        }
137      },
138      "required": ["id", "origin", "paymentMethod", "amount", "paidOn"]
139    }
140  },
141  "required": [
142    "id",
143    "franchiseId",
144    "chargeId",
145    "chargeCode",
146    "payerPersonId",
147    "revenueType",
148    "number",
149    "totalNumber",
150    "dueOn",
151    "originalAmount",
152    "status",
153    "payment"
154  ]
155}
156

Details

Format
JSON Schema
Resource
events
Filename
schema.json

Versions