{"openapi":"3.1.0","info":{"title":"Egencia Cancellation/Deletion API","version":"v1.0"},"servers":[{"url":"https://apis.egencia.com/openconnect/api","description":"Generated server url"}],"paths":{"/v1/bookings/{bookingId}/cancel":{"post":{"description":"<p>Creates a cancel request for a specific booking Id</p>\n<p><b>Request Parameters</b></p>\n<div>\n    <table>\n        <thead>\n        <tr>\n            <th>\n               Attribute\n            </th>\n            <th>\n                Type\n            </th>\n            <th>\n                Description\n            </th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr><td colspan=\"3\"><strong>metadata</strong></td></tr>\n        <tr>\n            <td>bookingId</td>\n            <td>String</td>\n            <td>Trip id corresponding to each booked product</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Response Parameters in case of successful response</b></p>\n<div>\n    <table>\n        <thead>\n        <tr>\n            <th>\n               Attribute\n            </th>\n            <th>\n                Type\n            </th>\n            <th>\n                Description\n            </th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr><td colspan=\"3\"><strong>metadata</strong></td></tr>\n        <tr>\n            <td>booking_id</td>\n            <td>String</td>\n            <td>Trip id corresponding to the booking which is to be cancelled</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>CANCELLED</td>\n        </tr>\n        <tr>\n            <td><strong>items</strong></td>\n            <td>List</td>\n            <td>List of items to be cancelled</td>\n        </tr>\n        <tr>\n            <td>id</td>\n            <td>String</td>\n            <td>Trip item id which is to be cancelled</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>Status of the particular item. The status will always be “CANCELLED” in case of success response.</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Below response with 200 OK HttpStatus</b></p>\n<pre>\n    <code>\n    {\n        \"booking_id\": \"123\",\n        \"status\": \"CANCELLED\",\n        \"items\": [\n            {\n                \"id\": \"1\",\n                \"status\": \"CANCELLED\"\n            },\n            {\n                \"id\": \"2\",\n                \"status\": \"CANCELLED\"\n            }\n        ]\n    }\n    </code>\n</pre>\n<br/><p><b>Response Parameters in case of failure response</b></p>\n<div>\n    <table>\n        <thead>\n        <tr>\n            <th>\n               Attribute\n            </th>\n            <th>\n                Type\n            </th>\n            <th>\n                Description\n            </th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr><td colspan=\"3\"><strong>metadata</strong></td></tr>\n        <tr>\n            <td>booking_id</td>\n            <td>String</td>\n            <td>Trip id corresponding to the booking which is to be cancelled</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>FAILURE</td>\n        </tr>\n        <tr>\n            <td>error_code</td>\n            <td>String</td>\n            <td>Error code in case of failure</td>\n        </tr>\n        <tr>\n            <td>error_message</td>\n            <td>String</td>\n            <td>Error message in case of failure</td>\n        </tr>\n        <tr>\n            <td><strong>items</strong></td>\n            <td>List</td>\n            <td>List of items to be cancelled</td>\n        </tr>\n        <tr>\n            <td>id</td>\n            <td>String</td>\n            <td>Trip item id which is to be cancelled</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>Status of the particular item. The status can be “CANCELLED” or “FAILURE”.</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Below response with 500 Internal Server Error HttpStatus</b></p>\n<div>\n<pre>\n    <code>\n    {\n        \"booking_id\": \"123\",\n        \"status\": \"FAILURE\",\n        \"error_code\": \"EGE-ER-OS-5011\",\n        \"error_message\": \"There was an error in cancelling the [1234, 9876] items. Please try again.\",\n        \"items\": [\n            {\n                \"id\": \"1\",\n                \"status\": \"CANCELLED\"\n            },\n            {\n                \"id\": \"1234\",\n                \"status\": \"FAILURE\"\n            },\n            {\n                \"id\": \"9876\",\n                \"status\": \"FAILURE\"\n            }\n        ]\n    }\n    </code>\n</pre>\n</div>\n","operationId":"cancelBooking","parameters":[{"in":"path","name":"bookingId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/CancelResponse"}}},"description":"<b>Ok</b>."},"400":{"description":"<b>Bad Request</b> : Invalid input or request"},"401":{"description":"<b>Unauthorized</b> : <i>authentication token</i> empty, invalid or expired."},"403":{"description":"<b>Forbidden</b> : User is not authorized for the operation."},"404":{"description":"<b>Not Found</b> : You are trying to access an invalid or non existent resource."},"422":{"description":"<b>Invalid input</b> : invalid or missing required input."},"500":{"description":"<b>Internal Server Error</b> : unable to process request"}},"security":[{"OAuth2":[]}],"summary":"Cancel trip for a particular booking ID","tags":["bookings v1"]}},"/v1/bookings/{bookingId}/delete":{"post":{"description":"<p>Creates a delete request for a specific booking Id</p>\n<p><b>Request Parameters</b></p>\n<div>\n    <table>\n        <thead>\n        <tr>\n            <th>\n               Attribute\n            </th>\n            <th>\n                Type\n            </th>\n            <th>\n                Description\n            </th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr><td colspan=\"3\"><strong>metadata</strong></td></tr>\n        <tr>\n            <td>bookingId</td>\n            <td>String</td>\n            <td>Trip id corresponding to each booked product</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Response Parameters in case of successful response</b></p>\n<div>\n    <table>\n        <thead>\n        <tr>\n            <th>\n               Attribute\n            </th>\n            <th>\n                Type\n            </th>\n            <th>\n                Description\n            </th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr><td colspan=\"3\"><strong>metadata</strong></td></tr>\n        <tr>\n            <td>booking_id</td>\n            <td>String</td>\n            <td>Trip id corresponding to the booking which is to be deleted</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>SUCCESS</td>\n        </tr>\n        <tr>\n            <td><strong>items</strong></td>\n            <td>List</td>\n            <td>List of items to be deleted</td>\n        </tr>\n        <tr>\n            <td>id</td>\n            <td>String</td>\n            <td>Trip item id which is to be deleted</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>Status of the particular item. The status will be booking status of the trip item.</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Below response with 200 OK HttpStatus</b></p>\n<pre>\n    <code>\n    {\n        \"booking_id\": \"123\",\n        \"status\": \"SUCCESS\",\n        \"items\": [\n            {\n                \"id\": \"1\",\n                \"status\": \"DELETED\"\n            },\n            {\n                \"id\": \"2\",\n                \"status\": \"DELETED\"\n            }\n        ]\n    }\n    </code>\n</pre>\n<br/><p><b>Response Parameters in case of failure response</b></p>\n<div>\n    <table>\n        <thead>\n        <tr>\n            <th>\n               Attribute\n            </th>\n            <th>\n                Type\n            </th>\n            <th>\n                Description\n            </th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr><td colspan=\"3\"><strong>metadata</strong></td></tr>\n        <tr>\n            <td>booking_id</td>\n            <td>String</td>\n            <td>Trip id corresponding to the booking which is to be deleted</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>FAILURE</td>\n        </tr>\n        <tr>\n            <td>error_code</td>\n            <td>String</td>\n            <td>Error code in case of deletion</td>\n        </tr>\n        <tr>\n            <td>error_message</td>\n            <td>String</td>\n            <td>Error message in case of deletion</td>\n        </tr>\n        <tr>\n            <td><strong>items</strong></td>\n            <td>List</td>\n            <td>List of items to be deleted</td>\n        </tr>\n        <tr>\n            <td>id</td>\n            <td>String</td>\n            <td>Trip item id which is to be deleted</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>Status of the particular item. The status will be the booking status of the trip item</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Below response with 500 Internal Server Error HttpStatus</b></p>\n<div>\n<pre>\n    <code>\n    {\n        \"booking_id\": \"123\",\n        \"status\": \"FAILURE\",\n        \"error_code\": \"EGE-ER-OS-5012\",\n        \"error_message\": \"There was an error in deleting the [1234, 9876] items. Please try again.\",\n        \"items\": [\n            {\n                \"id\": \"1\",\n                \"status\": \"CANCELLED\"\n            },\n            {\n                \"id\": \"1234\",\n                \"status\": \"FAILURE\"\n            },\n            {\n                \"id\": \"9876\",\n                \"status\": \"FAILURE\"\n            }\n        ]\n    }\n    </code>\n</pre>\n</div>\n","operationId":"deleteBooking","parameters":[{"in":"path","name":"bookingId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}},"description":"<b>Ok</b>."},"400":{"description":"<b>Bad Request</b> : Invalid input or request"},"401":{"description":"<b>Unauthorized</b> : <i>authentication token</i> empty, invalid or expired."},"403":{"description":"<b>Forbidden</b> : User is not authorized for the operation."},"404":{"description":"<b>Not Found</b> : You are trying to access an invalid or non existent resource."},"422":{"description":"<b>Invalid input</b> : invalid or missing required input."},"500":{"description":"<b>Internal Server Error</b> : unable to process request"}},"security":[{"OAuth2":[]}],"summary":"Delete trip items for a particular booking ID","tags":["bookings v1"]}}},"components":{"schemas":{"CancelItem":{"type":"object","description":"Cancellation response after cancel action on booking item","properties":{"id":{"type":"string","description":"Booking item ID for which cancellation action is requested"},"status":{"type":"string","description":"Cancellation status for the item after cancellation is performed"}},"title":"CancelItem"},"CancelResponse":{"type":"object","description":"Cancel response after cancel action","properties":{"bookingId":{"type":"string","description":"Booking ID for which cancel action is requested"},"errorCode":{"type":"string","description":"Error code for the item when cancellation gets failed"},"errorMessage":{"type":"string","description":"Failure message for the item when cancellation gets failed"},"items":{"type":"array","description":"Breakdown of statuses for individual items associated with the booking","items":{"$ref":"#/components/schemas/CancelItem"}},"status":{"type":"string","description":"Cancellation status after cancellation action is performed"}},"title":"CancelResponse"},"DeleteResponse":{"type":"object","description":"Delete response after delete action","properties":{"bookingId":{"type":"string","description":"Booking ID for which delete action is requested"},"errorCode":{"type":"string","description":"Error code for the item when deletion gets failed"},"errorMessage":{"type":"string","description":"Failure message for the item when deletion gets failed"},"items":{"type":"array","description":"Breakdown of statuses for individual items associated with the booking","items":{"$ref":"#/components/schemas/DeletedItem"}},"status":{"type":"string","description":"Status after deletion action is performed"}},"title":"DeleteResponse"},"DeletedItem":{"type":"object","description":"Deletion response after delete action on draft booking item","properties":{"id":{"type":"string","description":"Booking item ID for which action is requested"},"status":{"type":"string","description":"Status of the item after action is performed"}},"title":"DeleteItem"}},"securitySchemes":{"OAuth2":{"flows":{"clientCredentials":{"tokenUrl":"https://apis.egencia.com/auth/v1/token"}},"type":"oauth2"}}}}