-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathendpoints.json
More file actions
281 lines (281 loc) · 10.8 KB
/
endpoints.json
File metadata and controls
281 lines (281 loc) · 10.8 KB
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
{
"info": "Summary of all endpoints and resources served by this API.",
"endpoints": {
"/api/signup": {
"POST": {
"summary": "allows user to create a new account",
"exampleRequest": {
"name": "Jace Corso",
"username": "derrick_moss",
"password": "password",
"email": "corsoThree@raza.net",
"phone": "07754376234",
"avatar": "www.vtrimages.com/category%20"
}
}
},
"/api/login": {
"POST": {
"summary": "allows user to log in using an existing account",
"exampleRequest": {
"username": "derrick_moss",
"password": "password"
}
}
},
"/api/logout": {
"POST": {
"summary": "allows user to log out (no request body required)"
}
},
"/api/products": {
"GET": {
"summary": "returns listing of all products",
"queryParams": {
"sortBy": "Sort by any column, e.g. name, description, price, stock, etc",
"order": "asc or desc",
"page": "the number of the page you want to view",
"limit": "the number of results per single page",
"minPrice": "specify minimum price, e.g. minPrice=20.50",
"maxPrice": "specify maximum price, e.g. maxPrice=95.80",
"hideOutOfStock": "hideOutOfStock=true hides all items with 0 stock",
"category": "filter by category name",
"supplier": "filter by supplier name"
}
}
},
"/api/products/bestsellers": {
"GET": {
"summary": "returns listing of products that have been ordered the most times.",
"queryParams": {
"page": "the number of the page you want to view",
"limit": "the number of results per single page",
"category": "filter by category name",
"supplier": "filter by supplier name"
}
}
},
"/api/products/:id": {
"GET": {
"summary": "returns a single product object",
"routeParam": "product id (number)"
}
},
"/api/products/:id/reviews": {
"routeParam": "product id (number)",
"GET": {
"summary": "returns all reviews for a specific product",
"queryParams": {
"page": "the number of the page you want to view",
"limit": "the number of results per single page",
"orderBy": "order reviews by createdAt or by rating"
}
}
},
"/api/customers/:id": {
"routeParam": "customer id (number)",
"GET": {
"summary": "returns a specific customer object"
},
"PUT": {
"summary": "allows customer to update own account details",
"exampleRequest": {
"name": "<string>",
"username": "<string>",
"password": "<string>",
"email": "<string>",
"billingAddress": "<string>",
"shippingAddress": "<string>",
"avatar": "<string>"
}
},
"DELETE": {
"summary": "allows customer to delete own account, order history and cart items"
}
},
"/api/customers/:id/cart": {
"routeParam": "customer id (number)",
"GET": {
"summary": "allows customer to view own cart items",
"queryParams": {
"format": "format=basic returns a simplified representation of the cart items"
}
},
"PUT": {
"summary": "allows customer to update/clear own cart",
"exampleRequest":
[
{
"customerId": 1,
"productId": 1,
"quantity": 4
},
{
"customerId": 1,
"productId": 2,
"quantity": 4
}
]
}
},
"/api/customers/:id/wishlist": {
"routeParam": "customer id (number)",
"GET": {
"summary": "allows customer to view own wishlist",
"queryParams": {
"format": "format=basic returns a simplified representation of the wishlist"
}
},
"PUT": {
"summary": "allows customer to modify/clear own wishlist",
"exampleRequest":
[
{
"customerId": 1,
"productId": 1
},
{
"customerId": 1,
"productId": 2
}
]
}
},
"/api/customers/:id/orders": {
"routeParams": "customer id (number)",
"GET": {
"summary": "returns all orders for a specific customer",
"queryParams": {
"productId": "Reveals whether custoemr has ordered and reviewed a specific product."
}
},
"POST": {
"summary": "allows customer to create a new order composed of all existing cart items. The 'item' property on the request body is optional and is intended for express checkout, bypassing the cart.",
"exampleRequest": {
"billingAddress": {
"addressLine1": "353 Cristian Glade",
"addressLine2": "Apt. 626",
"city": "South Rodriguez",
"county": "Devon",
"postcode": "JT0 9JE"
},
"shippingAddress": {
"addressLine1": "51 Kertzmann Park",
"addressLine2": "Apt. 630",
"city": "O'Hara-under-Champlin-Kreiger",
"county": "Somerset",
"postcode": "BU72 9TW"
},
"item": {
"productId": 12,
"quantity": 3
},
"total": "122.12",
"paymentMethod": "Card",
"status": "pending"
}
}
},
"/api/customers/:id/orders/:id": {
"routeParams": "customer id (number) and order id (number)",
"GET": {
"summary": "returns a specific order if it exists."
}
},
"/api/customers/:id/reviews": {
"routeParams": "customer id (number)",
"GET": {
"summary": "returns all reviews for a specific customer",
"queryParams": {
"page": "the number of the page you want to view",
"limit": "the number of results per single page",
"orderBy": "order reviews by createdAt or by rating"
}
}
},
"/api/customers/:id/favorites": {
"GET": {
"summary": "allows user to view list of products they have recommended",
"queryParams": {
"page": "the number of the page you want to view",
"limit": "the number of results per single page"
}
}
},
"/api/customers/:id/addresses": {
"POST": {
"summary": "allows user to register a new address to their account",
"exampleRequest": {
"billingAddress": {
"addressLine1": "353 Cristian Glade",
"addressLine2": "Apt. 626",
"city": "South Rodriguez",
"county": "Devon",
"postcode": "JT0 9JE"
},
"shippingAddress": {
"addressLine1": "51 Kertzmann Park",
"addressLine2": "Apt. 630",
"city": "O'Hara-under-Champlin-Kreiger",
"county": "Somerset",
"postcode": "BU72 9TW"
}
}
}
},
"/api/customers/:id/addresses/:id": {
"DELETE": {
"summary": "allows user to delete one of their registered addreses"
}
},
"/api/categories": {
"GET": {
"summary": "returns a listing of all categories"
}
},
"/api/suppliers": {
"GET": {
"summary": "returns a listing of all suppliers"
}
},
"/api/reviews": {
"GET": {
"summary": "returns a listing of all reviews",
"queryParams": {
"page": "the number of the page you want to view",
"limit": "the number of results per single page",
"orderBy": "order reviews by createdAt or by rating"
}
},
"POST": {
"summary": "allows customer to create a new review",
"exampleRequest": {
"customerId": 1,
"productId": 4,
"title": "Fully-configurable cohesive infrastructure",
"body": "Facilis beatae maxime mollitia pariatur nostrum autem. Molestiae maxime aliquid ab.",
"recommend": true,
"rating": 3
}
}
},
"/api/reviews/id": {
"routeParams": "customer id (number)",
"GET": {
"summary": "returns a specific review"
},
"PUT": {
"summary": "allows customer to update own review",
"exampleRequest": {
"title": "High quality product",
"body": "This is a great product.",
"recommend": true,
"rating": 5
}
},
"DELETE": {
"summary": "allows customer to delete own review"
}
}
}
}