{"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":"

Creates an Approval request (Action: Approve) for a specific booking Id

\n

Request Parameters

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Attribute\n \n Type\n \n Description\n
metadata
bookingIdStringTrip id corresponding to each booked product
approveStringApproval action: Approve
\n
\n

Response Parameters

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Attribute\n \n Type\n \n Description\n
metadata
booking_idStringTrip id corresponding to the booking which is to be approved
statusStringApproval action: Approved
itemsListList of items to be approved
item_idStringTrip item id which is to be approved
\n
\n

Success Response

\n

If the request is successful, you will receive the following output:

\n
\n    \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    \n
\n

500 Error Response

\n
\n   \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   \n
\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":"OK."},"400":{"description":"Bad Request : Invalid input or request"},"401":{"description":"Unauthorized : authentication token empty, invalid or expired."},"403":{"description":"Forbidden : User is not authorized for the operation."},"422":{"description":"Invalid input : invalid or missing required input."},"500":{"description":"Internal Server Error : unable to process request"},"501":{"description":"Not Implemented : Not Implemented."}},"security":[{"OAuth2":[]}],"summary":"Approve the complete booking based on booking ID","tags":["bookings v1"]}},"/v1/bookings/{bookingId}/deny":{"post":{"description":"

Creates a Deny request (Action: Deny) for a booking

\n

Request Parameters

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Attribute\n \n Type\n \n Description\n
metadata
bookingIdStringTrip id corresponding to the booking which is to be denied
denyStringApproval action: Denied
\n
\n

Response Parameters

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Attribute\n \n Type\n \n Description\n
metadata
booking_idStringTrip id corresponding to the booking which is to be denied
statusStringApproval action: Denied
item_idStringTrip item id which is to be denied
\n
\n

Success Response

\n

If the request is successful, you will receive the following output:

\n
\n    \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    \n
\n

500 Error Response

\n
\n   \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   \n
\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":"OK."},"400":{"description":"Bad Request : Invalid input or request"},"401":{"description":"Unauthorized : authentication token empty, invalid or expired."},"403":{"description":"Forbidden : User is not authorized for the operation."},"422":{"description":"Invalid input : invalid or missing required input."},"500":{"description":"Internal Server Error : unable to process request"},"501":{"description":"Not Implemented : Not Implemented."}},"security":[{"OAuth2":[]}],"summary":"Deny the complete booking based on booking ID","tags":["bookings v1"]}},"/v1/bookings/{bookingId}/items/{itemId}/approve":{"post":{"description":"

Creates an Approval request (Action: Approve) for specific item Id.

\n

Request Parameters

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Attribute\n \n Type\n \n Description\n
metadata
bookingIdStringTrip id corresponding to the booking which is to be approved
approveStringApproval action: approve
item_idStringTrip item id which is to be approved
levelString (optional)Targets a specific approver level. Allowed values: ONE, TWO, SECURITY. If not provided, the first approver is used.
\n
\n

Response Parameters

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Attribute\n \n Type\n \n Description\n
metadata
booking_idStringTrip id corresponding to the booking which was approved
statusStringApproval action: Approved
item_idStringTrip item id which was approved
\n
\n

Success Response

\n

If the request is successful, you will receive the following output:

\n
\n    \n        {\n            \"booking_id\": \"1\",\n            \"item_id\": \"2\",\n            \"status\": \"APPROVED\"\n        }\n    \n
\n

500 Error Response

\n
\n   \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   \n
\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":"Targets a specific hierarchical approver level or security level. If not provided, the first approver is used.","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":"OK."},"400":{"description":"Bad Request : Invalid input or request"},"401":{"description":"Unauthorized : authentication token empty, invalid or expired."},"403":{"description":"Forbidden : User is not authorized for the operation."},"422":{"description":"Invalid input : 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":"Internal Server Error : unable to process request"},"501":{"description":"Not Implemented : Not Implemented."}},"security":[{"OAuth2":[]}],"summary":"Approve a particular booking item based on booking ID and item ID","tags":["bookings v1"]}},"/v1/bookings/{bookingId}/items/{itemId}/deny":{"post":{"description":"

Creates a Deny request (Action: Deny) for specific item Id.

\n

Request Parameters

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Attribute\n \n Type\n \n Description\n
metadata
bookingIdStringTrip id corresponding to the booking which is to be denied
denyStringApproval action: deny
item_idStringTrip item id which is to be denied
levelString (optional)Targets a specific approver level. Allowed values: ONE, TWO, SECURITY. If not provided, the first approver is used.
\n
\n

Response Parameters

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Attribute\n \n Type\n \n Description\n
metadata
booking_idStringTrip id corresponding to the booking which was denied
statusStringApproval action: Denied
item_idStringTrip item id which was denied
\n
\n

Success Response

\n

If the request is successful, you will receive the following output:

\n
\n    \n        {\n            \"booking_id\": \"1\",\n            \"item_id\": \"2\",\n            \"status\": \"DENIED\"\n        }\n    \n
\n

500 Error Response

\n
\n   \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   \n
\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":"Targets a specific hierarchical approver level or security level. If not provided, the first approver is used.","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":"OK."},"400":{"description":"Bad Request : Invalid input or request"},"401":{"description":"Unauthorized : authentication token empty, invalid or expired."},"403":{"description":"Forbidden : User is not authorized for the operation."},"422":{"description":"Invalid input : 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":"Internal Server Error : unable to process request"},"501":{"description":"Not Implemented : Not Implemented."}},"security":[{"OAuth2":[]}],"summary":"Deny a particular booking item based on booking ID and item ID","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"}}}}