---
schema_version: "1"
id: 10de005621547bcbdd895d923dcdecb1c5940f1e88f290edde7b79ded1237ec5
title: Create Service Appointments
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/salesforce-scheduler-dev-guide/guides/salesforce-scheduler/build-custom-apps/usecase11/uc11-create-service-appointment.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc11-create-service-appointment.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5942691234c3bf8d1f8ff455178e0c4406f6d6d5962bb40574c337e7dff1eeef
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# 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](https://developer.salesforce.com/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://developer.salesforce.com/media/salesforce-scheduler-dev-guide/screen_appointment_creation.png)

