| title | Update bookingAppointment |
|---|---|
| description | Update the properties of a bookingAppointment object in the specified bookingBusiness. |
| ms.localizationpriority | medium |
| author | arvindmicrosoft |
| ms.subservice | microsoft-bookings |
| doc_type | apiPageType |
| ms.date | 07/30/2024 |
Namespace: microsoft.graph
Update the properties of a bookingAppointment object in the specified bookingBusiness.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
Note
If you create a custom app using application permissions, you must follow the Business rules validation.
PATCH /solutions/bookingBusinesses/{id}/appointments/{id}| Name | Description |
|---|---|
| Authorization | Bearer {code}. Required. |
[!INCLUDE table-intro]
| Property | Type | Description |
|---|---|---|
| customerEmailAddress | String | The SMTP address of the bookingCustomer who books the appointment. |
| customerName | String | The customer's name. |
| customerNotes | String | Notes from the customer associated with this appointment. You can get the value only when you read this bookingAppointment by its ID. You can set this property only when you initially create an appointment with a new customer. |
| customerPhone | String | The customer's phone number. |
| customers | bookingCustomerInformation collection | It lists down the customer properties for an appointment. An appointment contains a list of customer information and each unit indicates the properties of a customer who is part of that appointment. Optional. |
| customerTimeZone | String | The time zone of the customer. For a list of possible values, see dateTimeTimeZone. |
| duration | Duration | The length of the appointment, denoted in ISO8601 format. |
| end | dateTimeTimeZone | The date, time, and time zone that the appointment ends. |
| invoiceStatus | string | The status of the invoice. The possible values are: draft, reviewing, open, canceled, paid, and corrective. |
| isCustomerAllowedToManageBooking | Boolean | Indicates that the customer can manage bookings created by the staff. The default value is false. |
| filledAttendeesCount | Int32 | The current number of customers in the appointment. Required. |
| isLocationOnline | Boolean | True indicates that the appointment is held online. The default value is false. |
| maximumAttendeesCount | Int32 | The maximum number of customers allowed in the appointment. Required. |
| optOutOfCustomerEmail | Boolean | True indicates that the bookingCustomer for this appointment doesn't wish to receive a confirmation for this appointment. |
| postBuffer | Duration | The amount of time to reserve after the appointment ends, for cleaning up, as an example. The value is expressed in ISO8601 format. |
| preBuffer | Duration | The amount of time to reserve before the appointment begins, for preparation, as an example. The value is expressed in ISO8601 format. |
| price | Double | The regular price for an appointment for the specified bookingService. |
| priceType | bookingPriceType | A setting to provide flexibility for the pricing structure of services. The possible values are: undefined, fixedPrice, startingAt, hourly, free, priceVaries, callUs, notSet, unknownFutureValue. |
| reminders | bookingReminder collection | The collection of customer reminders sent for this appointment. The value of this property is available only when reading this bookingAppointment by its ID. |
| selfServiceAppointmentId | String | Another tracking ID for the appointment, if the appointment was created directly by the customer on the scheduling page, as opposed to by a staff member on behalf of the customer. |
| serviceId | String | The ID of the bookingService associated with this appointment. |
| serviceLocation | location | The location where the service is delivered. |
| serviceName | String | The name of the bookingService associated with this appointment. This property is optional when creating a new appointment. If not specified, it's computed from the service associated with the appointment by the serviceId property. |
| serviceNotes | String | Notes from a bookingStaffMember. The value of this property is available only when reading this bookingAppointment by its ID. |
| smsNotificationsEnabled | Boolean | True indicates that SMS notifications are sent to the customers for the appointment. The default value is false. |
| staffMemberIds | String collection | The ID of each bookingStaffMember who is scheduled in this appointment. |
| start | dateTimeTimeZone | The date, time, and time zone when the appointment begins. |
Note
If the maximum number of customers (maximumAttedeesCount) allowed in the service is greater than 1:
- Make sure that the customers exist in the Booking Calendar. If they don’t, create using the Create bookingCustomer operation.
- Pass valid customer IDs when you create or update the appointment. If the customer ID is invalid, that customer won't be included in the appointment object.
If successful, this method returns a 204 No Content response code. It doesn't return anything in the response body.
The following example changes the date of service by a day.
PATCH https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/Contosolunchdelivery@contoso.com/appointments/AAMkADKnAAA=
Content-type: application/json
{
"@odata.type":"#microsoft.graph.bookingAppointment",
"end":{
"@odata.type":"#microsoft.graph.dateTimeTimeZone",
"dateTime":"2018-05-06T12:30:00.0000000+00:00",
"timeZone":"UTC"
},
"start":{
"@odata.type":"#microsoft.graph.dateTimeTimeZone",
"dateTime":"2018-05-06T12:00:00.0000000+00:00",
"timeZone":"UTC"
}
}The following example shows the response.
HTTP/1.1 204 No ContentThe following example updates the customers array for a multi-customer appointment. The customers property is a full replacement array — include all customers that should be part of the appointment, not just the new ones.
Note
- Each object in the customers array must include
@odata.typeset to#microsoft.graph.bookingCustomerInformation. Omitting this property causes the request to fail. - Include customer details such as name, emailAddress, and phone for each entry. The API does not automatically populate these fields from the customerId — if omitted, they will be blank on the appointment.
- The customerId must reference a valid bookingCustomer that exists in the Booking Calendar. If it doesn't exist, create one using the Create bookingCustomer operation.
- The associated bookingService must have maximumAttendeesCount greater than 1 to support multiple customers.
PATCH https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/Contosolunchdelivery@contoso.com/appointments/AAMkADKoAAA=
Content-type: application/json
{
"@odata.type":"#microsoft.graph.bookingAppointment",
"customers": [
{
"@odata.type": "#microsoft.graph.bookingCustomerInformation",
"customerId": "cd56bb19-c348-42c6-af5c-09818c87fb8c",
"name": "John Doe",
"emailAddress": "john.doe@example.com",
"phone": "313-555-5555"
},
{
"@odata.type": "#microsoft.graph.bookingCustomerInformation",
"customerId": "72f148fa-9a86-4c59-b277-f5089d9ea0e7",
"name": "Jane Smith",
"emailAddress": "jane.smith@example.com",
"phone": "248-555-5678"
}
]
}The following example shows the response.
HTTP/1.1 204 No Content