-
Notifications
You must be signed in to change notification settings - Fork 25
/
api_cgn_operator_search.yaml
244 lines (236 loc) · 9.56 KB
/
api_cgn_operator_search.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
swagger: "2.0"
info:
version: 1.0.0
title: Carta Giovani Nazionale Operator Search API
host: localhost
basePath: /api/v1/cgn/operator-search
schemes:
- https
security:
- Bearer: []
paths:
"/published-product-categories":
get:
operationId: getPublishedProductCategories
summary: List of published product categories
description: |
List of categories that have at least a published discount
parameters:
- $ref: '#/parameters/CountNewDiscounts'
responses:
"200":
description: List of categories that have at least a published discount
schema:
$ref: "#/definitions/PublishedProductCategoriesResult"
"401":
description: Login expired.
"500":
description: Service unavailable.
schema:
$ref: "#/definitions/ProblemJson"
"/count":
get:
operationId: count
summary: Count merchants and discounts to search within
description: |
Count merchants and discountsto search within
responses:
"200":
description: Count of merchants/discounts
schema:
$ref: "#/definitions/CountResult"
"400":
description: Bad request.
"401":
description: Login expired.
"500":
description: Service unavailable.
schema:
$ref: "#/definitions/ProblemJson"
"/search":
post:
operationId: search
summary: Search merchants or discounts
description: |
List of merchants and discounts with the token in name and/or description
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/SearchRequest'
responses:
"200":
description: List of merchants/discounts for the given query parameters
schema:
$ref: "#/definitions/SearchResult"
"400":
description: Bad request.
"401":
description: Login expired.
"500":
description: Service unavailable.
schema:
$ref: "#/definitions/ProblemJson"
"/online-merchants":
post:
operationId: getOnlineMerchants
summary: List of online merchants
description: |
List of online merchants alphabetically ordered
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/OnlineMerchantSearchRequest'
responses:
"200":
description: List of online merchants for the given query parameters
schema:
$ref: "#/definitions/OnlineMerchants"
"401":
description: Login expired.
"500":
description: Service unavailable.
schema:
$ref: "#/definitions/ProblemJson"
"/offline-merchants":
post:
operationId: getOfflineMerchants
summary: List of merchants with a physical address
description: |
List of merchants with physical address, ordered by distance from the user by default
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/OfflineMerchantSearchRequest'
responses:
"200":
description: List of physical merchants for the given query parameters
schema:
$ref: "#/definitions/OfflineMerchants"
"401":
description: Login expired.
"500":
description: Service unavailable.
schema:
$ref: "#/definitions/ProblemJson"
"/merchants/{merchantId}":
parameters:
- name: merchantId
in: path
type: string
minLength: 1
required: true
description: Merchant Identifier
get:
operationId: getMerchant
summary: Retrieve merchant details
description: |
Retrieve merchant details together with published discounts
responses:
"200":
description: Found
schema:
$ref: "#/definitions/Merchant"
"401":
description: Login expired.
"404":
description: Operator Not Found
"500":
description: Service unavailable.
schema:
$ref: "#/definitions/ProblemJson"
"/discount-bucket-code/{discountId}":
parameters:
- name: discountId
in: path
type: string
minLength: 1
required: true
description: Discount Identifier
get:
operationId: getDiscountBucketCode
summary: Retrieve a discount bucket code
description: |
Retrieve a discount bucket code and burns it
responses:
"200":
description: Found
schema:
$ref: "#/definitions/DiscountBucketCode"
"401":
description: Login expired.
"404":
description: Bucket code Not Found
"403":
description: Access data provided are invalid or CGN not valid
"410":
description: Endpoint no longer available
"500":
description: Service unavailable.
schema:
$ref: "#/definitions/ProblemJson"
parameters:
CountNewDiscounts:
type: boolean
name: count_new_discounts
in: query
description: Indicates whether categories should be enriched with new discounts count.
definitions:
ProblemJson:
$ref: "https://raw.githubusercontent.com/pagopa/io-functions-commons/v21.0.1/openapi/definitions.yaml#/ProblemJson"
Merchant:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/Merchant"
SupportType:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/SupportType"
DiscountCodeType:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/DiscountCodeType"
OfflineMerchants:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/OfflineMerchants"
OfflineMerchant:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/OfflineMerchant"
OfflineMerchantSearchRequest:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/OfflineMerchantSearchRequest"
CountResult:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/CountResult"
SearchResult:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/SearchResult"
SearchItem:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/SearchItem"
OnlineMerchants:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/OnlineMerchants"
OnlineMerchant:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/OnlineMerchant"
SearchRequest:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/SearchRequest"
OnlineMerchantSearchRequest:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/OnlineMerchantSearchRequest"
Discount:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/Discount"
ProductCategory:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/ProductCategory"
Address:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/Address"
Coordinates:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/Coordinates"
BoundingBox:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/BoundingBox"
DiscountBucketCode:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/DiscountBucketCode"
PublishedProductCategories:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/PublishedProductCategories"
PublishedProductCategoriesWithNewDiscountsCount:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/PublishedProductCategoriesWithNewDiscountsCount"
PublishedProductCategoriesResult:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/PublishedProductCategoriesResult"
ProductCategoryWithNewDiscountsCount:
$ref: "https://raw.githubusercontent.com/pagopa/io-cgn/refs/tags/[email protected]/apps/search-func/openapi/index.yaml#/definitions/ProductCategoryWithNewDiscountsCount"
securityDefinitions:
Bearer:
type: apiKey
name: Authorization
in: header