· 5 years ago · Mar 11, 2021, 09:56 AM
1{
2 "openapi" : "3.0.0",
3 "info" : {
4 "title" : "Xplore Ticket Scanner API",
5 "version" : "1.0.0",
6 "description" : "Integrating with BeMyGuest Xplore Ticket Scanner is done using our [jsonapi.org](http://jsonapi.org/) compliant API\n\nFor full information on the **JSON:API** spec, plus examples, see [http://jsonapi.org](http://jsonapi.org).",
7 "contact" : {
8 "email" : "tech@bemyguest.com.sg"
9 },
10 "license" : {
11 "name" : "proprietary"
12 }
13 },
14 "servers" : [
15 {
16 "description" : "local",
17 "url" : "http://scan.xplore.sg.test/api/v1"
18 },
19 {
20 "description" : "production",
21 "url" : "https://scan.xplore.sg/api/v1"
22 }
23 ],
24 "paths" : {
25 "/tickets/{record}" : {
26 "parameters" : [ {
27 "$ref" : "#/components/parameters/ticketvalue"
28 } ],
29 "get" : {
30 "summary" : "Get Ticket Info by value",
31 "tags" : [ "tickets" ],
32 "operationId" : "getTicketInfoByValue",
33 "description" : "Retrieve the information of the ticket by value",
34 "parameters" : [ ],
35 "responses" : {
36 "200" : {
37 "description" : "OK",
38 "content" : {
39 "application/vnd.api+json" : {
40 "schema" : {
41 "$ref" : "#/components/schemas/Ticket"
42 },
43 "examples" : {
44 "Example 1" : {
45 "value" : {
46 "data" : {
47 "type" : "tickets",
48 "id" : "BMG6LZ8WMQJ",
49 "attributes" : {
50 "validTo" : "2021-12-01",
51 "productPurchased" : "Aristocat Evening Cruise",
52 "redeemed" : false,
53 "redemptionDate" : "",
54 "validityStatus" : "valid",
55 "validityMessage" : "Valid ticket"
56 },
57 "links" : {
58 "self" : "https://scan.xplore.sg/api/v1/tickets/BMG6LZ8WMQJ"
59 }
60 }
61 }
62 },
63 "Example 2" : {
64 "value" : {
65 "data" : {
66 "type" : "tickets",
67 "id" : "BMG6LZ8WMQJ",
68 "attributes" : {
69 "validTo" : "2021-12-01",
70 "productPurchased" : "Aristocat Evening Cruise",
71 "redeemed" : true,
72 "redemptionDate" : "2020-12-24 10:27:02",
73 "validityStatus" : "redeemed",
74 "validityMessage" : "Redeemed today at 10:27 AM"
75 },
76 "links" : {
77 "self" : "https://scan.xplore.sg/api/v1/tickets/BMG6LZ8WMQJ"
78 }
79 }
80 }
81 }
82 }
83 }
84 }
85 },
86 "401" : {
87 "$ref" : "#/components/responses/unauthorizederror"
88 },
89 "404" : {
90 "$ref" : "#/components/responses/notfounderror"
91 }
92 }
93 }
94 },
95 "/tickets/{record}/redeem" : {
96 "parameters" : [ {
97 "$ref" : "#/components/parameters/ticketvalue"
98 } ],
99 "put" : {
100 "summary" : "Redeem Ticket by value",
101 "operationId" : "redeemTicketByValue",
102 "description" : "Redeem ticket by value",
103 "parameters" : [ ],
104 "tags" : [ "tickets" ],
105 "responses" : {
106 "200" : {
107 "description" : "OK",
108 "content" : {
109 "application/vnd.api+json" : {
110 "schema" : {
111 "$ref" : "#/components/schemas/Ticket"
112 },
113 "examples" : {
114 "Example" : {
115 "value" : {
116 "data" : {
117 "type" : "tickets",
118 "id" : "BMG6LZ8WMQJ",
119 "attributes" : {
120 "validTo" : "2021-12-01",
121 "productPurchased" : "Aristocat Evening Cruise",
122 "redeemed" : true,
123 "redemptionDate" : "2020-12-24 10:27:02",
124 "validityStatus" : "redeemed",
125 "validityMessage" : "Redeemed today at 10:27 AM"
126 },
127 "links" : {
128 "self" : "https://scan.xplore.sg/api/v1/tickets/BMG6LZ8WMQJ"
129 }
130 }
131 }
132 }
133 }
134 }
135 }
136 },
137 "401" : {
138 "$ref" : "#/components/responses/unauthorizederror"
139 },
140 "404" : {
141 "$ref" : "#/components/responses/notfounderror"
142 }
143 }
144 }
145 }
146 },
147 "components" : {
148 "schemas" : {
149 "Ticket" : {
150 "description" : "",
151 "type" : "object",
152 "x-examples" : {
153 "Example 1" : {
154 "data" : {
155 "type" : "tickets",
156 "id" : "BMG6LZ8WMQJ",
157 "attributes" : {
158 "validTo" : "2021-12-01",
159 "productPurchased" : "Aristocat Evening Cruise",
160 "redeemed" : false,
161 "redemptionDate" : "",
162 "validityStatus" : "valid",
163 "validityMessage" : "Valid ticket"
164 },
165 "links" : {
166 "self" : "https://scan.xplore.sg/api/v1/tickets/BMG6LZ8WMQJ"
167 }
168 }
169 },
170 "Example 2" : {
171 "data" : {
172 "type" : "tickets",
173 "id" : "BMG6LZ8WMQJ",
174 "attributes" : {
175 "validTo" : "2021-12-01",
176 "productPurchased" : "Aristocat Evening Cruise",
177 "redeemed" : true,
178 "redemptionDate" : "2020-12-24 10:27:02",
179 "validityStatus" : "redeemed",
180 "validityMessage" : "Redeemed today at 10:27 AM"
181 },
182 "links" : {
183 "self" : "https://scan.xplore.sg/api/v1/tickets/BMG6LZ8WMQJ"
184 }
185 }
186 }
187 },
188 "properties" : {
189 "data" : {
190 "type" : "object",
191 "required" : [ "type", "id", "attributes", "links" ],
192 "properties" : {
193 "type" : {
194 "type" : "string"
195 },
196 "id" : {
197 "type" : "string",
198 "example" : "BMG6LZ8WMQJ"
199 },
200 "attributes" : {
201 "type" : "object",
202 "required" : [ "validTo", "productPurchased", "redeemed", "redemptionDate", "validityStatus", "validityMessage" ],
203 "properties" : {
204 "validTo" : {
205 "type" : "string",
206 "format" : "date",
207 "example" : "2021-12-01"
208 },
209 "productPurchased" : {
210 "type" : "string",
211 "example" : "Aristocat Evening Cruise"
212 },
213 "redeemed" : {
214 "type" : "boolean"
215 },
216 "redemptionDate" : {
217 "type" : "string",
218 "example" : "2020-12-24 10:27:02"
219 },
220 "validityStatus" : {
221 "type" : "string",
222 "enum" : [ "valid", "redeemed", "void", "invalid", "expired" ]
223 },
224 "validityMessage" : {
225 "type" : "string",
226 "example" : "Redeemed today at 10:27 AM"
227 }
228 }
229 },
230 "links" : {
231 "type" : "object",
232 "required" : [ "self" ],
233 "properties" : {
234 "self" : {
235 "type" : "string",
236 "format" : "uri",
237 "example" : "https://scan.xplore.sg/api/v1/tickets/BMG6LZ8WMQJ"
238 }
239 }
240 }
241 }
242 }
243 },
244 "required" : [ "data" ]
245 }
246 },
247 "securitySchemes" : {
248 "bearerToken" : {
249 "type" : "http",
250 "scheme" : "bearer",
251 "description" : "In order to use the API, you must obtain an API Key.\n\nTo use API Key user must include additional Authorization header in each request, example:\n\nAuthorization: Bearer 5bf1555822bbc522ff6a8f2eferr26e92638ebcc"
252 }
253 },
254 "responses" : {
255 "unauthorizederror" : {
256 "description" : "Unauthorized",
257 "content" : {
258 "application/vnd.api+json" : {
259 "schema" : {
260 "description" : "",
261 "type" : "object",
262 "properties" : {
263 "errors" : {
264 "type" : "array",
265 "uniqueItems" : true,
266 "minItems" : 1,
267 "items" : {
268 "type" : "object",
269 "properties" : {
270 "status" : {
271 "type" : "string"
272 },
273 "title" : {
274 "type" : "string"
275 }
276 },
277 "required" : [ "status", "title" ]
278 }
279 }
280 },
281 "required" : [ "errors" ]
282 },
283 "examples" : {
284 "Example" : {
285 "value" : {
286 "errors" : [ {
287 "status" : "401",
288 "title" : "Unauthenticated"
289 } ]
290 }
291 }
292 }
293 }
294 },
295 "headers" : { }
296 },
297 "notfounderror" : {
298 "description" : "Not Found",
299 "content" : {
300 "application/vnd.api+json" : {
301 "schema" : {
302 "description" : "",
303 "type" : "object",
304 "properties" : {
305 "errors" : {
306 "type" : "array",
307 "uniqueItems" : true,
308 "minItems" : 1,
309 "items" : {
310 "type" : "object",
311 "properties" : {
312 "status" : {
313 "type" : "string"
314 },
315 "title" : {
316 "type" : "string"
317 },
318 "detail" : {
319 "type" : "string"
320 }
321 },
322 "required" : [ "status", "title", "detail" ]
323 }
324 }
325 },
326 "required" : [ "errors" ]
327 },
328 "examples" : {
329 "Example" : {
330 "value" : {
331 "errors" : [ {
332 "status" : "404",
333 "title" : "Not Found",
334 "detail" : "Resource tickets with id BMG881DUWZU does not exist."
335 } ]
336 }
337 }
338 }
339 }
340 },
341 "headers" : { }
342 }
343 },
344 "parameters" : {
345 "ticketvalue" : {
346 "name" : "record",
347 "in" : "path",
348 "required" : true,
349 "schema" : {
350 "type" : "string",
351 "example" : "BMG6LZ8WMQJ"
352 },
353 "description" : "The value of the ticket to retrieve/redeem"
354 }
355 }
356 },
357 "tags" : [ {
358 "name" : "tickets"
359 } ],
360 "security" : [ {
361 "bearerToken" : [ ]
362 } ]
363}