· 6 years ago · May 01, 2020, 04:02 PM
1{
2 "openapi" : "3.0.0",
3 "info" : {
4 "title" : "De Inhollandsche Bank API",
5 "description" : "The bank api made by Team 1 for project Code Generation (NL)",
6 "contact" : {
7 "email" : "623179@student.inholland.nl"
8 },
9 "license" : {
10 "name" : "Apache 2.0",
11 "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
12 },
13 "version" : "1.0.0"
14 },
15 "servers" : [ {
16 "url" : "https://virtserver.swaggerhub.com/bchm/metttim/1.0.0",
17 "description" : "SwaggerHub API Auto Mocking"
18 } ],
19 "tags" : [ {
20 "name" : "Accounts",
21 "description" : "the accounts API"
22 }, {
23 "name" : "Transactions",
24 "description" : "the transactions API"
25 }, {
26 "name" : "Users",
27 "description" : "the users API"
28 } ],
29 "paths" : {
30 "/accounts" : {
31 "get" : {
32 "tags" : [ "Accounts" ],
33 "summary" : "Get a list of all bank accounts",
34 "description" : "Employee method: returns all bank accounts in the database",
35 "operationId" : "getAccounts",
36 "parameters" : [ {
37 "name" : "userId",
38 "in" : "query",
39 "description" : "get Accounts from a specific user",
40 "required" : false,
41 "style" : "form",
42 "explode" : true,
43 "schema" : {
44 "type" : "number",
45 "example" : 1
46 }
47 }, {
48 "name" : "firstName",
49 "in" : "query",
50 "description" : "filter by the given first name",
51 "required" : false,
52 "style" : "form",
53 "explode" : true,
54 "schema" : {
55 "type" : "string",
56 "example" : "John"
57 }
58 }, {
59 "name" : "lastName",
60 "in" : "query",
61 "description" : "filter by the given last name",
62 "required" : false,
63 "style" : "form",
64 "explode" : true,
65 "schema" : {
66 "type" : "string",
67 "example" : "Doe"
68 }
69 }, {
70 "name" : "preposition",
71 "in" : "query",
72 "description" : "filter by the given preposition",
73 "required" : false,
74 "style" : "form",
75 "explode" : true,
76 "schema" : {
77 "type" : "string",
78 "example" : "van der"
79 }
80 }, {
81 "name" : "offset",
82 "in" : "query",
83 "description" : "The number of items to skip before starting to collect the result set",
84 "required" : false,
85 "style" : "form",
86 "explode" : true,
87 "schema" : {
88 "type" : "integer",
89 "example" : 10
90 }
91 }, {
92 "name" : "limit",
93 "in" : "query",
94 "description" : "The numbers of items to return",
95 "required" : false,
96 "style" : "form",
97 "explode" : true,
98 "schema" : {
99 "type" : "integer",
100 "example" : 20
101 }
102 } ],
103 "responses" : {
104 "200" : {
105 "description" : "Array of all bank accounts",
106 "content" : {
107 "application/json" : {
108 "schema" : {
109 "type" : "array",
110 "items" : {
111 "$ref" : "#/components/schemas/AccountShort"
112 }
113 }
114 }
115 }
116 },
117 "400" : {
118 "description" : "Invalid input given"
119 },
120 "401" : {
121 "description" : "Unauthorized action attempted"
122 },
123 "403" : {
124 "description" : "Forbidden"
125 },
126 "404" : {
127 "description" : "Requested object not found"
128 }
129 },
130 "security" : [ {
131 "api_key_employee" : [ ]
132 } ]
133 },
134 "post" : {
135 "tags" : [ "Accounts" ],
136 "summary" : "Create a new bank account",
137 "description" : "Employee method: creates a new bank account",
138 "operationId" : "createAccount",
139 "requestBody" : {
140 "description" : "Account date",
141 "content" : {
142 "application/json" : {
143 "schema" : {
144 "$ref" : "#/components/schemas/AccountShort"
145 }
146 }
147 },
148 "required" : true
149 },
150 "responses" : {
151 "200" : {
152 "description" : "Call succeeded"
153 },
154 "201" : {
155 "description" : "created {object}"
156 },
157 "400" : {
158 "description" : "Invalid input given"
159 },
160 "401" : {
161 "description" : "Unauthorized action attempted"
162 },
163 "403" : {
164 "description" : "Forbidden"
165 },
166 "404" : {
167 "description" : "Requested object not found"
168 },
169 "415" : {
170 "description" : "Only json input is accepted"
171 }
172 },
173 "security" : [ {
174 "api_key_employee" : [ ]
175 } ]
176 }
177 },
178 "/accounts/{user_id}" : {
179 "get" : {
180 "tags" : [ "Accounts" ],
181 "summary" : "Get accounts by user id",
182 "description" : "Employee Method (except if customer is logged in and requests his own id): returns the bank accounts associated with the given user id.",
183 "operationId" : "getAccountsById",
184 "parameters" : [ {
185 "name" : "user_id",
186 "in" : "path",
187 "description" : "Numeric ID of the desired user",
188 "required" : true,
189 "style" : "simple",
190 "explode" : false,
191 "schema" : {
192 "type" : "integer",
193 "format" : "int64"
194 }
195 } ],
196 "responses" : {
197 "200" : {
198 "description" : "Array of all bank accounts",
199 "content" : {
200 "application/json" : {
201 "schema" : {
202 "type" : "array",
203 "items" : {
204 "$ref" : "#/components/schemas/AccountShort"
205 }
206 }
207 }
208 }
209 },
210 "400" : {
211 "description" : "Invalid input given"
212 },
213 "401" : {
214 "description" : "Unauthorized action attempted"
215 },
216 "403" : {
217 "description" : "Forbidden"
218 },
219 "404" : {
220 "description" : "Requested object not found"
221 }
222 },
223 "security" : [ {
224 "api_key_employee" : [ ]
225 }, {
226 "api_key_customer" : [ ]
227 } ]
228 }
229 },
230 "/accounts/{account_number}" : {
231 "get" : {
232 "tags" : [ "Accounts" ],
233 "summary" : "Get the specified account",
234 "description" : "Employee Method (except if customer is logged in and requests his own bank account): returns the specific bank account.",
235 "operationId" : "getAccount",
236 "parameters" : [ {
237 "name" : "account_number",
238 "in" : "path",
239 "description" : "IBAN of the account",
240 "required" : true,
241 "style" : "simple",
242 "explode" : false,
243 "schema" : {
244 "type" : "string"
245 }
246 } ],
247 "responses" : {
248 "200" : {
249 "description" : "Return the specified bank account",
250 "content" : {
251 "application/json" : {
252 "schema" : {
253 "$ref" : "#/components/schemas/Account"
254 }
255 }
256 }
257 },
258 "400" : {
259 "description" : "Invalid input given"
260 },
261 "401" : {
262 "description" : "Unauthorized action attempted"
263 },
264 "403" : {
265 "description" : "Forbidden"
266 },
267 "404" : {
268 "description" : "Requested object not found"
269 }
270 },
271 "security" : [ {
272 "api_key_employee" : [ ]
273 }, {
274 "api_key_customer" : [ ]
275 } ]
276 },
277 "put" : {
278 "tags" : [ "Accounts" ],
279 "summary" : "Replace the specified account",
280 "description" : "Employee Method: replace the specified account with the account given in this request body",
281 "operationId" : "replaceAccount",
282 "parameters" : [ {
283 "name" : "account_number",
284 "in" : "path",
285 "description" : "IBAN of the account",
286 "required" : true,
287 "style" : "simple",
288 "explode" : false,
289 "schema" : {
290 "type" : "string"
291 }
292 } ],
293 "requestBody" : {
294 "description" : "Account object",
295 "content" : {
296 "application/json" : {
297 "schema" : {
298 "$ref" : "#/components/schemas/AccountShort"
299 }
300 }
301 },
302 "required" : true
303 },
304 "responses" : {
305 "200" : {
306 "description" : "Call succeeded"
307 },
308 "201" : {
309 "description" : "created {object}"
310 },
311 "400" : {
312 "description" : "Invalid input given"
313 },
314 "401" : {
315 "description" : "Unauthorized action attempted"
316 },
317 "403" : {
318 "description" : "Forbidden"
319 },
320 "404" : {
321 "description" : "Requested object not found"
322 },
323 "415" : {
324 "description" : "Only json input is accepted"
325 }
326 },
327 "security" : [ {
328 "api_key_employee" : [ ]
329 } ]
330 },
331 "delete" : {
332 "tags" : [ "Accounts" ],
333 "summary" : "Delete the specified account",
334 "description" : "Employee Method: deletes the account with the specified IBAN.",
335 "operationId" : "deleteAccount",
336 "parameters" : [ {
337 "name" : "account_number",
338 "in" : "path",
339 "description" : "IBAN of the account",
340 "required" : true,
341 "style" : "simple",
342 "explode" : false,
343 "schema" : {
344 "type" : "string"
345 }
346 } ],
347 "responses" : {
348 "200" : {
349 "description" : "Call succeeded"
350 },
351 "204" : {
352 "description" : "No Content"
353 },
354 "400" : {
355 "description" : "Invalid input given"
356 },
357 "401" : {
358 "description" : "Unauthorized action attempted"
359 },
360 "403" : {
361 "description" : "Forbidden"
362 },
363 "404" : {
364 "description" : "Requested object not found"
365 }
366 },
367 "security" : [ {
368 "api_key_employee" : [ ]
369 } ]
370 }
371 },
372 "/transactions" : {
373 "get" : {
374 "tags" : [ "Transactions" ],
375 "summary" : "Get all transactions",
376 "description" : "Employee method: This method returns all transaction objects",
377 "operationId" : "getTransactions",
378 "parameters" : [ {
379 "name" : "startDate",
380 "in" : "query",
381 "description" : "Get all transactions starting from this date",
382 "required" : false,
383 "style" : "form",
384 "explode" : true,
385 "schema" : {
386 "type" : "string",
387 "format" : "date",
388 "example" : "2019-08-30"
389 }
390 }, {
391 "name" : "endDate",
392 "in" : "query",
393 "description" : "Get all transactions up until this date",
394 "required" : false,
395 "style" : "form",
396 "explode" : true,
397 "schema" : {
398 "type" : "string",
399 "format" : "date",
400 "example" : "2020-01-25"
401 }
402 }, {
403 "name" : "firstName",
404 "in" : "query",
405 "description" : "filter by the given first name",
406 "required" : false,
407 "style" : "form",
408 "explode" : true,
409 "schema" : {
410 "type" : "string",
411 "example" : "John"
412 }
413 }, {
414 "name" : "lastName",
415 "in" : "query",
416 "description" : "filter by the given last name",
417 "required" : false,
418 "style" : "form",
419 "explode" : true,
420 "schema" : {
421 "type" : "string",
422 "example" : "Doe"
423 }
424 }, {
425 "name" : "preposition",
426 "in" : "query",
427 "description" : "filter by the given preposition",
428 "required" : false,
429 "style" : "form",
430 "explode" : true,
431 "schema" : {
432 "type" : "string",
433 "example" : "van der"
434 }
435 }, {
436 "name" : "offset",
437 "in" : "query",
438 "description" : "The number of items to skip before starting to collect the result set",
439 "required" : false,
440 "style" : "form",
441 "explode" : true,
442 "schema" : {
443 "type" : "integer",
444 "example" : 10
445 }
446 }, {
447 "name" : "limit",
448 "in" : "query",
449 "description" : "The numbers of items to return",
450 "required" : false,
451 "style" : "form",
452 "explode" : true,
453 "schema" : {
454 "type" : "integer",
455 "example" : 20
456 }
457 } ],
458 "responses" : {
459 "200" : {
460 "description" : "Array of transactions",
461 "content" : {
462 "application/json" : {
463 "schema" : {
464 "type" : "array",
465 "items" : {
466 "$ref" : "#/components/schemas/Transaction"
467 }
468 }
469 }
470 }
471 },
472 "400" : {
473 "description" : "Invalid input given"
474 },
475 "401" : {
476 "description" : "Unauthorized action attempted"
477 },
478 "403" : {
479 "description" : "Forbidden"
480 },
481 "404" : {
482 "description" : "Requested object not found"
483 }
484 },
485 "security" : [ {
486 "api_key_employee" : [ ]
487 }, {
488 "api_key_customer" : [ ]
489 } ]
490 },
491 "post" : {
492 "tags" : [ "Transactions" ],
493 "summary" : "Transfer money between two accounts",
494 "description" : "This method transfers money between two accounts. Depositing and Withrawing are done through the bank's own account. Depositing means the bank will be the AccountFrom. Withdrawing means the bank will be the AccountTo.",
495 "operationId" : "transfer",
496 "requestBody" : {
497 "description" : "Transaction details",
498 "content" : {
499 "application/json" : {
500 "schema" : {
501 "$ref" : "#/components/schemas/TransactionRequest"
502 }
503 }
504 },
505 "required" : true
506 },
507 "responses" : {
508 "200" : {
509 "description" : "Call succeeded"
510 },
511 "201" : {
512 "description" : "created {object}"
513 },
514 "400" : {
515 "description" : "Invalid input given"
516 },
517 "401" : {
518 "description" : "Unauthorized action attempted"
519 },
520 "403" : {
521 "description" : "Forbidden"
522 },
523 "404" : {
524 "description" : "Requested object not found"
525 },
526 "415" : {
527 "description" : "Only json input is accepted"
528 },
529 "422" : {
530 "description" : "Cannot transfer money to the same account"
531 }
532 },
533 "security" : [ {
534 "api_key_employee" : [ ]
535 }, {
536 "api_key_customer" : [ ]
537 } ]
538 }
539 },
540 "/transactions/{user_id}" : {
541 "get" : {
542 "tags" : [ "Transactions" ],
543 "summary" : "Get the transactions for the specified user",
544 "description" : "Employee Method (except if customer is logged in and requests own id): returns all transactions that involve the given userId.",
545 "operationId" : "getTransactionsByUser",
546 "parameters" : [ {
547 "name" : "user_id",
548 "in" : "path",
549 "description" : "Numeric ID of the desired user",
550 "required" : true,
551 "style" : "simple",
552 "explode" : false,
553 "schema" : {
554 "type" : "integer",
555 "format" : "int64"
556 }
557 }, {
558 "name" : "IBAN",
559 "in" : "query",
560 "description" : "Get all transactions from specific bank account",
561 "required" : false,
562 "style" : "form",
563 "explode" : true,
564 "schema" : {
565 "type" : "string",
566 "example" : "NL02INHO0123456789"
567 }
568 }, {
569 "name" : "startDate",
570 "in" : "query",
571 "description" : "Get all transactions starting from this date",
572 "required" : false,
573 "style" : "form",
574 "explode" : true,
575 "schema" : {
576 "type" : "string",
577 "format" : "date",
578 "example" : "2019-08-30"
579 }
580 }, {
581 "name" : "endDate",
582 "in" : "query",
583 "description" : "Get all transactions up until this date",
584 "required" : false,
585 "style" : "form",
586 "explode" : true,
587 "schema" : {
588 "type" : "string",
589 "format" : "date",
590 "example" : "2020-01-25"
591 }
592 }, {
593 "name" : "firstName",
594 "in" : "query",
595 "description" : "filter by the given first name",
596 "required" : false,
597 "style" : "form",
598 "explode" : true,
599 "schema" : {
600 "type" : "string",
601 "example" : "John"
602 }
603 }, {
604 "name" : "lastName",
605 "in" : "query",
606 "description" : "filter by the given last name",
607 "required" : false,
608 "style" : "form",
609 "explode" : true,
610 "schema" : {
611 "type" : "string",
612 "example" : "Doe"
613 }
614 }, {
615 "name" : "preposition",
616 "in" : "query",
617 "description" : "filter by the given preposition",
618 "required" : false,
619 "style" : "form",
620 "explode" : true,
621 "schema" : {
622 "type" : "string",
623 "example" : "van der"
624 }
625 }, {
626 "name" : "offset",
627 "in" : "query",
628 "description" : "The number of items to skip before starting to collect the result set",
629 "required" : false,
630 "style" : "form",
631 "explode" : true,
632 "schema" : {
633 "type" : "integer",
634 "example" : 10
635 }
636 }, {
637 "name" : "limit",
638 "in" : "query",
639 "description" : "The numbers of items to return",
640 "required" : false,
641 "style" : "form",
642 "explode" : true,
643 "schema" : {
644 "type" : "integer",
645 "example" : 20
646 }
647 } ],
648 "responses" : {
649 "200" : {
650 "description" : "Array of transactions",
651 "content" : {
652 "application/json" : {
653 "schema" : {
654 "type" : "array",
655 "items" : {
656 "$ref" : "#/components/schemas/Transaction"
657 }
658 }
659 }
660 }
661 },
662 "400" : {
663 "description" : "Invalid input given"
664 },
665 "401" : {
666 "description" : "Unauthorized action attempted"
667 },
668 "403" : {
669 "description" : "Forbidden"
670 },
671 "404" : {
672 "description" : "Requested object not found"
673 }
674 },
675 "security" : [ {
676 "api_key_employee" : [ ]
677 }, {
678 "api_key_customer" : [ ]
679 } ]
680 }
681 },
682 "/users" : {
683 "get" : {
684 "tags" : [ "Users" ],
685 "summary" : "Get a list of all users",
686 "description" : "Employee method: returns a list of all users.",
687 "operationId" : "getUsers",
688 "parameters" : [ {
689 "name" : "firstName",
690 "in" : "query",
691 "description" : "filter by the given first name",
692 "required" : false,
693 "style" : "form",
694 "explode" : true,
695 "schema" : {
696 "type" : "string",
697 "example" : "John"
698 }
699 }, {
700 "name" : "lastName",
701 "in" : "query",
702 "description" : "filter by the given last name",
703 "required" : false,
704 "style" : "form",
705 "explode" : true,
706 "schema" : {
707 "type" : "string",
708 "example" : "Doe"
709 }
710 }, {
711 "name" : "preposition",
712 "in" : "query",
713 "description" : "filter by the given preposition",
714 "required" : false,
715 "style" : "form",
716 "explode" : true,
717 "schema" : {
718 "type" : "string",
719 "example" : "van der"
720 }
721 }, {
722 "name" : "offset",
723 "in" : "query",
724 "description" : "The number of items to skip before starting to collect the result set",
725 "required" : false,
726 "style" : "form",
727 "explode" : true,
728 "schema" : {
729 "type" : "integer",
730 "example" : 10
731 }
732 }, {
733 "name" : "limit",
734 "in" : "query",
735 "description" : "The numbers of items to return",
736 "required" : false,
737 "style" : "form",
738 "explode" : true,
739 "schema" : {
740 "type" : "integer",
741 "example" : 20
742 }
743 } ],
744 "responses" : {
745 "200" : {
746 "description" : "Array of all bank users",
747 "content" : {
748 "application/json" : {
749 "schema" : {
750 "type" : "array",
751 "items" : {
752 "$ref" : "#/components/schemas/User"
753 }
754 }
755 }
756 }
757 },
758 "400" : {
759 "description" : "Invalid input given"
760 },
761 "401" : {
762 "description" : "Unauthorized action attempted"
763 },
764 "403" : {
765 "description" : "Forbidden"
766 },
767 "404" : {
768 "description" : "Requested object not found"
769 }
770 },
771 "security" : [ {
772 "api_key_employee" : [ ]
773 } ]
774 },
775 "post" : {
776 "tags" : [ "Users" ],
777 "summary" : "Create a new bank user",
778 "description" : "Employee method: creates the new bank user specified in the request body",
779 "operationId" : "createUser",
780 "requestBody" : {
781 "description" : "User object with all parameters. Click on the Schema to see which are required (*)",
782 "content" : {
783 "application/json" : {
784 "schema" : {
785 "$ref" : "#/components/schemas/User"
786 }
787 }
788 },
789 "required" : true
790 },
791 "responses" : {
792 "200" : {
793 "description" : "Call succeeded"
794 },
795 "201" : {
796 "description" : "created {object}"
797 },
798 "400" : {
799 "description" : "Invalid input given"
800 },
801 "401" : {
802 "description" : "Unauthorized action attempted"
803 },
804 "403" : {
805 "description" : "Forbidden"
806 },
807 "404" : {
808 "description" : "Requested object not found"
809 },
810 "415" : {
811 "description" : "Only json input is accepted"
812 }
813 },
814 "security" : [ {
815 "api_key_employee" : [ ]
816 } ]
817 }
818 },
819 "/users/login" : {
820 "post" : {
821 "tags" : [ "Users" ],
822 "summary" : "Login a user",
823 "description" : "Logs a user in and return an authentication token if the specified username and password are correct.",
824 "operationId" : "loginUser",
825 "requestBody" : {
826 "description" : "Username and password (SHA512 encryption)",
827 "content" : {
828 "application/json" : {
829 "schema" : {
830 "$ref" : "#/components/schemas/LoginCredentials"
831 }
832 }
833 },
834 "required" : true
835 },
836 "responses" : {
837 "200" : {
838 "description" : "Successful",
839 "content" : {
840 "application/json" : {
841 "schema" : {
842 "$ref" : "#/components/schemas/Response200Authentication"
843 }
844 }
845 }
846 },
847 "400" : {
848 "description" : "Invalid input given"
849 },
850 "401" : {
851 "description" : "Unauthorized action attempted"
852 },
853 "403" : {
854 "description" : "Forbidden"
855 },
856 "404" : {
857 "description" : "Requested object not found"
858 },
859 "415" : {
860 "description" : "Only json input is accepted"
861 }
862 }
863 }
864 },
865 "/users/{user_id}" : {
866 "get" : {
867 "tags" : [ "Users" ],
868 "summary" : "Get the specified user",
869 "description" : "Employee method (except if customer is logged in and requests his own id): returns the user object from given the user's ID",
870 "operationId" : "getUser",
871 "parameters" : [ {
872 "name" : "user_id",
873 "in" : "path",
874 "description" : "Numeric ID of the desired user",
875 "required" : true,
876 "style" : "simple",
877 "explode" : false,
878 "schema" : {
879 "type" : "integer",
880 "format" : "int64"
881 }
882 } ],
883 "responses" : {
884 "200" : {
885 "description" : "Call succeeded"
886 },
887 "400" : {
888 "description" : "Invalid input given"
889 },
890 "401" : {
891 "description" : "Unauthorized action attempted"
892 },
893 "403" : {
894 "description" : "Forbidden"
895 },
896 "404" : {
897 "description" : "Requested object not found"
898 }
899 },
900 "security" : [ {
901 "api_key_employee" : [ ]
902 }, {
903 "api_key_customer" : [ ]
904 } ]
905 },
906 "put" : {
907 "tags" : [ "Users" ],
908 "summary" : "Replace the specified user",
909 "description" : "Employee method: replaces specified user with the user object given in the request body",
910 "operationId" : "replaceUser",
911 "parameters" : [ {
912 "name" : "user_id",
913 "in" : "path",
914 "description" : "Numeric ID of the desired user",
915 "required" : true,
916 "style" : "simple",
917 "explode" : false,
918 "schema" : {
919 "type" : "integer",
920 "format" : "int64"
921 }
922 } ],
923 "requestBody" : {
924 "description" : "user",
925 "content" : {
926 "application/json" : {
927 "schema" : {
928 "$ref" : "#/components/schemas/User"
929 }
930 }
931 },
932 "required" : true
933 },
934 "responses" : {
935 "200" : {
936 "description" : "Call succeeded"
937 },
938 "400" : {
939 "description" : "Invalid input given"
940 },
941 "401" : {
942 "description" : "Unauthorized action attempted"
943 },
944 "403" : {
945 "description" : "Forbidden"
946 },
947 "404" : {
948 "description" : "Requested object not found"
949 },
950 "415" : {
951 "description" : "Only json input is accepted"
952 }
953 },
954 "security" : [ {
955 "api_key_employee" : [ ]
956 } ]
957 },
958 "delete" : {
959 "tags" : [ "Users" ],
960 "summary" : "Delete the specified user",
961 "description" : "Employee method: deletes the user with the given userId",
962 "operationId" : "deleteUser",
963 "parameters" : [ {
964 "name" : "user_id",
965 "in" : "path",
966 "description" : "Numeric ID of the desired user",
967 "required" : true,
968 "style" : "simple",
969 "explode" : false,
970 "schema" : {
971 "type" : "integer",
972 "format" : "int64"
973 }
974 } ],
975 "responses" : {
976 "200" : {
977 "description" : "Call succeeded"
978 },
979 "204" : {
980 "description" : "No Content"
981 },
982 "400" : {
983 "description" : "Invalid input given"
984 },
985 "401" : {
986 "description" : "Unauthorized action attempted"
987 },
988 "403" : {
989 "description" : "Forbidden"
990 },
991 "404" : {
992 "description" : "Requested object not found"
993 }
994 },
995 "security" : [ {
996 "api_key_employee" : [ ]
997 } ]
998 },
999 "patch" : {
1000 "tags" : [ "Users" ],
1001 "summary" : "Edit the specified user's details",
1002 "description" : "Employee Method: Edit one or more elements of a specified user",
1003 "operationId" : "updateUser",
1004 "parameters" : [ {
1005 "name" : "user_id",
1006 "in" : "path",
1007 "description" : "Numeric ID of the desired user",
1008 "required" : true,
1009 "style" : "simple",
1010 "explode" : false,
1011 "schema" : {
1012 "type" : "integer",
1013 "format" : "int64"
1014 }
1015 } ],
1016 "requestBody" : {
1017 "description" : "Key Value Pair, can be multiple values at once, as long as they are valid according to the User Schema",
1018 "content" : {
1019 "application/json" : {
1020 "schema" : {
1021 "$ref" : "#/components/schemas/UserPatch"
1022 }
1023 }
1024 },
1025 "required" : true
1026 },
1027 "responses" : {
1028 "204" : {
1029 "description" : "No Content"
1030 },
1031 "400" : {
1032 "description" : "Invalid input given"
1033 },
1034 "401" : {
1035 "description" : "Unauthorized action attempted"
1036 },
1037 "403" : {
1038 "description" : "Forbidden"
1039 },
1040 "404" : {
1041 "description" : "Requested object not found"
1042 }
1043 },
1044 "security" : [ {
1045 "api_key_employee" : [ ]
1046 }, {
1047 "api_key_customer" : [ ]
1048 } ]
1049 }
1050 }
1051 },
1052 "components" : {
1053 "schemas" : {
1054 "Account" : {
1055 "type" : "object",
1056 "properties" : {
1057 "IBAN" : {
1058 "type" : "string",
1059 "example" : "NL02INHO0123456789"
1060 },
1061 "AccountHolder" : {
1062 "$ref" : "#/components/schemas/User"
1063 },
1064 "AccountType" : {
1065 "type" : "string",
1066 "enum" : [ "Current", "Savings" ]
1067 },
1068 "NegativeBalanceLimit" : {
1069 "type" : "number",
1070 "example" : -500
1071 },
1072 "DayLimit" : {
1073 "type" : "number",
1074 "example" : 10
1075 },
1076 "TransactionLimit" : {
1077 "type" : "number",
1078 "description" : "The maximum amount of money that can be send in a single transaction.",
1079 "example" : 2000
1080 },
1081 "Amount" : {
1082 "$ref" : "#/components/schemas/AccountAmount"
1083 }
1084 }
1085 },
1086 "AccountAmount" : {
1087 "properties" : {
1088 "IBAN" : {
1089 "type" : "string",
1090 "example" : "NL02INHO0123456789"
1091 },
1092 "Amount" : {
1093 "type" : "number",
1094 "example" : 123.45
1095 }
1096 }
1097 },
1098 "AccountShort" : {
1099 "required" : [ "AccountHolderId", "AccountType", "IBAN" ],
1100 "type" : "object",
1101 "properties" : {
1102 "IBAN" : {
1103 "type" : "string",
1104 "example" : "NL02INHO0123456789"
1105 },
1106 "AccountHolderId" : {
1107 "type" : "number",
1108 "example" : 0
1109 },
1110 "AccountType" : {
1111 "type" : "string",
1112 "enum" : [ "Current", "Savings" ]
1113 }
1114 }
1115 },
1116 "Response200Authentication" : {
1117 "required" : [ "AuthToken" ],
1118 "type" : "object",
1119 "properties" : {
1120 "AuthToken" : {
1121 "type" : "string"
1122 }
1123 }
1124 },
1125 "Transaction" : {
1126 "type" : "object",
1127 "properties" : {
1128 "TransactionId" : {
1129 "type" : "integer",
1130 "format" : "int64"
1131 },
1132 "AccountFrom" : {
1133 "$ref" : "#/components/schemas/Account"
1134 },
1135 "AccountTo" : {
1136 "$ref" : "#/components/schemas/Account"
1137 },
1138 "UserPerforming" : {
1139 "$ref" : "#/components/schemas/User"
1140 },
1141 "Amount" : {
1142 "type" : "number",
1143 "example" : 123.45
1144 },
1145 "TimeStamp" : {
1146 "type" : "string",
1147 "description" : "Transaction timestamp in format yyyy-mm-dd hh:MM:ss",
1148 "example" : "2020-04-20 23:11:59"
1149 }
1150 }
1151 },
1152 "TransactionRequest" : {
1153 "required" : [ "AccountFrom", "AccountTo", "Amount", "UserPerforming" ],
1154 "type" : "object",
1155 "properties" : {
1156 "AccountFrom" : {
1157 "type" : "string",
1158 "example" : "NL02INHO0123456789"
1159 },
1160 "AccountTo" : {
1161 "type" : "string",
1162 "example" : "NL02INHO0987654321"
1163 },
1164 "UserPerforming" : {
1165 "type" : "number",
1166 "description" : "the user id of the person issueing the request"
1167 },
1168 "Amount" : {
1169 "type" : "number",
1170 "example" : 123.45
1171 }
1172 }
1173 },
1174 "User" : {
1175 "required" : [ "DateOfBirth", "Email", "FirstName", "LastName", "UserType" ],
1176 "type" : "object",
1177 "properties" : {
1178 "UserId" : {
1179 "type" : "integer",
1180 "format" : "int64"
1181 },
1182 "FirstName" : {
1183 "type" : "string",
1184 "example" : "John"
1185 },
1186 "LastName" : {
1187 "type" : "string",
1188 "example" : "Doe"
1189 },
1190 "Prepositions" : {
1191 "type" : "string",
1192 "example" : "van der"
1193 },
1194 "DateOfBirth" : {
1195 "type" : "string",
1196 "format" : "date",
1197 "example" : "1999-01-30"
1198 },
1199 "Email" : {
1200 "type" : "string",
1201 "example" : "john.doe@gmail.com"
1202 },
1203 "UserType" : {
1204 "type" : "string",
1205 "enum" : [ "Customer", "Employee" ]
1206 }
1207 }
1208 },
1209 "UserPatch" : {
1210 "type" : "object",
1211 "properties" : {
1212 "FirstName" : {
1213 "type" : "string",
1214 "example" : "John"
1215 },
1216 "LastName" : {
1217 "type" : "string",
1218 "example" : "Doe"
1219 },
1220 "Prepositions" : {
1221 "type" : "string",
1222 "example" : "van der"
1223 },
1224 "DateOfBirth" : {
1225 "type" : "string",
1226 "format" : "date",
1227 "example" : "1999-01-30"
1228 },
1229 "Email" : {
1230 "type" : "string",
1231 "example" : "john.doe@gmail.com"
1232 },
1233 "UserType" : {
1234 "type" : "string",
1235 "enum" : [ "Customer", "Employee" ]
1236 }
1237 }
1238 },
1239 "LoginCredentials" : {
1240 "required" : [ "Email", "Password" ],
1241 "type" : "object",
1242 "properties" : {
1243 "Email" : {
1244 "type" : "string",
1245 "example" : "john.doe@gmail.com"
1246 },
1247 "Password" : {
1248 "type" : "string",
1249 "example" : "421c80b6adecf8584f235ec11e6a796d360de5e10ee7c7289da1a9afde0eaa1e9fba3a7f15c2c940f2f5599ea1f40d22b5d10a7078a21e0228b21d1de8c1d0be"
1250 }
1251 }
1252 }
1253 },
1254 "responses" : {
1255 "Succes" : {
1256 "description" : "Call succeeded"
1257 },
1258 "Created" : {
1259 "description" : "created {object}"
1260 },
1261 "NotFound" : {
1262 "description" : "Requested object not found"
1263 },
1264 "Unauthorized" : {
1265 "description" : "Unauthorized action attempted"
1266 },
1267 "InvalidInput" : {
1268 "description" : "Invalid input given"
1269 },
1270 "Forbidden" : {
1271 "description" : "Forbidden"
1272 },
1273 "NoContent" : {
1274 "description" : "No Content"
1275 },
1276 "OnlyJson" : {
1277 "description" : "Only json input is accepted"
1278 },
1279 "NoTransferToOwnAccount" : {
1280 "description" : "Cannot transfer money to the same account"
1281 },
1282 "SuccessAuthentication" : {
1283 "description" : "Successful",
1284 "content" : {
1285 "application/json" : {
1286 "schema" : {
1287 "$ref" : "#/components/schemas/Response200Authentication"
1288 }
1289 }
1290 }
1291 },
1292 "SuccesAllUsers" : {
1293 "description" : "Array of all bank users",
1294 "content" : {
1295 "application/json" : {
1296 "schema" : {
1297 "type" : "array",
1298 "items" : {
1299 "$ref" : "#/components/schemas/User"
1300 }
1301 }
1302 }
1303 }
1304 },
1305 "SuccesAllTransactions" : {
1306 "description" : "Array of transactions",
1307 "content" : {
1308 "application/json" : {
1309 "schema" : {
1310 "type" : "array",
1311 "items" : {
1312 "$ref" : "#/components/schemas/Transaction"
1313 }
1314 }
1315 }
1316 }
1317 },
1318 "SuccesAllBankAccounts" : {
1319 "description" : "Array of all bank accounts",
1320 "content" : {
1321 "application/json" : {
1322 "schema" : {
1323 "type" : "array",
1324 "items" : {
1325 "$ref" : "#/components/schemas/AccountShort"
1326 }
1327 }
1328 }
1329 }
1330 },
1331 "SuccessAllUserBankAccounts" : {
1332 "description" : "Return the user's bank account(s)",
1333 "content" : {
1334 "application/json" : {
1335 "schema" : {
1336 "type" : "array",
1337 "items" : {
1338 "$ref" : "#/components/schemas/Account"
1339 }
1340 }
1341 }
1342 }
1343 },
1344 "SuccesSpecificBankAccount" : {
1345 "description" : "Return the specified bank account",
1346 "content" : {
1347 "application/json" : {
1348 "schema" : {
1349 "$ref" : "#/components/schemas/Account"
1350 }
1351 }
1352 }
1353 }
1354 },
1355 "parameters" : {
1356 "AccountNumberRequired" : {
1357 "name" : "account_number",
1358 "in" : "path",
1359 "description" : "IBAN of the account",
1360 "required" : true,
1361 "style" : "simple",
1362 "explode" : false,
1363 "schema" : {
1364 "type" : "string"
1365 }
1366 },
1367 "UserAccountIdRequired" : {
1368 "name" : "user_id",
1369 "in" : "path",
1370 "description" : "Numeric ID of the desired user",
1371 "required" : true,
1372 "style" : "simple",
1373 "explode" : false,
1374 "schema" : {
1375 "type" : "integer",
1376 "format" : "int64"
1377 }
1378 },
1379 "OffsetParameter" : {
1380 "name" : "offset",
1381 "in" : "query",
1382 "description" : "The number of items to skip before starting to collect the result set",
1383 "required" : false,
1384 "style" : "form",
1385 "explode" : true,
1386 "schema" : {
1387 "type" : "integer",
1388 "example" : 10
1389 }
1390 },
1391 "LimitParameter" : {
1392 "name" : "limit",
1393 "in" : "query",
1394 "description" : "The numbers of items to return",
1395 "required" : false,
1396 "style" : "form",
1397 "explode" : true,
1398 "schema" : {
1399 "type" : "integer",
1400 "example" : 20
1401 }
1402 },
1403 "firstName" : {
1404 "name" : "firstName",
1405 "in" : "query",
1406 "description" : "filter by the given first name",
1407 "required" : false,
1408 "style" : "form",
1409 "explode" : true,
1410 "schema" : {
1411 "type" : "string",
1412 "example" : "John"
1413 }
1414 },
1415 "lastName" : {
1416 "name" : "lastName",
1417 "in" : "query",
1418 "description" : "filter by the given last name",
1419 "required" : false,
1420 "style" : "form",
1421 "explode" : true,
1422 "schema" : {
1423 "type" : "string",
1424 "example" : "Doe"
1425 }
1426 },
1427 "preposition" : {
1428 "name" : "preposition",
1429 "in" : "query",
1430 "description" : "filter by the given preposition",
1431 "required" : false,
1432 "style" : "form",
1433 "explode" : true,
1434 "schema" : {
1435 "type" : "string",
1436 "example" : "van der"
1437 }
1438 }
1439 },
1440 "securitySchemes" : {
1441 "api_key_employee" : {
1442 "type" : "apiKey",
1443 "name" : "authtoken-employee",
1444 "in" : "header"
1445 },
1446 "api_key_customer" : {
1447 "type" : "apiKey",
1448 "name" : "authtoken-customer",
1449 "in" : "header"
1450 }
1451 }
1452 }
1453}