Recipient Bank Account Replaced
v1.0.0eventsThe vendor confirmed the change of the bank account of a recipient, and the new account became current: the public state of the recipient, the new account masked, since when it is current and the account it replaced. Recorded by cna-pay in its outbox in the transaction of the confirmation. No consumer yet.
1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "RecipientBankAccountReplaced payload",
4 "type": "object",
5 "additionalProperties": false,
6 "properties": {
7 "eventId": {
8 "type": "string",
9 "format": "uuid",
10 "description": "Unique, immutable id of the event (events.Fact), the same in every resend of it. A consumer drops an event whose eventId it already applied."
11 },
12 "objectVersion": {
13 "type": "integer",
14 "minimum": 1,
15 "description": "Version of the recipient after the change the event reports, from 1 (events.Fact). The facts of one change share it, so a consumer applies a fact of the version it holds and drops one older than it."
16 },
17 "id": {
18 "type": "string",
19 "format": "uuid",
20 "description": "Id of the recipient in cna-pay. Kafka message key."
21 },
22 "externalReference": {
23 "type": ["string", "null"],
24 "minLength": 1,
25 "description": "Id of the registry in the master system, which correlates the recipient with it; not unique, since after a change of ownership the old and the new recipient point to the same registry (RN-RCB-130). Always sent; null for a recipient the platform administration created, such as the franchisor."
26 },
27 "role": {
28 "type": "string",
29 "enum": ["SCHOOL", "FRANCHISOR", "CNA_INSTITUTE", "SUPPLIER"],
30 "description": "Role of the recipient in the network (cna-pay recipients.Role). The One creates a SCHOOL or a SUPPLIER, and the platform administration only the FRANCHISOR; no command creates a CNA_INSTITUTE yet (cna-br/cna-pay#262)."
31 },
32 "masterSystem": {
33 "type": "string",
34 "enum": ["CNA_ONE", "CNA_INSTITUTE"],
35 "description": "Client system that owns the registry and receives the facts of the recipient, RN-EVT-155 (cna-pay recipients.MasterSystem): CNA_ONE for a school, a supplier and the franchisor; CNA_INSTITUTE for the CNA Institute, which has no topic yet, so a change of such a recipient fails whole until its topic exists (cna-br/cna-pay#297)."
36 },
37 "registryState": {
38 "type": "string",
39 "enum": ["ACTIVE", "SUSPENDED", "DEREGISTERED", "REFUSED"],
40 "description": "State of the registry after the change (cna-pay lifecycle.RegistryState): ACTIVE, what it may do being in eligibility; REFUSED, the vendor refused its creation and refusalReason says why; SUSPENDED and DEREGISTERED (final) are not produced in this delivery."
41 },
42 "refusalReason": {
43 "type": ["string", "null"],
44 "enum": [
45 "VENDOR_REFUSED_DATA",
46 "VENDOR_REFUSED",
47 "CREATION_RETAKE_EXHAUSTED",
48 null
49 ],
50 "description": "Normalized reason of a REFUSED recipient (cna-pay recipients.RefusalReason): VENDOR_REFUSED_DATA, the vendor refused fields of the creation; VENDOR_REFUSED, it refused it without naming a field; CREATION_RETAKE_EXHAUSTED, the creation got no answer of the vendor until its retakes ran out (not produced yet, cna-br/cna-pay#389). Always sent; null unless registryState is REFUSED."
51 },
52 "verificationStatus": {
53 "type": ["string", "null"],
54 "enum": ["IN_REVIEW", "AWAITING_RECIPIENT", "APPROVED", "REJECTED", null],
55 "description": "Verification (KYC) of the recipient as the vendor reflects it (cna-pay lifecycle.VerificationStatus): IN_REVIEW, AWAITING_RECIPIENT (the vendor waits for the recipient; the pending items stay in the query of the recipient), APPROVED, or REJECTED (final). Always sent; null until the vendor reflects the first result."
56 },
57 "eligibility": {
58 "type": "object",
59 "additionalProperties": false,
60 "description": "What the recipient may do (RN-RCB-150): two answers, each with the reasons that deny it.",
61 "properties": {
62 "canTransact": {
63 "type": "boolean",
64 "description": "Whether the recipient may take new payments, referenced in a new order. True exactly when transactReasons is empty."
65 },
66 "transactReasons": {
67 "type": "array",
68 "items": {
69 "type": "string",
70 "enum": [
71 "REGISTRY_SUSPENDED",
72 "REGISTRY_DEREGISTERED",
73 "REGISTRY_REFUSED",
74 "SUBACCOUNT_CREATING",
75 "SUBACCOUNT_BLOCKED",
76 "VERIFICATION_REJECTED",
77 "VERIFICATION_PENDING",
78 "HELD_BALANCE_CEILING_REACHED",
79 "VERIFICATION_DEADLINE_EXPIRED",
80 "WINDING_DOWN"
81 ]
82 },
83 "description": "Reasons that deny transacting, in their declared order (cna-pay recipients.IneligibilityReason); an empty array, never null, when canTransact is true."
84 },
85 "canWithdraw": {
86 "type": "boolean",
87 "description": "Whether the recipient may move its balance to its bank account. True exactly when withdrawReasons is empty."
88 },
89 "withdrawReasons": {
90 "type": "array",
91 "items": {
92 "type": "string",
93 "enum": [
94 "REGISTRY_SUSPENDED",
95 "REGISTRY_DEREGISTERED",
96 "REGISTRY_REFUSED",
97 "SUBACCOUNT_CREATING",
98 "SUBACCOUNT_BLOCKED",
99 "VERIFICATION_REJECTED",
100 "VERIFICATION_PENDING",
101 "HELD_BALANCE_CEILING_REACHED",
102 "VERIFICATION_DEADLINE_EXPIRED",
103 "WINDING_DOWN"
104 ]
105 },
106 "description": "Reasons that deny withdrawing, in their declared order (cna-pay recipients.IneligibilityReason); an empty array, never null, when canWithdraw is true."
107 }
108 },
109 "required": [
110 "canTransact",
111 "transactReasons",
112 "canWithdraw",
113 "withdrawReasons"
114 ]
115 },
116 "bankAccount": {
117 "type": "object",
118 "additionalProperties": false,
119 "description": "The new current bank account, to which the transfers go from becameCurrentAt. Masked: never the holder (name or document) nor the check digits (cna-pay recipient.BankAccount; RN-RCB-176).",
120 "properties": {
121 "id": {
122 "type": "string",
123 "format": "uuid",
124 "description": "Id of the bank account in cna-pay."
125 },
126 "institution": {
127 "type": "string",
128 "pattern": "^[0-9]{3}$",
129 "description": "Compensation code (COMPE) of the bank or payment institution, 3 digits."
130 },
131 "maskedAgency": {
132 "type": "string",
133 "pattern": "^\\*+[0-9]{0,2}$",
134 "minLength": 1,
135 "maxLength": 5,
136 "description": "Agency (1 to 5 digits) with every digit replaced by * but the last ones: at most 2 and never more than half of them, so a short agency is never shown whole (0002 is **02, 1 is *). Never its check digit."
137 },
138 "maskedAccountNumber": {
139 "type": "string",
140 "pattern": "^\\*+[0-9]{0,4}$",
141 "minLength": 1,
142 "maxLength": 20,
143 "description": "Account number (1 to 20 digits) with every digit replaced by * but the last ones: at most 4 and never more than half of them (1234567 is ****567, 67890 is ***90). Never its check digit."
144 },
145 "type": {
146 "type": "string",
147 "enum": ["CHECKING", "SAVINGS", "PAYMENT"],
148 "description": "Type of the account (cna-pay recipients.AccountType): CHECKING, SAVINGS, or PAYMENT for an account at a payment institution."
149 }
150 },
151 "required": [
152 "id",
153 "institution",
154 "maskedAgency",
155 "maskedAccountNumber",
156 "type"
157 ]
158 },
159 "becameCurrentAt": {
160 "type": "string",
161 "format": "date-time",
162 "description": "When cna-pay recorded the confirmation of the vendor, from which the transfers go to the new account: ISO 8601 in UTC with milliseconds (2026-11-18T12:00:00.000Z)."
163 },
164 "replacedBankAccountId": {
165 "type": "string",
166 "format": "uuid",
167 "description": "Id of the bank account the new one replaced, now REPLACED and kept for the transfers that used it (RN-RCB-170)."
168 }
169 },
170 "required": [
171 "eventId",
172 "objectVersion",
173 "id",
174 "role",
175 "masterSystem",
176 "registryState",
177 "eligibility",
178 "bankAccount",
179 "becameCurrentAt",
180 "replacedBankAccountId"
181 ]
182}
183Details
- Format
- JSON Schema
- Resource
- events
- Filename
- schema.json