blob: af940dec52c32d26b23134652f488d09a7a06bc2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
Nexus API
###########
HTTP API
========
Authentication
--------------
**Every** request made to nexus must be authenticated
using the *HTTP basic auth* mechanism.
Users Management
----------------
.. http:post:: <nexus>/users
Create a new user. Only the super-user can call this API.
**Request:**
The body is a `User` object.
**Response:**
:status 409 Conflict: Username is not available.
**Details:**
.. ts:def:: User
interface User {
// User name
username: string;
// Shadow password
shadowPassword: string;
}
Bank Account Management
-----------------------
.. http:get:: <nexus>/bank-accounts
**Response:**
A list of `BankAccount` objects
that belong to the requester.
.. ts:def:: BankAccount
interface BankAccount {
// mnemonic name identifying this bank account.
account: string;
// IBAN
iban: string;
// BIC
bic: string;
// Legal subject owning the account.
holder: string;
}
.. http:post:: <nexus>/bank-accounts/<my-acct>/submit-payment
Ask nexus to submit one prepare payment at the bank.
**Request:**
.. ts:def:: SubmitPayment
interface SubmitPayment {
// Unique identifier of the (previously) prepared payment
// to submit at the bank.
uuid: string;
// Optional field to specify the bank transport to use
// for the submission.
transport: string;
}
:status 404 Not Found: the unique identifier **or**
the bank transport could not be found in the system
.. http:get:: <nexus>/bank-accounts/<my-acct>/prepared-payment/$uuid
Ask the status of payment ``$uuid``.
**Response:**
.. ts:def:: PaymentStatus
interface PaymentStatus {
// Payment unique identifier
uuid: string;
// True for submitted payments
submitted: boolean;
// Creditor IBAN
creditorIban: string;
// Creditor BIC
creditorBic: string;
// Creditor legal name
creditorName: string;
// Amount
amount: string;
// Date of submission (in dashed form YYYY-MM-DD)
submissionDate: string;
// Date of preparation (in dashed form YYYY-MM-DD)
preparationDate: string;
}
.. http:post:: <nexus>/bank-accounts/<my-acct>/prepare-payment
Ask nexus to prepare instructions for a new payment.
Note that ``my-acct`` is the bank account that will be
**debited** after this operation.
**Request:**
.. ts:def:: PreparedPaymentRequest
interface PreparedPayment {
// IBAN that will receive the payment.
iban: string;
// BIC hosting the IBAN.
bic: string;
// Legal subject that will receive the payment.
name: string;
// amount, in the format CURRENCY:XX.YY
amount: string
}
**Response:**
.. ts:def:: PreparedPaymentResponse
interface PreparedPaymentResponse {
// Opaque identifier to be communicated when
// the user wants to submit the payment to the
// bank.
uuid: string;
}
.. http:post:: <nexus>/bank-accounts/<my-acct>/collect-transactions
Ask the default transport to download the latest transactions
related to ``my-acct`` and store them locally.
**Request:**
.. ts:def:: CollectTransactions
interface CollectTransactions {
// Optional field to specify the bank transport to
// use for such operation.
bankTransport: string;
// dashed date (YYYY-MM-DD) of the earliest payment
// in the result. Optional, defaults to "earliest
// possible" date.
start: string;
// dashed date (YYYY-MM-DD) of the earliest payment
// in the result. Optional, defaults to "latest
// possible" date.
end: string;
}
.. http:post:: <nexus>/collected-transactions
Shows which transactions are stored locally at nexus.
**Request:**
.. ts:def:: TimeRange
interface TimeRange {
// start date of desired payments. Optional,
// defaults to "earliest possible" date.
start: string;
// end date of desired payments. Optional,
// defaults to "latest possible" date.
end: string;
}
**Response:** A list of `Transaction` objects.
.. ts:def:: Transaction
interface Transaction {
// local bank account involved in the transaction.
account: string;
// counterpart IBAN
counterpartIban: string;
// counterpart BIC
counterpartBic: string;
// counterpart holder name
counterpartName: string;
// amount, in the format [-]CURRENCY:XX.YY,
// where the minus sign as prefix indicates
// a debit for the user's bank account.
amount: string
}
Bank Transports
---------------
Bank transports connect the local LibEuFin bank account
to the real bank.
.. http:post:: <nexus>/bank-transports
Activate a new bank transport for the requesting user.
**Request:**
Object of the type `BankTransport`
**Response:**
:status 409 Conflict: The ``name`` field exists already for
the requesting user.
**Details:**
.. ts:def:: BankTransport
interface BankTransport {
// Mnemonic identifier for the transport bein created.
name: string;
// Optional field to restore a previous transport.
backup: TransportBackup;
// Type of the transport (ebics, fints, native, ..)
type: string;
}
.. ts:def:: TransportBackup
interface TransportBackup {
// The information needed in this type depend entirely
// on which transport is being restored.
}
.. http:post:: <nexus>/bank-transports/<transport-name>/sendMSG.
Perform the ``MSG`` operation offered by ``transport-name``
**without** affecting the nexus database.
**Response:**
:status 404 Not Found: ``transport-name`` doesn't exist for
the requesting user.
.. http:post:: <nexus>/bank-transports/<transport-name>/syncMSG.
Some transports **do** have operations that aren't semantically
related to a bank account but need to be stored locally at the nexus.
One typical example is the downloading of the bank's keys vie the
EBICS transport. This API lets the user perform the ``MSG``
operation that should result in new data being stored locally
at the nexus.
**Response:**
:status 404 Not Found: ``transport-name`` doesn't exist for
the requesting user.
|