{ "info": { "_postman_id": "7d2c17e2-1f0e-42e0-bf52-aa25013795a6", "name": "LinksRez LPA - Cars Developer Portal", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Cars", "item": [ { "name": "Search Car Locations", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "console.log(jsonData);\r", "\r", "var car_location = jsonData[_.random(0, jsonData.length-1)]\r", "var car_location = jsonData[1]\r", "console.log(\"Using Location:\");\r", "console.log(car_location);\r", "\r", "var chainCode = car_location.facilityKey.chainCode;\r", "console.log(\"Using ChainCode:\");\r", "console.log(chainCode);\r", "\r", "var brandCode = car_location.facilityKey.brandCode;\r", "console.log(\"Using BrandCode:\");\r", "console.log(brandCode);\r", "\r", "var locationCode = car_location.facilityKey.locationCode;\r", "console.log(\"Using locationCode:\");\r", "console.log(locationCode);\r", "\r", "pm.collectionVariables.set(\"pickup_location\", locationCode);\r", "pm.collectionVariables.set(\"dropoff_location\", locationCode);\r", "\r", "" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/api/{{ver}}/car/location?chainCode={{chain_code}}&brand={{brand}}&keyword={{country_code}}", "host": [ "{{url}}" ], "path": [ "api", "{{ver}}", "car", "location" ], "query": [ { "key": "chainCode", "value": "{{chain_code}}" }, { "key": "brand", "value": "{{brand}}" }, { "key": "keyword", "value": "{{country_code}}" } ] } }, "response": [] }, { "name": "Get Availability", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/api/{{ver}}/car/availability?pickupLocation=M6K&dropoffLocation=M6K&chainCode={{chain_code}}&brand={{brand}}&pickupDate={{start_date}}&dropoffDate={{end_date}}&pickupTime={{start_time}}&dropoffTime={{end_time}}&countryCode={{country_code}}", "host": [ "{{url}}" ], "path": [ "api", "{{ver}}", "car", "availability" ], "query": [ { "key": "pickupLocation", "value": "M6K" }, { "key": "dropoffLocation", "value": "M6K" }, { "key": "chainCode", "value": "{{chain_code}}" }, { "key": "brand", "value": "{{brand}}" }, { "key": "pickupDate", "value": "{{start_date}}" }, { "key": "dropoffDate", "value": "{{end_date}}" }, { "key": "pickupTime", "value": "{{start_time}}" }, { "key": "dropoffTime", "value": "{{end_time}}" }, { "key": "countryCode", "value": "{{country_code}}" } ] } }, "response": [] }, { "name": "Search Car Inventory", "request": { "method": "GET", "header": [], "url": null }, "response": [] }, { "name": "Book Car Reservation", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "console.log(jsonData);\r", "\r", "var confirmation_code = jsonData.createOrderRS[0].order.confirmationID.value;\r", "console.log(\"Confirmation Code:\");\r", "console.log(confirmation_code);\r", "\r", "pm.collectionVariables.set(\"confirmation_code\", confirmation_code);\r", "\r", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"createOrderRQ\": [\r\n {\r\n \"payloadStdAttributes\": {\r\n \"target\": \"TEST\",\r\n \"version\": 5,\r\n \"transactionStatusCode\": \"START\",\r\n \"retransmissionIndicatorInd\": false\r\n },\r\n \"order\": {\r\n \"offer\": [\r\n {\r\n \"extensionPoint\": {\r\n \"any\": [\r\n {\r\n \"emailNotification\": true\r\n }\r\n ]\r\n },\r\n \"product\": [\r\n {\r\n \"@type\": \"ProductVehicle\",\r\n \"category\": {\r\n \"vehicleCode\": \"A\"\r\n },\r\n \"rateCode\": \"7ZI\",\r\n \"dateTimeSpan\": {\r\n \"timeSpan\": {\r\n \"start\": \"{{start_date}}\",\r\n \"end\": \"{{end_date}}\"\r\n }\r\n },\r\n \"pickupTime\": \"{{start_time}}\",\r\n \"dropoffTime\": \"{{end_time}}\"\r\n }\r\n ],\r\n \"facilityIdentifier\": {\r\n \"@type\": \"FacilityVehicle\",\r\n \"facilityKey\": {\r\n \"@type\": \"FacilityKeyVehicle\",\r\n \"locationCode\": \"{{pickup_location}}\",\r\n \"chainCode\": \"{{chain_code}}\",\r\n \"brandCode\": \"{{brand}}\"\r\n }\r\n }\r\n }\r\n ],\r\n \"primaryTraveler\": {\r\n \"personName\": {\r\n \"given\": [\r\n \"{{client_first_name}}\"\r\n ],\r\n \"surname\": \"{{client_last_name}}\"\r\n },\r\n \"address\": [\r\n {\r\n \"addressLine\": [\r\n \"{{client_address}}\"\r\n ],\r\n \"city\": \"{{client_city}}\",\r\n \"stateProv\": {\r\n \"value\": \"{{client_state}}\"\r\n },\r\n \"country\": {\r\n \"value\": \"{{client_country}}\"\r\n },\r\n \"postalCode\": \"{{client_zip}}\"\r\n }\r\n ],\r\n \"telephone\": [\r\n {\r\n \"phoneNumber\": \"{{client_phone}}\"\r\n }\r\n ],\r\n \"email\": [\r\n {\r\n \"address\": \"{{client_email}}\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{url}}/api/{{ver}}/car/reservation", "host": [ "{{url}}" ], "path": [ "api", "{{ver}}", "car", "reservation" ] } }, "response": [] }, { "name": "Get Car Reservation", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/api/{{ver}}/car/reservation?brand={{brand}}&chainCode={{chain_code}}&confirmationNumber={{confirmation_code}}&lastName={{client_last_name}}", "host": [ "{{url}}" ], "path": [ "api", "{{ver}}", "car", "reservation" ], "query": [ { "key": "brand", "value": "{{brand}}" }, { "key": "chainCode", "value": "{{chain_code}}" }, { "key": "confirmationNumber", "value": "{{confirmation_code}}" }, { "key": "lastName", "value": "{{client_last_name}}" } ] } }, "response": [] }, { "name": "Cancel Car Reservation", "request": { "method": "DELETE", "header": [], "url": { "raw": "{{url}}/api/{{ver}}/car/reservation?brand={{brand}}&chainCode={{chain_code}}&reservationId={{confirmation_code}}&surname={{client_last_name}}", "host": [ "{{url}}" ], "path": [ "api", "{{ver}}", "car", "reservation" ], "query": [ { "key": "brand", "value": "{{brand}}" }, { "key": "chainCode", "value": "{{chain_code}}" }, { "key": "reservationId", "value": "{{confirmation_code}}" }, { "key": "surname", "value": "{{client_last_name}}" } ] } }, "response": [] } ] }, { "name": "Car Bookings", "request": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "url": { "raw": "{{url}}/admin/v1/car/bookings", "host": [ "{{url}}" ], "path": [ "admin", "v1", "car", "bookings" ] } }, "response": [] } ], "auth": { "type": "apikey", "apikey": [ { "key": "value", "value": "XXXXXXXXX", "type": "string" }, { "key": "key", "value": "api-key", "type": "string" } ] }, "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ], "variable": [ { "key": "url", "value": "https://car-api-2445583353637.production.gw.apicast.io:443" }, { "key": "ver", "value": "v1" }, { "key": "chain_code", "value": "AV" }, { "key": "brand", "value": "Avis" }, { "key": "start_date", "value": "2021-12-22" }, { "key": "start_time", "value": "13:00" }, { "key": "end_date", "value": "2021-12-24" }, { "key": "end_time", "value": "13:00" }, { "key": "country_code", "value": "GR" }, { "key": "client_first_name", "value": "Paul" }, { "key": "client_last_name", "value": "Brown" }, { "key": "client_address", "value": "Super Street, 5A" }, { "key": "client_city", "value": "Boston" }, { "key": "client_state", "value": "MA" }, { "key": "client_country", "value": "US" }, { "key": "client_zip", "value": "01496" }, { "key": "client_phone", "value": "1894968895" }, { "key": "client_email", "value": "pbw@email.com" }, { "key": "pickup_location", "value": "" }, { "key": "dropoff_location", "value": "" }, { "key": "confirmation_code", "value": "" } ] }