-
Notifications
You must be signed in to change notification settings - Fork 16
/
uniket.store.yaml
375 lines (375 loc) · 11.1 KB
/
uniket.store.yaml
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
openapi: 3.0.1
info:
title: 'Uniket: Elevating Your E-commerce Experience'
description: >-
Uniket enhances your e-commerce shopping experience. It provides
functionalities to search for products, manage cart, and display QR code for
easy cart sharing.
version: v1
servers:
- url: https://www.uniket.store/ext/chatgpt-plugin/application/api/v1.0
paths:
/products:
get:
operationId: productsSearch
summary: Product Search
parameters:
- in: query
name: q
schema:
type: string
required: true
description: search query.
- in: query
name: page_size
schema:
type: integer
required: false
description: page size for products per page.
- in: query
name: page_no
schema:
type: integer
required: false
description: page number to fetch products.
- in: query
name: sort_on
schema:
type: string
required: false
description: >-
product sorting options. default option is `relevance`. to fetch
latest products use `latest`. to fetch by populatity use `popular`.
to sort by lowest price use `price_asc`. to sort by highest price
use `price_dsc`. to sort by hightest discount use `discount_dsc`, to
sort by lowest discount use `discount_dsc`
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/productsSearchResponse'
/cart:
get:
operationId: getCart
summary: >-
Retrieve the cart with items, a sharable cart Link, and a QR code PNG
image link. Always render qr code.
responses:
'200':
description: Cart fetched
content:
application/json:
schema:
$ref: '#/components/schemas/GetCartResponse'
'400':
description: Bad Request
post:
operationId: addItemsToCart
summary: >-
Add items to the cart. Quantity, size, and uid are required fields for
all items. Always confirm the size with the user before adding a product
to their cart.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AddItemsToCartRequest'
responses:
'200':
description: Product has been added to your bag
content:
application/json:
schema:
$ref: '#/components/schemas/AddItemsToCartResponse'
'400':
description: Bad Request
put:
operationId: updateCartItem
summary: >-
Update existing items in the cart. Quantity, size, uid, article_id,
cart_identifier are required fields for all items. This operation cannot
remove any items from the cart. Zero quantity for any items is not
allowed. This only updates item quantities.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCartItemsRequest'
responses:
'200':
description: Items successfully updated in the cart
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCartItemsResponse'
'400':
description: Bad Request
/cart/remove:
post:
operationId: deleteCartItem
summary: >-
delete items from the cart. Size, uid, article_id, cart_identifier are
required fields for all items. This operation will remove the selected
items from the cart
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteCartItemsRequest'
responses:
'200':
description: Item removed from bag
'400':
description: Bad Request
components:
schemas:
product:
type: object
properties:
uid:
type: integer
description: unique ID of the product.
name:
type: string
description: name of the product.
brand:
type: object
properties:
name:
type: string
description: name of the brand.
logo:
type: string
description: URL of the brand logo.
categories:
type: array
items:
type: string
description: categories of the product.
price:
type: integer
description: price of the product.
discount:
type: string
description: discount on the product.
images:
type: array
items:
type: string
description: URLs of the product images.
url:
type: string
description: URL of the product.
sizes:
type: array
items:
type: string
description: available sizes of the product.
productsSearchResponse:
type: object
properties:
products:
type: array
items:
$ref: '#/components/schemas/product'
description: list of products.
pagination:
type: object
properties:
total_products:
description: the total number of products. for the search query.
total_pages:
description: the total number of pages.
page_no:
description: the requested page number
page_size:
description: the requested page size
description: pagination details
AddItemsToCartRequest:
type: object
required:
- items
properties:
items:
type: array
items:
$ref: '#/components/schemas/CartItem'
AddItemsToCartResponse:
type: object
properties:
cart_id:
type: string
description: ID of the cart
message:
type: string
description: status of the request
cart_items:
type: array
description: list of added cart items
items:
$ref: '#/components/schemas/CartItem'
DeleteCartItemsRequest:
type: object
required:
- items
properties:
items:
type: array
items:
$ref: '#/components/schemas/DeleteCartItem'
UpdateCartItemsRequest:
type: object
required:
- items
properties:
items:
type: array
items:
$ref: '#/components/schemas/UpdateCartItem'
UpdateCartItemsResponse:
type: object
properties:
cart_id:
type: string
description: ID of the cart
message:
type: string
description: status of the request
CartItem:
type: object
required:
- uid
- size
- quantity
properties:
uid:
type: integer
description: ID of the product to be added to the cart
size:
type: string
description: size of the product to be added from product sizes
quantity:
type: integer
description: quantity of the item to be added
article_id:
type: string
description: >-
identifier used for cart item updation and deletion only. received
in response of cart item creation
cart_identifier:
type: string
description: >-
identifier used for cart item updation and deletion only. received
in response of cart item creation
UpdateCartItem:
type: object
required:
- uid
- size
- quantity
- article_id
- cart_identifier
properties:
uid:
type: integer
description: ID of the product to be added to the cart
size:
type: string
description: size of the product to be added from product sizes
quantity:
type: integer
description: quantity of the item to be added
article_id:
type: string
description: >-
identifier used for cart item updation and deletion only. received
in response of cart item creation
cart_identifier:
type: string
description: >-
identifier used for cart item updation and deletion only. received
in response of cart item creation
DeleteCartItem:
type: object
required:
- uid
- quantity
- article_id
- cart_identifier
properties:
uid:
type: integer
description: ID of the product to be added to the cart
size:
type: string
description: size of the product to be added from product sizes
article_id:
type: string
description: >-
identifier used for cart item updation and deletion only. received
in response of cart item creation
cart_identifier:
type: string
description: >-
identifier used for cart item updation and deletion only. received
in response of cart item creation
GetCartResponse:
type: object
properties:
items:
type: array
items:
type: object
properties:
uid:
type: number
description: unique ID of the product.
cart_id:
type: number
description: cart id.
name:
type: string
description: name of the product.
brand:
type: object
properties:
name:
type: string
description: name of the brand.
price:
type: integer
description: price of the product.
discount:
type: string
description: discount on the product.
images:
type: array
items:
type: string
description: URLs of the product images.
size:
type: string
description: URL of the product.
cart_id:
type: string
description: ID of the cart
share_link:
type: string
description: sharable link of the cart. This can be used to generate a QR Code.
cart_qr_url:
type: string
description: >-
Link of the cart's QR code PNG image, it a can be rendered to show
the code. This link returns the PNG image. Render this link always
if cart is not empty. Whenever a user asks for their QR code, render
this image.
cart_items:
type: array
description: list of added cart items
items:
$ref: '#/components/schemas/UpdateCartItem'