---
schema_version: "1"
id: 43097b25fa185e2655e70cae0e0591a7a277782b78a809d9b1c2db5a761f0d2a
title: Book 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/uc10-review-and-book-invitation-appointment.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc10-review-and-book-invitation-appointment.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b28934b0bf09ee4dc73151042446365fb9065155fe7089262ea061dbb7c3e36a
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Book Service Appointments

A service appointment is an appointment booked through Salesforce Scheduler. Use the `service-appointments` API to create an appointment.

1.  On your website, create a page with a Create button on which you can show the appointment details for the user to review and book the appointment.

2.  Link the Create 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.

    **Resource URI**

    ```nolang
    https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/connect/scheduling/service-appointments
    ```

    Where `YOUR_INSTANCE` is a variable.

    **For an Account User**

    **Sample Request**

    This sample calls the `service-appointments` API to create the appointment record for an account user.

    **note:** The `parentRecordId` field is required. Pass the account ID as `parentRecordId` in the input request body.

    ```nolang
    {
      "serviceAppointment": {
        "serviceTerritoryId": "0Hhx00000002LzGCAU",
        "parentRecordId": "001x0000005SEqZAAW",
        "schedStartTime": "2022-06-29T11:30:00.000+0000",
        "schedEndTime": "2022-06-29T12:30:00.000+0000",
        "additionalInformation": "Sharing availability use case using APIs.",
        "appointmentType": "Book Test Appointment1",
        "extendedFields": [
          {
            "name": "status",
            "value": "Scheduled"
          }
        ]
      },
      "assignedResources": [
        {
          "serviceResourceId": "0Hnx000000007d7CAA",
          "isRequiredResource": "true"
        }
      ]
    }
    ```

    **Sample Response**

    The API returns the service appointment ID and the assigned service resources.

    ```nolang
    {
      "result": {
        "assignedResourceIds": [
          "03rx0000000252jAAA"
        ],
        "serviceAppointmentId": "08px000000023bdAAA"
      }
    }
    ```

    **For a Guest User**

    **Sample Request**

    This sample calls the `service-appointments` API to create the appointment record for a guest user.

    **note:** The `lead` field is required. Pass the guest user details, including the first name, last name, email address, and phone number as `lead` in the input request body.

    ```nolang
    {
      "serviceAppointment": {
        "serviceTerritoryId": "0Hhx00000002LzGCAU",
        "schedStartTime": "2022-06-29T11:30:00.000+0000",
        "schedEndTime": "2022-06-29T12:30:00.000+0000",
        "additionalInformation": "Sharing availability use case using APIs.",
        "appointmentType": "Book Test Appointment1",
        "extendedFields": [
          {
            "name": "status",
            "value": "Scheduled"
          }
        ]
      },
      "assignedResources": [
        {
          "serviceResourceId": "0Hnx000000007d7CAA",
          "isRequiredResource": "true"
        }
      ],
      "lead": {
        "email": "Test@company.com",
        "firstName": "FirstName",
        "lastName": "LastName",
        "company": "CompanyName"
      }
    }
    ```

    **Sample Response**

    The API returns the service appointment ID and the assigned service resources.

    ```nolang
    {
      "result": {
        "assignedResourceIds": [
          "03rx0000000252oAAA"
        ],
        "parentRecordId": "00Qx0000001cLwwEAE",
        "serviceAppointmentId": "08px000000023biAAA"
      }
    }
    ```

3.  If the service appointment creation is successful, then show the user a confirmation message.

    Here’s a sample confirmation page.

    ![A representation of the confirmation screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/screen_appointment_creation.png)


