On this page
article
Step 17 – Confirm / reject order
Booking API
When a booking is created or its status changes, SCOM will send a callback with the relevant booking data.
You can use this API to either approve or reject a booking.
-
API: confirmBooking
-
Purpose & Use Cases: This API is used to confirm or cancel a booking when its status is
WAITING_FOR_CONFIRMATION. Use it to update the booking status based on your internal approval rules. -
Request:
| Attribute Name | Data Type | Required | Details |
|---|---|---|---|
| referenceId | String | Yes | The unique identifier of the related Booking object |
| confirmResult | Boolean | Yes | The result of the review: true to approve, false to reject |
| confirmResult | Boolean | Yes | The reason for rejection. Required only if confirmResult is false |
QUERY
mutation ConfirmBooking($input: ConfirmBookingInput!) {
confirmBooking(input: $input) {
result
}
}
GRAPHQL VARIABLES
{
"input": {
"confirmResult": true,
"referenceId": "HB992850227",
"rejectedReason": null
}
}
- Request:
{
"data": {
"confirmBooking": {
"result": true
}
}
}
- Error Message:
| Error Message | Description |
|---|---|
| invalid bookingId or invalid booking stage | The lead is invalid because either lead does not exist or the lead.stage is not equal to WAITING_FOR_CONFIRMATION |