---
schema_version: "1"
id: 94a945a431a600b825aa82e1ef2511413aa567e283f0e77ae841833f3924c36f
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/uc9-create-service-appointment.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc9-create-service-appointment.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e3194e1f1185498c515bb682f5bfdb8b517375bf14b79c4f56bd228edeb03183
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Create Service Appointments

The last step in the scheduling application is to show the service appointment details for the user to review and create the appointment.

A service appointment represents an appointment booked through Salesforce Scheduler.

Create a page where the user can review the appointment details and create the appointment. Here’s how a Review Service Appointment page can look.

![A representation of the Review Service Appointment screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/uc9_review_appointment_details.png)

1.  Link the Next button to 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.

    **Resource URI**

    ```nolang
    https://yourInstance.salesforce.com/services/data/vXX.X/connect/scheduling/service-appointments
    ```

    **For an Existing User (Account)**

    **Sample Request**

    Pass the account ID as `parentRecordId` in the input request body.

    Set `status` to `Scheduled` to indicate that the appointment is scheduled.

    ```nolang
    {
      "serviceAppointment": {
        "serviceTerritoryId": "0Hhx000000012oSCAQ",
        "parentRecordId": "001x0000005DLxpAAG",
        "workTypeId": "08qx000000014fnAAA",
        "schedStartTime": "2022-04-19T10:30:00.000+0000",
        "schedEndTime": "2022-04-19T10:40:00.000+0000",
        "additionalInformation": "Appointment Scheduling Custom App.",
        "appointmentType": "Testing Purpose",
        "extendedFields": [
          {
            "name": "status",
            "value": "Scheduled"
          }
        ]
      },
      "assignedResources": [
        {
          "serviceResourceId": "0Hnx000000006GcCAI",
          "isRequiredResource": "true"
        }
      ]
    }
    ```

    **Sample Response**

    The API returns the service appointment ID and the assigned service resources.

    ```nolang
    {
      "result": {
        "assignedResourceIds": [
          "03rx00000001uxJAAQ"
        ],
        "serviceAppointmentId": "08px00000001toRAAQ"
      }
    }
    ```

    **For a Guest User (Lead)**

    **Sample Request**

    Pass the required lead details in the input request body.

    Set `status` to `Scheduled` to indicate that the appointment is scheduled.

    ```nolang
    {
      "serviceAppointment": {
        "serviceTerritoryId": "0Hhx000000012oSCAQ",
        "workTypeId": "08qx000000014fnAAA",
        "schedStartTime": "2022-04-19T10:30:00.000+0000",
        "schedEndTime": "2022-04-19T10:40:00.000+0000",
        "additionalInformation": "Appointment Scheduling Custom App.",
        "appointmentType": "Testing Purpose",
        "extendedFields": [
          {
            "name": "status",
            "value": "Scheduled"
          }
        ]
      },
      "assignedResources": [
        {
          "serviceResourceId": "0Hnx000000006H4CAI",
          "isRequiredResource": "true"
        }
      ],
      "lead": {
        "email": "name@company.com",
        "firstName": "FName",
        "lastName": "LName",
        "company": "CompanyName"
      }
    }
    ```

    **Sample Response**

    The API returns the service appointment ID and the assigned service resources.

    ```nolang
    {
      "result": {
        "assignedResourceIds": [
          "03rx00000001uxOAAQ"
        ],
        "parentRecordId": "00Qx0000001cKPoEAM",
        "serviceAppointmentId": "08px00000001toWAAQ"
      }
    }
    ```


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)

