-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-spec.yaml
286 lines (281 loc) · 10.4 KB
/
api-spec.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
openapi: 3.0.1
# generate npm generate-docs
# openapi-generator-cli generate -i api-spec.yaml -g html2 -o docs --generate-alias-as-model --config openapi-html-config.json
# old npm run "generate-docs
info:
title: arzt.shopping public API
description: |
API for https://arzt.shopping - see github repo for a sample-output.json. Try with: \
curl -X GET https://europe-west6-cash36-prod-262508.cloudfunctions.net/testOrders?start_date=2023-01-01 \
-H "x-api-key: demo" \
-H "Content-Type: application/json"
version: '0.4'
servers:
- url: https://europe-west6-cash36-prod-262508.cloudfunctions.net
#features.openapi:
# hideTryItPanel: false
paths:
/testOrders:
get:
description: Get orders as json
operationId: testOrders
parameters:
- name: start_date
in: query
schema:
type: string
format: date-time
example: '2023-01-01'
- name: x-api-key
in: header
schema:
type: string
example: demo
responses:
'200':
description: Orders from a specific date as json
content:
application/json:
schema:
type: object
items:
$ref: '#/components/schemas/orders'
# $ref: '#/components/schemas/orders'
example: '{"orders":[{"id":5186871623920,"app_id":580111,"created_at":"2023-04-11T22:21:16+02:00","email":"testtest@gmail.com","location_id":null,"note":null,"phone":null,"tags":"Pickup Order","billing_address":{"first_name":"Walter","address1":"Bahnmatt 25","phone":null,"city":"Baar","zip":"6340","province":null,"country":"Switzerland","last_name":"Strametz","address2":null,"company":null,"latitude":null,"longitude":null,"name":"Walter Strametz","country_code":"CH","province_code":null},"customer":{"id":5958064275696,"email":"walter.strametz@gmail.com","accepts_marketing":false,"created_at":"2021-11-17T21:09:19+01:00","updated_at":"2023-04-13T10:22:08+02:00","first_name":"Walter","last_name":"Strametz","orders_count":47,"last_order_id":5186871623920,"note":null,"phone":null,"tags":"newsletter, prospect","currency":"CHF","last_order_name":"#1493","accepts_marketing_updated_at":"2021-12-10T17:13:39+01:00","marketing_opt_in_level":null,"default_address":{"id":8026196574448,"customer_id":5958064275696,"first_name":"Walter","last_name":"Strametz","company":null,"address1":"Bahnmatt 25","address2":null,"city":"Baar","province":null,"country":"Switzerland","zip":"6340","phone":null,"name":"Walter Strametz","province_code":null,"country_code":"CH","country_name":"Switzerland","default":true},"date_of_birth":"1975-12-02"},"line_items":[{"id":13022579359984,"fulfillable_quantity":1,"grams":332,"name":"3TC Trink Lös 10 mg/ml o Alkohol Fl 240 ml","product_id":8201979724016,"quantity":1,"sku":"2050172","title":"3TC Trink Lös 10 mg/ml o Alkohol Fl 240 ml","variant_id":43901209608432,"variant_title":null,"vendor":"ViiV Healthcare GmbH"},{"id":13022579392752,"fulfillable_quantity":1,"grams":72,"name":"KENACORT A Tinkt Tropffl 50 ml - 1 ml","product_id":8201849897200,"quantity":1,"sku":"574385","title":"KENACORT A Tinkt Tropffl 50 ml","variant_id":43767481172208,"variant_title":"1 ml","vendor":"Dermapharm AG"}]}]}'
x-codeSamples:
- lang: shell
label: cURL
source: |
curl -X GET https://europe-west6-cash36-prod-262508.cloudfunctions.net?start_date=2023-01-01 \
-H "x-api-key: demo" \
-H "Content-Type: application/json"
# gerneate with:
# https://roger13.github.io/SwagDefGen/
components:
schemas:
orders:
type: array
items:
type: object
properties:
id:
type: number
example: 5186871623920
app_id:
type: number
example: 580111
created_at:
type: string
format: date-time
example: 2023-04-11T22:21:16+02:00
email:
type: string
example: testtest@gmail.com
location_id:
type: string
format: nullable
note:
type: string
format: nullable
phone:
type: string
format: nullable
tags:
type: string
example: Pickup Order
billing_address:
type: object
properties:
first_name:
type: string
example: Walter
address1:
type: string
example: Bahnmatt 25
phone:
type: string
format: nullable
city:
type: string
example: Baar
zip:
type: string
example: 6340
province:
type: string
format: nullable
country:
type: string
example: Switzerland
last_name:
type: string
example: Strametz
address2:
type: string
format: nullable
company:
type: string
format: nullable
latitude:
type: string
format: nullable
longitude:
type: string
format: nullable
name:
type: string
example: Walter Strametz
country_code:
type: string
example: CH
province_code:
type: string
format: nullable
customer:
type: object
properties:
id:
type: number
example: 5958064275696
email:
type: string
example: walter.strametz@gmail.com
accepts_marketing:
type: boolean
created_at:
type: string
format: date-time
example: 2021-11-17T21:09:19+01:00
updated_at:
type: string
format: date-time
example: 2023-04-13T10:22:08+02:00
first_name:
type: string
example: Walter
last_name:
type: string
example: Strametz
orders_count:
type: number
example: 47
last_order_id:
type: number
example: 5186871623920
note:
type: string
format: nullable
phone:
type: string
format: nullable
tags:
type: string
example: newsletter prospect
currency:
type: string
example: CHF
last_order_name:
type: string
example: #1493
accepts_marketing_updated_at:
type: string
format: date-time
example: 2021-12-10T17:13:39+01:00
marketing_opt_in_level:
type: string
format: nullable
default_address:
type: object
properties:
id:
type: number
example: 8026196574448
customer_id:
type: number
example: 5958064275696
first_name:
type: string
example: Walter
last_name:
type: string
example: Strametz
company:
type: string
format: nullable
address1:
type: string
example: Bahnmatt 25
address2:
type: string
format: nullable
city:
type: string
example: Baar
province:
type: string
format: nullable
country:
type: string
example: Switzerland
zip:
type: string
example: 6340
phone:
type: string
format: nullable
name:
type: string
example: Walter Strametz
province_code:
type: string
format: nullable
country_code:
type: string
example: CH
country_name:
type: string
example: Switzerland
default:
type: boolean
date_of_birth:
type: string
format: date
example: 1975-12-02
line_items:
type: array
items:
type: object
properties:
id:
type: number
example: 13022579359984
fulfillable_quantity:
type: number
example: 1
grams:
type: number
example: 332
name:
type: string
example: 3TC Trink Lös 10 mg/ml o Alkohol Fl 240 ml
product_id:
type: number
example: 8201979724016
quantity:
type: number
example: 1
sku:
type: string
example: 2050172
title:
type: string
example: 3TC Trink Lös 10 mg/ml o Alkohol Fl 240 ml
variant_id:
type: number
example: 43901209608432
variant_title:
type: string
format: nullable
vendor:
type: string
example: ViiV Healthcare GmbH