# Create Service Appointments

Show your users the details of a service appointment—an appointment booked through Salesforce Scheduler—so that users can review and create the appointment.

1. Create a page where the user can review the appointment details and create the appointment.

2. Make a `POST` request on the [`service-appointments`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_service_appointments.htm) Connect API to create the service appointment.

   :::note
   Specify the operating hour scheduling policy ID to show only the dummy resource who’s defined with operating hours for concurrent scheduling. See [Configure Scheduling Policy to Enforce Operating Hours](/docs/service/salesforce-scheduler-dev-guide/guide/uc11-assign-scheduling-policy-to-dummy-resource.md).
   :::

   **Resource URI**

   ```nolang
   https://YOUR_INSTANCE.salesforce.com/services/data/v68.0/connect/scheduling/service-appointments
   ```

   Where `YOUR_INSTANCE` is a variable.

   **For an Existing User (Account)**

   **Sample Request**

   Pass the account ID as `parentRecordId` in the input request body.

   ```nolang
   {
     "schedulingPolicyId": "0VrS7000000004XKAQ",
     "serviceAppointment": {
       "serviceTerritoryId": "0HhS70000004F9zKAE",
       "parentRecordId": "001S7000002br8YIAQ",
       "schedStartTime": "2022-10-03T16:30:00.000+0000",
       "schedEndTime": "2022-10-03T17:00:00.000+0000",
       "additionalInformation": "Schedule concurrent appointment with a dummy resource",
       "appointmentType": "Use case purpose."
     },
     "assignedResources": [
       {
         "serviceResourceId": "0HnS70000004EFyKAM",
         "isRequiredResource": "true"
       }
     ]
   }
   ```

   **Sample Response**

   The API returns the service appointment ID and the assigned service resources.

   ```nolang
   {
     "result": {
       "assignedResourceIds": [
         "03rS700000003zrIAA"
       ],
       "serviceAppointmentId": "08pS70000000CxEIAU"
     }
   }
   ```

   **For a Guest User (Lead)**

   **Sample Request**

   Pass the required lead details in the input request body.

   ```nolang
   {
     "schedulingPolicyId": "0VrS7000000004XKAQ",
     "serviceAppointment": {
       "serviceTerritoryId": "0HhS70000004F9zKAE",
       "schedStartTime": "2022-10-03T16:30:00.000+0000",
       "schedEndTime": "2022-10-03T17:00:00.000+0000",
       "additionalInformation": "Schedule concurrent appointment with a dummy resource",
       "appointmentType": "Use case purpose."
     },
     "assignedResources": [
       {
         "serviceResourceId": "0HnS70000004EFyKAM",
         "isRequiredResource": "true"
       }
     ],
     "lead": {
       "firstName": "Patient1",
       "lastName": "Test",
       "email": "test1@company.com",
       "company": "Test Club"
     }
   }
   ```

   **Sample Response**

   The API returns the service appointment ID and the assigned service resources.

   ```nolang
   {
     "result": {
       "assignedResourceIds": [
         "03rS700000003zrIAA"
       ],
       "parentRecordId": "00QRM000004seHz2AI",
       "serviceAppointmentId": "08pRM0000004vdvYAA"
     }
   }
   ```

Create a page to show confirmation when the service appointment is created successfully.

Here’s how a sample confirmation page can look.

![A representation of the confirmation screen.](https://a.sfdcstatic.com/developer-website/sfdocs/service-cloud/media/salesforce-scheduler-dev-guide/screen_appointment_creation.png)
