-
Notifications
You must be signed in to change notification settings - Fork 2
/
apiary.apib
259 lines (133 loc) · 5.76 KB
/
apiary.apib
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
FORMAT: 1A
HOST: http://bank-a.herokuapp.com/api/v1
# Banka
Banka is a light-weight core banking application that powers
banking operations like account creation,
customer deposit and withdrawals.
## User Collection [/auth]
### Log In An Existing User [POST/auth/signin]
+ Request (application/json)
+ Attributes
+ email: `[email protected]` (string) - user email address
+ password: `adminuser` (string) - user password
+ Response 200 (application/json)
+ Attributes (User response)
### Register a new user [POST/auth/signup]
+ Request (application/json)
+ Attributes
+ firstName: `jon` (string) - user firstname
+ lastName: `bellion` (string) - user lastname
+ email: `[email protected]` (string) - user email address
+ password: `simpleandsweet` (string) - user password
+ confirmPassword: `simpleandsweet` (string) - confirm user password
+ Response 201 (application/json)
+ Attributes (User response)
## Accounts Collection [/accounts]
### Create A Bank Account [POST/accounts]
+ Request (application/json)
+ Attributes
+ type: `savings` (string) - account type(savings or current)
+ Response 201 (application/json)
+ Attributes (Accounts create)
### Activate or Deactivate A Bank Account [PATCH /accounts/{accountnumber}]
+ Parameter
+ accountnumber: `0123456789` (number) - account number of account to be deleted
+ Attributes
+ status: `activate` (string) - new status ( activate or deactivate )
+ Response 200 (application/json)
+ Attributes (Account Activate)
### Delete A Bank Account [DELETE/accounts/{accountnumber}]
- Parameter
- accountnumber: `0123456789` (number) - account number of account to be deleted
+ Response 200 (application/json)
+ Attributes (Account Deleted)
### Get All Bank Accounts For a User [GET /user/{useremail}/accounts]
- Parameter
- useremail: `[email protected]` (string) - email of the user
+ Response 200 (application/json)
+ Attributes (array [Accounts])
### Get A Specific Bank Account Record [GET /accounts/{accountnumber}]
- Parameter
- accountnumber: `1023456789` (number) - account number of the account record
+ Response 200 (application/json)
+ Attributes (Accounts)
### Get All Bank Accounts [GET /accounts]
+ Response 200 (application/json)
+ Attributes (array [Accounts])
### Get All Active Bank Accounts [GET /accounts?status=active]
+ Response 200 (application/json)
+ Attributes (array [Accounts])
### Get All Dormant Bank Accounts [GET /accounts?status=dormant]
+ Response 200 (application/json)
+ Attributes (array [Accounts dormant])
## Transactions Collection [/transactions]
### Get All Transactions For An Account [GET /accounts/{accountnumber}/transactions]
- Parameter
- accountnumber: `1023456789` (number) - account number of the account record
+ Response 200 (application/json)
+ Attributes (array [Transaction credit])
### Get Details of A Specific Transaction Record [GET /transactions/{transactionid}]
- Parameter
- transactionid: `1` (number) - transaction id
+ Response 200 (application/json)
+ Attributes (Transaction credit)
### Make a Credit Transaction [POST /transactions/{accountnumber}/credit]
- Parameter
- accountnumber: `10233456789` (number) - account number of account to be credited
+ Response 201 (application/json)
+ Attributes (Transaction credit)
### Make a Debit Transaction [POST /transactions/{accountnumber}/debit]
- Parameter
- accountnumber: `10233456789` (number) - account number of account to be credited
+ Response 201 (application/json)
+ Attributes (Transaction debit)
# Data Structures
## User response
+ id: `1` (number) - The ID of the newly registered user
+ firstName: `john` (string)
+ lastName: `bellion` (string)
+ email: `[email protected]` (string)
+ token: `544yiu4y090939849rl;kfliuwruy` (string)
## Account Deleted (object)
+ message: `Account Deleted Successfully` (string)
## Account Deactivate (object)
+ accountNumber: `1023456789` (number)
+ status: `dromant` (string)
+ message: `Account Deactivated Successfully` (string)
## Account Activate (object)
+ accountNumber: `1023456789` (number)
+ status: `active` (string)
+ message: `Account Activated Successfully` (string)
## Accounts create (object)
+ accountNumber: `1023456789` (number) - Account number for the newly created account
+ firstName: `john` (string)
+ lastName: `bellion` (string)
+ email: `[email protected]` (string)
+ type: `savings` (string) - savings or current
+ openingBalance: `0.00` (number)
## Accounts (object)
+ createdOn: `2019:24:09:16:14:09` (string)
+ accountNumber: `1023456789` (number)
+ type: `savings` (string)
+ status: `active` (string)
+ balance: `1000.00` (number)
## Accounts dormant (object)
+ createdOn: `2019:24:09:16:14:09` (string)
+ accountNumber: `1023456789` (number)
+ type: `savings` (string)
+ status: `dormant` (string)
+ balance: `1000.00` (number)
## Transaction credit (object)
+ transactionID: `1` (number)
+ accountNumber: `1023456789` (number)
+ transactionType: `credit` (string)
+ amount: `15000.00` (number)
+ cashier: `1` (number) - cashier that performed the transaction
+ accountBalance: `16000.00` (number)
## Transaction debit (object)
+ transactionID: `1` (number)
+ accountNumber: `1023456789` (number)
+ transactionType: `debit` (string)
+ amount: `15000.00` (number)
+ cashier: `1` (number) - cashier that performed the transaction
+ accountBalance: `16000.00` (number)