---
availability: INSTALLABLE
description: Enables employees to withdraw pending or approved upcoming PTO requests from the HRIS, keeping time off records and balances accurate when plans change.
installation_asset_uuid: 92d56b87-c814-408e-95fb-88be645d4247
name: Cancel PTO Request
purple_chat_link: https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3ECan+you+show+me+my+pending+and+approved+PTO+requests%3F+I+need+to+review+and+cancel+a+few+requests.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp%3ESearching+for+PTO+requests+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E...%3C%2Fp%3E%22%2C%22connectorName%22%3A%22sap-success-factors%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EI+found+5+upcoming+PTO+requests+for+2025+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E%3A%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cstrong%3EPTO-201%3C%2Fstrong%3E+%7C+Vacation+%7C+Feb+10-15%2C+2025+%7C+Winter+Trip+%28%3Cb%3EApproved%3C%2Fb%3E%29%3C%2Fli%3E%3Cli%3E%3Cstrong%3EPTO-202%3C%2Fstrong%3E+%7C+Sick+Leave+%7C+March+5%2C+2025+%7C+Medical+%28%3Cb%3EApproved%3C%2Fb%3E%29%3C%2Fli%3E%3Cli%3E%3Cstrong%3EPTO-203%3C%2Fstrong%3E+%7C+Vacation+%7C+June+1-7%2C+2025+%7C+Beach+Trip+%28%3Cb%3EApproved%3C%2Fb%3E%29%3C%2Fli%3E%3Cli%3E%3Cstrong%3EPTO-204%3C%2Fstrong%3E+%7C+Vacation+%7C+Aug+15-20%2C+2025+%7C+Family+Holiday+%28%3Cb%3EPending%3C%2Fb%3E%29%3C%2Fli%3E%3Cli%3E%3Cstrong%3EPTO-205%3C%2Fstrong%3E+%7C+Personal+%7C+Oct+10%2C+2025+%7C+Moving+Day+%28%3Cb%3EPending%3C%2Fb%3E%29%3C%2Fli%3E%3C%2Ful%3E%3Cp%3EWhich+of+these+would+you+like+to+cancel%3F%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-201%22%7D%2C%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-202%22%7D%2C%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-203%22%7D%2C%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-204%22%7D%2C%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-205%22%7D%5D%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EActually%2C+let%27s+just+cancel+the+approved+vacation+for+June.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp%3EValidating+cancellation+policies+for+selected+dates+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E...%3C%2Fp%3E%22%2C%22connectorName%22%3A%22sap-success-factors%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EOkay%2C+I%27ve+prepared+that+cancellation+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E.+Please+review+the+details%3A%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cstrong%3ERequest%3A%3C%2Fstrong%3E+PTO-203%3C%2Fli%3E%3Cli%3E%3Cstrong%3EType%3A%3C%2Fstrong%3E+Vacation%3C%2Fli%3E%3Cli%3E%3Cstrong%3EDates%3A%3C%2Fstrong%3E+June+1-7%2C+2025%3C%2Fli%3E%3Cli%3E%3Cstrong%3EAction%3A%3C%2Fstrong%3E+Cancel+Approved+Request%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E%3Cstrong%3EDoes+this+look+right%3F%3C%2Fstrong%3E%3C%2Fp%3E%22%7D%2C%7B%22buttons%22%3A%5B%7B%22buttonText%22%3A%22Yes%2C+Cancel+PTO%22%2C%22style%22%3A%22filled%22%7D%2C%7B%22buttonText%22%3A%22Edit%22%2C%22style%22%3A%22outlined%22%7D%5D%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EYes%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp%3EUpdating+records+and+restoring+accrued+balance+in+%3Cb%3ESAP+SuccessFactors%3C%2Fb%3E...%3C%2Fp%3E%22%2C%22connectorName%22%3A%22sap-success-factors%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3ESuccess%21+I%27ve+cancelled+PTO+request+%3Cstrong%3EPTO-203%3C%2Fstrong%3E.+Your+balance+has+been+updated+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E.%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-203+%28Cancelled%29%22%7D%5D%7D%5D%2C%22showFeedbackTray%22%3Atrue%7D%5D%7D
solution_tags:
- HR - Other
- HR - Time & Absence
systems:
- sap-success-factors
---

# Description

The **”Cancel PTO Request”** plugin enables employees to instantly cancel their own approved or pending PTO requests in **SAP SF** through the **Moveworks AI Assistant**, eliminating HR portal friction and ensuring time-off records stay accurate in real time.

# User Experience Preview

Please refer to the following [**Purple Chat**](https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3ECan+you+show+me+my+pending+and+approved+PTO+requests%3F+I+need+to+review+and+cancel+a+few+requests.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp%3ESearching+for+PTO+requests+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E...%3C%2Fp%3E%22%2C%22connectorName%22%3A%22sap-success-factors%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EI+found+5+upcoming+PTO+requests+for+2025+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E%3A%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cstrong%3EPTO-201%3C%2Fstrong%3E+%7C+Vacation+%7C+Feb+10-15%2C+2025+%7C+Winter+Trip+%28%3Cb%3EApproved%3C%2Fb%3E%29%3C%2Fli%3E%3Cli%3E%3Cstrong%3EPTO-202%3C%2Fstrong%3E+%7C+Sick+Leave+%7C+March+5%2C+2025+%7C+Medical+%28%3Cb%3EApproved%3C%2Fb%3E%29%3C%2Fli%3E%3Cli%3E%3Cstrong%3EPTO-203%3C%2Fstrong%3E+%7C+Vacation+%7C+June+1-7%2C+2025+%7C+Beach+Trip+%28%3Cb%3EApproved%3C%2Fb%3E%29%3C%2Fli%3E%3Cli%3E%3Cstrong%3EPTO-204%3C%2Fstrong%3E+%7C+Vacation+%7C+Aug+15-20%2C+2025+%7C+Family+Holiday+%28%3Cb%3EPending%3C%2Fb%3E%29%3C%2Fli%3E%3Cli%3E%3Cstrong%3EPTO-205%3C%2Fstrong%3E+%7C+Personal+%7C+Oct+10%2C+2025+%7C+Moving+Day+%28%3Cb%3EPending%3C%2Fb%3E%29%3C%2Fli%3E%3C%2Ful%3E%3Cp%3EWhich+of+these+would+you+like+to+cancel%3F%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-201%22%7D%2C%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-202%22%7D%2C%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-203%22%7D%2C%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-204%22%7D%2C%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-205%22%7D%5D%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EActually%2C+let%27s+just+cancel+the+approved+vacation+for+June.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp%3EValidating+cancellation+policies+for+selected+dates+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E...%3C%2Fp%3E%22%2C%22connectorName%22%3A%22sap-success-factors%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EOkay%2C+I%27ve+prepared+that+cancellation+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E.+Please+review+the+details%3A%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cstrong%3ERequest%3A%3C%2Fstrong%3E+PTO-203%3C%2Fli%3E%3Cli%3E%3Cstrong%3EType%3A%3C%2Fstrong%3E+Vacation%3C%2Fli%3E%3Cli%3E%3Cstrong%3EDates%3A%3C%2Fstrong%3E+June+1-7%2C+2025%3C%2Fli%3E%3Cli%3E%3Cstrong%3EAction%3A%3C%2Fstrong%3E+Cancel+Approved+Request%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E%3Cstrong%3EDoes+this+look+right%3F%3C%2Fstrong%3E%3C%2Fp%3E%22%7D%2C%7B%22buttons%22%3A%5B%7B%22buttonText%22%3A%22Yes%2C+Cancel+PTO%22%2C%22style%22%3A%22filled%22%7D%2C%7B%22buttonText%22%3A%22Edit%22%2C%22style%22%3A%22outlined%22%7D%5D%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EYes%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp%3EUpdating+records+and+restoring+accrued+balance+in+%3Cb%3ESAP+SuccessFactors%3C%2Fb%3E...%3C%2Fp%3E%22%2C%22connectorName%22%3A%22sap-success-factors%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3ESuccess%21+I%27ve+cancelled+PTO+request+%3Cstrong%3EPTO-203%3C%2Fstrong%3E.+Your+balance+has+been+updated+in+%3Cstrong%3ESAP+SuccessFactors%3C%2Fstrong%3E.%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22sap-success-factors%22%2C%22citationTitle%22%3A%22PTO-203+%28Cancelled%29%22%7D%5D%7D%5D%2C%22showFeedbackTray%22%3Atrue%7D%5D%7D) for a sample conversational experience between a user and the AI Assistant for this plugin.

# Pre-requisites

Before installing and using the **Cancel PTO Request** plugin, please ensure the following requirements are met:

## **1. SAP SuccessFactors Connector**

This plugin requires an active **SAP SuccessFactors connector** to communicate with your SAP SuccessFactors instance.

- If you have not already configured the connector, please follow the [**SAP SuccessFactors Connector Guide**](https://marketplace.moveworks.com/connectors/sap-success-factors#client-credentials) available in the Moveworks Marketplace.
- The connector must be fully set up and before installing this plugin.
- Once the connector is successfully configured, follow our [**plugin installation documentation**](https://help.moveworks.com/docs/ai-agent-marketplace-installation) for detailed steps on how to install and activate the plugin in **Agent Studio**.

## **2. SAP SuccessFactors System Requirements**

### **a. End User Permissions (Employee Persona)**

To cancel a PTO request through this plugin, employees must already have permission to view and cancel time off in SAP SuccessFactors—the same permissions required to view and cancel PTO through the SuccessFactors UI.

At a minimum, end users must have:

- **Time Off permissions** that allow:
    - Viewing available Time Off Types
    - Viewing Time Off / PTO requests
    - Cancelling Time Off / PTO requests
- Access to their own **employee profile**
- Eligibility to cancel PTO requests based on company time-off policies

> Note: The plugin does not grant new permissions. It respects existing role-based permissions and policies granted to the user in SAP SuccessFactors.
> 

### **b. API Permissions (via Integration User)**

The SuccessFactors connector uses a **integration user** **auth** to submit PTO requests through SAP SuccessFactors APIs.

That admin/integration user must have permissions to:

- View and cancel Time Off requests on behalf of employees
- Read Time Off Types and Time Account information
- Validate employee eligibility (as required by your configuration)

These permissions are typically configured through [**Role-Based Permissions (RBP)**](https://learning.sap.com/courses/sap-successfactors-employee-central-core-administration/configuring-role-based-permissions) in SAP SuccessFactors.

# **Implementation details**

## Visual Representation of How the Plugin Works

![image.png](SAP_SuccessFactors_Cancel_PTO_Request_Guide%20-%20Draf/image.png)

## API Details

<aside>
💡

For a complete list of SAP SuccessFactors API servers(tenantURL) by region and environment, refer to the [**SAP API Server Directory**](https://help.sap.com/docs/successfactors-platform/sap-successfactors-api-reference-guide-odata-v2/list-of-sap-successfactors-api-servers).

</aside>

### **API #1: Get a User’s SAP SF ID based on their Email**

This OData API is used to fetch employee details (such as **User ID, name, and email**) from SAP SuccessFactors using the employee’s email address. The returned **User ID** is required for Cancel PTO-related API call.

```bash
curl -X GET "https://<tenantURL>/odata/v2/User?$filter=(email eq '{{emailAddress}}')&$select=userId,email,firstName,lastName,defaultFullName&$format=json" \
  -H "Content-Type: application/json"
```

**Query Parameters**

- `emailAddress` *(string):* Email address of the employee whose SAP SuccessFactors user record needs to be retrieved.
- `$filter=email eq '{{emailAddress}}'`: Filters the User entity to match the provided email address.
- `$select`:Limits the response to required user fields only:
    - `userId`
    - `email`
    - `firstName`
    - `lastName`
    - `defaultFullName`

### **API #2: Retrieve Available PTO Time Types**

This REST API is used to retrieve the list of time-off types available to an employee as of a specific date. The API returns both limited and non-limited leave types. Within the plugin, non-limited leave types are filtered out so that only limited leave types associated with PTO are presented to the employee.

```bash
curl -X GET "https://<tenantURL>/rest/timemanagement/absence/v1/availableTimeTypes?$at={{as_of_date}}" \
  -H "Content-Type: application/json"
```

---

**Query Parameters:**

- `AS_OF_DATE` *(string):* The date (ISO format: `YYYY-MM-DD`) used to determine which PTO time types are valid and available to the employee.

**Key nuances:**

- **Returns all leave types**
    - The API returns both **limited** (PTO) and **non-limited** (e.g., leave of absence) time types.
    - The plugin filters the response to include **only limited time types** eligible for PTO requests.
- **Effective-dated results**
    - Available time types depend on the **“as of date”** passed to the API.
    - Different dates may return different eligible PTO types due to policy changes or employee eligibility.

### **API #3: Fetch pending and approved PTO requests**

This OData API is used to retrieve Pending PTOs and Future Date Approved PTOs from SAP SuccessFactors.

```bash
curl -X GET "https://<tenantURL>/odata/v2/EmployeeTime?$filter=(userId eq '{{userId}}') and (approvalStatus eq 'PENDING' or (approvalStatus eq 'APPROVED' and startDate gt '{{today_date}}')) and {{{externalCode}}}&$select=userId,startDate,endDate,timeTypeNav/externalCode,timeTypeNav/externalName_defaultValue,approvalStatus,userIdNav/defaultFullName,userIdNav/country,workflowRequestId , externalCode, createdDateTime, quantityInHours&$expand=userIdNav,timeTypeNav&$orderby=startDate asc" \
  -H "Content-Type: application/json"
```

---

**Query Parameters:**

- `userId` *(string):* SAP SF user Id of the logged in user.
- `today_date` *(string):* The date (ISO format: `YYYY-MM-DD`) used to determine which PTO time types are valid and available to the employee.
- `externalCode` *(string):* This is needed to make sure that API only returns the PTOs with limited leave type. **Example value is in the format as**: timeTypeNav/externalCode eq 'TT_SICK_REC' or timeTypeNav/externalCode eq 'TT_VAC_REC'
- `$expand` : This is a mandatory query param is order to make sure we are getting all the details related to user including user’s full name, country and Timetype code and name value to show to the user

**Key nuances:**

- **Returns both pending and approved requests**
    - The API returns PTO requests with `PENDING` or `APPROVED` status only.
    - Cancelled and rejected requests are excluded from the response.
- **Future-date filter for approved PTOs**
    - Approved PTOs are only returned for future dates (where `startDate > today`). Past approved PTOs cannot be cancelled and are excluded.
    - Pending PTOs are returned regardless of date.
- **Limited leave types only**
    - The `externalCode` filter ensures only limited leave type PTOs are returned. The external codes must be derived from API #2 and injected dynamically into the query.

### **API #4: Cancel PTO Request**

This OData API is used to **cancel pending PTO or future date approved PTO** in SAP SuccessFactors. 

```bash
curl -X POST "https://<tenantURL>/odata/v2/Upsert" \
  -H "Content-Type: application/json" \
  -d '{
    "__metadata": {
      "uri": "EmployeeTime('\''{{externalCode}}'\'')"
    },
    "approvalStatus": "CANCELLED"
  }'
```

---

**Query Parameters:**

- `externalCode` *(string):* This is the value of the employee PTO fetched from API#3

**Key nuances:** 

- Cancel PTO is only allowed for employees and not for manager persona.

### API References

This plugin uses a combination of **SAP SuccessFactors OData APIs** and **Time Management REST APIs** to retrieve employee information, determine eligible PTO time types, and submit PTO requests.

For detailed information on request parameters, response formats, error handling, and versioning, please refer to the **official SAP SuccessFactors API documentation** provided by SAP.

# **What Is In Scope for This Plugin?**

This plugin supports the following capabilities:

- Cancelling PTO requests for **limited leave types** (e.g., Vacation, Sick Leave, Casual Leave, Earned Leave, Comp Time).
- Cancelling approved or pending requests for an **employee’s own PTO only**.
- Cancelling PTO requests that respect **existing SAP SuccessFactors policies, validations, and approval workflows**.

# **What Is Out of Scope for This Plugin?**

This plugin does **not** support the following:

- Cancelling PTO requests for **non-limited or leave-of-absence types**, such as parental leave, FMLA, or long-term disability.
- Cancelling **partial PTO requests** (e.g., cancelling one day from a PTO request that originally requested 3 days).