{"openapi":"3.1.0","info":{"title":"Egencia Approval Workflow API","version":"v1.0"},"servers":[{"url":"https://apis.egencia.com/openconnect/api","description":"Generated server url"}],"paths":{"/v1/bookings/{bookingId}/approve":{"post":{"description":"<p>Creates an Approval request (Action: Approve) 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        <tr>\n            <td>approve</td>\n            <td>String</td>\n            <td>Approval action: Approve</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Response 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>booking_id</td>\n            <td>String</td>\n            <td>Trip id corresponding to the booking which is to be approved</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>Approval action: Approved</td>\n        </tr>\n        <tr>\n            <td>items</td>\n            <td>List</td>\n            <td>List of items to be approved</td>\n        </tr>\n        <tr>\n            <td>item_id</td>\n            <td>String</td>\n            <td>Trip item id which is to be approved</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Success Response</b></p>\n<p>If the request is successful, you will receive the following output:</p>\n<pre>\n    <code>\n    {\n        \"booking_id\": \"123\",\n        \"status\": \"APPROVED\",\n        \"items\": [\n            {\n                \"item_id\": \"1\",\n                \"status\": \"APPROVED\"\n            },\n            {\n                \"item_id\": \"2\",\n                \"status\": \"APPROVED\"\n            }\n        ]\n    }\n    </code>\n</pre>\n<p><b>500 Error Response</b></p>\n<pre>\n   <code>\n   {\n       \"error\": {\n           \"code\": \"EGE-ER-OS-5004\",\n           \"message\": \"There was an error in approving/denying the following items [5fb4d1d3ef80270001a1d1fd, 5fb4d1a7ef80270001a1d1f9]. Please try again.\"\n       }\n   }\n   </code>\n</pre>\n","operationId":"approveBooking","parameters":[{"in":"path","name":"bookingId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}},"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."},"422":{"description":"<b>Invalid input</b> : invalid or missing required input."},"500":{"description":"<b>Internal Server Error</b> : unable to process request"},"501":{"description":"<b>Not Implemented</b> : Not Implemented."}},"security":[{"OAuth2":[]}],"summary":"Approve the complete booking based on booking ID","tags":["bookings v1"]}},"/v1/bookings/{bookingId}/deny":{"post":{"description":"<p>Creates a Deny request (Action: Deny) for a booking</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 the booking which is to be denied</td>\n        </tr>\n        <tr>\n            <td>deny</td>\n            <td>String</td>\n            <td>Approval action: Denied</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Response 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>booking_id</td>\n            <td>String</td>\n            <td>Trip id corresponding to the booking which is to be denied</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>Approval action: Denied</td>\n        </tr>\n        <tr>\n            <td>item_id</td>\n            <td>String</td>\n            <td>Trip item id which is to be denied</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Success Response</b></p>\n<p>If the request is successful, you will receive the following output:</p>\n<pre>\n    <code>\n    {\n        \"booking_id\": \"123\",\n        \"status\": \"DENIED\",\n        \"items\": [\n            {\n                \"item_id\": \"1\",\n                \"status\": \"DENIED\"\n            },\n            {\n                \"item_id\": \"2\",\n                \"status\": \"DENIED\"\n            }\n        ]\n    }\n    </code>\n</pre>\n<p><b>500 Error Response</b></p>\n<pre>\n   <code>\n   {\n       \"error\": {\n           \"code\": \"EGE-ER-OS-5004\",\n           \"message\": \"There was an error in approving/denying the following items [5fb4d1d3ef80270001a1d1fd, 5fb4d1a7ef80270001a1d1f9]. Please try again.\"\n       }\n   }\n   </code>\n</pre>\n","operationId":"denyBooking","parameters":[{"in":"path","name":"bookingId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}},"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."},"422":{"description":"<b>Invalid input</b> : invalid or missing required input."},"500":{"description":"<b>Internal Server Error</b> : unable to process request"},"501":{"description":"<b>Not Implemented</b> : Not Implemented."}},"security":[{"OAuth2":[]}],"summary":"Deny the complete booking based on booking ID","tags":["bookings v1"]}},"/v1/bookings/{bookingId}/items/{itemId}/approve":{"post":{"description":"<p>Creates an approval request (Action: Approve) for a specific item ID. If the optional level parameter is provided, that approval level will be considered.</p>\n<p><b>Request URL</b></p>\n<pre>\n    <code>\n        POST /v1/bookings/{bookingId}/items/{itemId}/approve?level={level}\n    </code>\n</pre>\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 the booking which is to be approved</td>\n        </tr>\n        <tr>\n            <td>approve</td>\n            <td>String</td>\n            <td>Approval action: approve</td>\n        </tr>\n        <tr>\n            <td>item_id</td>\n            <td>String</td>\n            <td>Trip item id which is to be approved</td>\n        </tr>\n        <tr>\n            <td>level</td>\n            <td>String (optional query parameter)</td>\n            <td>Target a specific approval level. Allowed values are ONE for level 1, TWO for level 2, and SECURITY for the security level. If not provided, all configured approval levels for the plan will be approved/denied.</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Response 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>booking_id</td>\n            <td>String</td>\n            <td>Trip id corresponding to the booking which was approved</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>Approval action: Approved</td>\n        </tr>\n        <tr>\n            <td>item_id</td>\n            <td>String</td>\n            <td>Trip item id which was approved</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Success Response</b></p>\n<p>If the request is successful, you will receive the following output:</p>\n<pre>\n    <code>\n        {\n            \"booking_id\": \"1\",\n            \"item_id\": \"2\",\n            \"status\": \"APPROVED\"\n        }\n    </code>\n</pre>\n<p><b>500 Error Response</b></p>\n<pre>\n   <code>\n   {\n       \"error\": {\n           \"code\": \"EGE-ER-OS-5004\",\n           \"message\": \"There was an error in approving/denying the following items [5fb4d1d3ef80270001a1d1fd]. Please try again.\"\n       }\n   }\n   </code>\n</pre>\n","operationId":"approveBookingItem","parameters":[{"description":"Booking ID of the trip containing the item to approve","example":"2000-2587-907","in":"path","name":"bookingId","required":true,"schema":{"type":"string"}},{"description":"ID of the booking item to approve","example":"5f964c44e7b72600017fc8bb","in":"path","name":"itemId","required":true,"schema":{"type":"string"}},{"description":"Target a specific approval level. Allowed values are ONE for level 1, TWO for level 2, and SECURITY for the security level. If not provided, all configured approval levels for the plan will be approved/denied.","example":"ONE","in":"query","name":"level","required":false,"schema":{"type":"string","enum":["ONE","TWO","SECURITY"]}}],"responses":{"200":{"content":{"application/json;charset=utf-8":{"examples":{"Item approved":{"description":"Item approved","value":{"booking_id":"2000-2587-907","item_id":"5f964c44e7b72600017fc8bb","status":"APPROVED"}},"Pending further level approvals":{"description":"Pending further level approvals","value":{"booking_id":"2000-2587-907","item_id":"5f964c44e7b72600017fc8bb","status":"PENDING"}}},"schema":{"$ref":"#/components/schemas/ApprovalItemResponse"}}},"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."},"422":{"description":"<b>Invalid input</b> : invalid or missing required input."},"500":{"content":{"application/json;charset=utf-8":{"examples":{"Item could not be approved (e.g. cancelled downstream)":{"description":"Item could not be approved (e.g. cancelled downstream)","value":{"error":{"code":"EGE-ER-OS-5004","message":"There was an error in approving/denying the following items [5f964c44e7b72600017fc8bb]. Please try again."}}}}}},"description":"<b>Internal Server Error</b> : unable to process request"},"501":{"description":"<b>Not Implemented</b> : Not Implemented."}},"security":[{"OAuth2":[]}],"summary":"Approve a particular booking item based on booking ID and item ID, optionally targeting a specific approval level","tags":["bookings v1"]}},"/v1/bookings/{bookingId}/items/{itemId}/deny":{"post":{"description":"<p>Creates a deny request (Action: Deny) for a specific item ID. If the optional level parameter is provided, that approval level will be considered.</p>\n<p><b>Request URL</b></p>\n<pre>\n    <code>\n        POST /v1/bookings/{bookingId}/items/{itemId}/deny?level={level}\n    </code>\n</pre>\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 the booking which is to be denied</td>\n        </tr>\n        <tr>\n            <td>deny</td>\n            <td>String</td>\n            <td>Approval action: deny</td>\n        </tr>\n        <tr>\n            <td>item_id</td>\n            <td>String</td>\n            <td>Trip item id which is to be denied</td>\n        </tr>\n        <tr>\n            <td>level</td>\n            <td>String (optional query parameter)</td>\n            <td>Target a specific approval level. Allowed values are ONE for level 1, TWO for level 2, and SECURITY for the security level. If not provided, all configured approval levels for the plan will be approved/denied.</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Response 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>booking_id</td>\n            <td>String</td>\n            <td>Trip id corresponding to the booking which was denied</td>\n        </tr>\n        <tr>\n            <td>status</td>\n            <td>String</td>\n            <td>Approval action: Denied</td>\n        </tr>\n        <tr>\n            <td>item_id</td>\n            <td>String</td>\n            <td>Trip item id which was denied</td>\n        </tr>\n        </tbody>\n    </table>\n</div>\n<p><b>Success Response</b></p>\n<p>If the request is successful, you will receive the following output:</p>\n<pre>\n    <code>\n        {\n            \"booking_id\": \"1\",\n            \"item_id\": \"2\",\n            \"status\": \"DENIED\"\n        }\n    </code>\n</pre>\n<p><b>500 Error Response</b></p>\n<pre>\n   <code>\n   {\n       \"error\": {\n           \"code\": \"EGE-ER-OS-5004\",\n           \"message\": \"There was an error in approving/denying the following items [5fb4d1d3ef80270001a1d1fd]. Please try again.\"\n       }\n   }\n   </code>\n</pre>\n","operationId":"denyBookingItem","parameters":[{"description":"Booking ID of the trip containing the item to deny","example":"2000-2587-907","in":"path","name":"bookingId","required":true,"schema":{"type":"string"}},{"description":"ID of the booking item to deny","example":"5f964c44e7b72600017fc8bb","in":"path","name":"itemId","required":true,"schema":{"type":"string"}},{"description":"Target a specific approval level. Allowed values are ONE for level 1, TWO for level 2, and SECURITY for the security level. If not provided, all configured approval levels for the plan will be approved/denied.","example":"ONE","in":"query","name":"level","required":false,"schema":{"type":"string","enum":["ONE","TWO","SECURITY"]}}],"responses":{"200":{"content":{"application/json;charset=utf-8":{"examples":{"Item denied":{"description":"Item denied","value":{"booking_id":"2000-2587-907","item_id":"5f964c44e7b72600017fc8bb","status":"DENIED"}}},"schema":{"$ref":"#/components/schemas/ApprovalItemResponse"}}},"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."},"422":{"description":"<b>Invalid input</b> : invalid or missing required input."},"500":{"content":{"application/json;charset=utf-8":{"examples":{"Item could not be denied (e.g. cancelled downstream)":{"description":"Item could not be denied (e.g. cancelled downstream)","value":{"error":{"code":"EGE-ER-OS-5004","message":"There was an error in approving/denying the following items [5f964c44e7b72600017fc8bb]. Please try again."}}}}}},"description":"<b>Internal Server Error</b> : unable to process request"},"501":{"description":"<b>Not Implemented</b> : Not Implemented."}},"security":[{"OAuth2":[]}],"summary":"Deny a particular booking item based on booking ID and item ID, optionally targeting a specific approval level","tags":["bookings v1"]}}},"components":{"schemas":{"ApprovalItem":{"type":"object","properties":{"id":{"type":"string","description":"Booking item ID for which approve/deny action is requested"},"status":{"type":"string","description":"Approval status for the item after approve/deny action is performed, Possible values: DRAFT/PENDING/APPROVED/DENIED/CANCELLED"}},"title":"ApprovalItem"},"ApprovalItemResponse":{"type":"object","description":"Approval response after approve/deny action on booking item","properties":{"bookingId":{"type":"string","description":"Booking ID for which approve/deny action is requested"},"itemId":{"type":"string","description":"Booking item ID for which approve/deny action is requested"},"status":{"type":"string","description":"Approval status after approve/deny action is performed, Possible values: PENDING/APPROVED/DENIED"}},"title":"ApprovalItemResponse"},"ApprovalResponse":{"type":"object","description":"Approval response after approve/deny action","properties":{"bookingId":{"type":"string","description":"Booking ID for which approve/deny action is requested"},"items":{"type":"array","description":"Breakdown of statuses for individual items associated with the booking","items":{"$ref":"#/components/schemas/ApprovalItem"}},"status":{"type":"string","description":"Approval status after approve/deny action is performed, Possible values: PENDING/APPROVED/DENIED"}},"title":"ApprovalResponse"}},"securitySchemes":{"OAuth2":{"flows":{"clientCredentials":{"tokenUrl":"https://apis.egencia.com/auth/v1/token"}},"type":"oauth2"}}}}