· 4 years ago · Apr 16, 2021, 02:12 PM
1{
2 "info": {
3 "_postman_id": "0c44f76d-fb16-4655-88e9-48d56b8347f4",
4 "name": "VN STG CC Hype flow",
5 "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6 },
7 "item": [
8 {
9 "name": "Create Basket adidas STG",
10 "event": [
11 {
12 "listen": "test",
13 "script": {
14 "exec": [
15 "var jsonData = JSON.parse(responseBody)",
16 "",
17 "pm.environment.set(\"basketId\", jsonData.basketId);",
18 "pm.environment.set(\"authorization\", pm.response.headers.get(\"authorization\"))"
19 ],
20 "type": "text/javascript"
21 }
22 },
23 {
24 "listen": "prerequest",
25 "script": {
26 "exec": [
27 "// pm.environment.set('URL', 'https://chkapi-useonlyfordevpurposes.ecom-tf.rfki6.k8s.asgard.dub.aws.k8s.3stripes.net')",
28 "pm.environment.set('brand', 'adidas')",
29 "pm.environment.set('market', 'com.vn')"
30 ],
31 "type": "text/javascript"
32 }
33 }
34 ],
35 "request": {
36 "method": "POST",
37 "header": [
38 {
39 "key": "x-original-host",
40 "value": "{{brand}}.{{market}}"
41 },
42 {
43 "key": "Content-Type",
44 "value": "application/json"
45 }
46 ],
47 "body": {
48 "mode": "raw",
49 "raw": "[\n {\n \"productId\": \"B42114_580\",\n \"masterProductId\": \"B42114\",\n \"quantity\": 1\n }\n]"
50 },
51 "url": {
52 "raw": "{{URL}}/api/checkout/baskets/-/items",
53 "host": [
54 "{{URL}}"
55 ],
56 "path": [
57 "api",
58 "checkout",
59 "baskets",
60 "-",
61 "items"
62 ]
63 }
64 },
65 "response": []
66 },
67 {
68 "name": "Create Basket adidas DEV",
69 "event": [
70 {
71 "listen": "test",
72 "script": {
73 "exec": [
74 "var jsonData = JSON.parse(responseBody)",
75 "",
76 "pm.environment.set(\"basketId\", jsonData.basketId);",
77 "pm.environment.set(\"authorization\", pm.response.headers.get(\"authorization\"))"
78 ],
79 "type": "text/javascript"
80 }
81 },
82 {
83 "listen": "prerequest",
84 "script": {
85 "exec": [
86 "// pm.environment.set('URL', 'https://chkapi-useonlyfordevpurposes.ecom-tf.rfki6.k8s.asgard.dub.aws.k8s.3stripes.net')",
87 "pm.environment.set('brand', 'adidas')",
88 "pm.environment.set('market', 'com.vn')"
89 ],
90 "type": "text/javascript"
91 }
92 }
93 ],
94 "request": {
95 "method": "POST",
96 "header": [
97 {
98 "key": "x-original-host",
99 "value": "{{brand}}.{{market}}"
100 },
101 {
102 "key": "Content-Type",
103 "value": "application/json"
104 }
105 ],
106 "body": {
107 "mode": "raw",
108 "raw": "[\n {\n \"productId\": \"B42114_580\",\n \"masterProductId\": \"B42114\",\n \"quantity\": 1\n }\n]"
109 },
110 "url": {
111 "raw": "{{URL}}/api/checkout/baskets/-/items",
112 "host": [
113 "{{URL}}"
114 ],
115 "path": [
116 "api",
117 "checkout",
118 "baskets",
119 "-",
120 "items"
121 ]
122 }
123 },
124 "response": []
125 },
126 {
127 "name": "PATCH Basket with consentVersion",
128 "event": [
129 {
130 "listen": "test",
131 "script": {
132 "exec": [
133 "var jsonData = JSON.parse(responseBody)",
134 "",
135 "if( jsonData.basketId ) {",
136 " pm.environment.set(\"basketId\", jsonData.basketId);",
137 "}",
138 "pm.environment.set(\"authorization\", pm.response.headers.get(\"authorization\"))"
139 ],
140 "type": "text/javascript"
141 }
142 }
143 ],
144 "request": {
145 "method": "PATCH",
146 "header": [
147 {
148 "key": "x-original-host",
149 "value": "{{brand}}.{{market}}"
150 },
151 {
152 "key": "Content-Type",
153 "value": "application/json"
154 },
155 {
156 "key": "Authorization",
157 "value": "{{authorization}}"
158 }
159 ],
160 "body": {
161 "mode": "raw",
162 "raw": "{\n \"shippingAddress\": {\n \"address1\": \"6th Flr Ramon Magsaysay Center\",\n \"address2\": \"Quintos St.\",\n \"country\": \"VN\",\n \"city\": \"Manilla\",\n \"zipcode\": \"110512\",\n \"firstName\": \"Stefan\",\n \"lastName\": \"Tenev\",\n \"phoneNumber\": \"3231231234\",\n \"useAsBillingAddress\": true,\n \"countyProvince\": \"BINH DINH\",\n \"documentValue\": \"1234567890\",\n \"district\": \"SAD\"\n },\n \"consentVersion\": \"ADI_VER_20191007_PH_EN\",\n \"newsletterSubscription\": true,\n \"customer\": {\n \"email\": \"test@testerino.com\"\n }\n}"
163 },
164 "url": {
165 "raw": "{{URL}}/api/checkout/baskets/{{basketId}}",
166 "host": [
167 "{{URL}}"
168 ],
169 "path": [
170 "api",
171 "checkout",
172 "baskets",
173 "{{basketId}}"
174 ]
175 }
176 },
177 "response": []
178 },
179 {
180 "name": "Create Order Credit Card",
181 "event": [
182 {
183 "listen": "test",
184 "script": {
185 "exec": [
186 "var jsonData = JSON.parse(responseBody);",
187 "",
188 "if(jsonData) {",
189 " pm.environment.set('orderId', jsonData.orderId)",
190 "}"
191 ],
192 "type": "text/javascript"
193 }
194 }
195 ],
196 "request": {
197 "method": "POST",
198 "header": [
199 {
200 "key": "x-original-host",
201 "value": "{{brand}}.{{market}}"
202 },
203 {
204 "key": "Content-Type",
205 "value": "application/json"
206 },
207 {
208 "key": "Authorization",
209 "value": "{{authorization}}"
210 },
211 {
212 "key": "x-overwrite-features",
213 "value": "HYPE_ORDER_STREAMING=true",
214 "type": "text"
215 },
216 {
217 "key": "x-channel-key",
218 "value": "NikiTest",
219 "type": "text"
220 }
221 ],
222 "body": {
223 "mode": "raw",
224 "raw": "{\r\n \"basketId\": \"{{basketId}}\",\r\n \"paymentInstrument\": {\r\n \"paymentMethodId\": \"CREDIT_CARD\"\r\n },\r\n \"authorizedPaymentInstrument\": {\r\n \"cardType\": \"VISA\",\r\n \"PSPReference\": 8835289729680532,\r\n \"maskedNumber\": \"****123\",\r\n \"paymentMethodId\": \"CREDIT_CARD\",\r\n \"authResult\": \"AUTHORISED\",\r\n \"expirationMonth\": 8,\r\n \"authCode\": \"somevalue\",\r\n \"expirationYear\": 21\r\n }\r\n}"
225 },
226 "url": {
227 "raw": "{{URL}}/api/checkout/orders",
228 "host": [
229 "{{URL}}"
230 ],
231 "path": [
232 "api",
233 "checkout",
234 "orders"
235 ]
236 }
237 },
238 "response": []
239 },
240 {
241 "name": "/checkout/orders/orderID",
242 "request": {
243 "method": "GET",
244 "header": [
245 {
246 "key": "x-original-host",
247 "value": "{{brand}}.{{market}}",
248 "type": "text"
249 },
250 {
251 "key": "Authorization",
252 "value": "{{authorization}}",
253 "type": "text"
254 }
255 ],
256 "url": {
257 "raw": "{{URL}}/api/checkout/orders/{{orderId}}",
258 "host": [
259 "{{URL}}"
260 ],
261 "path": [
262 "api",
263 "checkout",
264 "orders",
265 "{{orderId}}"
266 ]
267 }
268 },
269 "response": []
270 },
271 {
272 "name": "basket",
273 "event": [
274 {
275 "listen": "test",
276 "script": {
277 "exec": [
278 "var jsonData = JSON.parse(responseBody)",
279 "",
280 " ",
281 "if( jsonData.basketId ){",
282 " pm.environment.set(\"basketId\", jsonData.basketId);",
283 " pm.environment.set(\"authorization\", pm.response.headers.get(\"Authorization\"))",
284 "}",
285 "",
286 "pm.test(\"response is ok\", function () {",
287 " pm.response.to.have.status(200);",
288 "});",
289 ""
290 ],
291 "type": "text/javascript"
292 }
293 }
294 ],
295 "request": {
296 "method": "GET",
297 "header": [
298 {
299 "key": "x-original-host",
300 "value": "{{brand}}.{{market}}",
301 "type": "text"
302 },
303 {
304 "key": "Checkout-Authorization",
305 "value": "Bearer {{jwt}}",
306 "type": "text",
307 "disabled": true
308 },
309 {
310 "key": "Authorization",
311 "value": "{{authorization}}",
312 "type": "text"
313 },
314 {
315 "key": "x-channel-key",
316 "value": "NikiTest",
317 "type": "text"
318 },
319 {
320 "key": "x-overwrite-features",
321 "value": "HYPE_ORDER_STREAMING=true",
322 "type": "text"
323 }
324 ],
325 "url": {
326 "raw": "{{URL}}/api/checkout/baskets/{{basketId}}?sitePath=en",
327 "host": [
328 "{{URL}}"
329 ],
330 "path": [
331 "api",
332 "checkout",
333 "baskets",
334 "{{basketId}}"
335 ],
336 "query": [
337 {
338 "key": "sitePath",
339 "value": "en"
340 }
341 ]
342 }
343 },
344 "response": []
345 }
346 ],
347 "event": [
348 {
349 "listen": "prerequest",
350 "script": {
351 "type": "text/javascript",
352 "exec": [
353 ""
354 ]
355 }
356 },
357 {
358 "listen": "test",
359 "script": {
360 "type": "text/javascript",
361 "exec": [
362 ""
363 ]
364 }
365 }
366 ]
367}