# CancelPreapproval API Operation (/archive/adaptive-payments/api/cancel-preapproval)



> **Note:** **Important:** Adaptive Payments is not available for new integrations. PayPal provides this documentation to support existing integrations. If you're starting an integration, [we recommend our latest solutions](https://www.paypal.com/us/business/accept-payments).

Cancels preapprovals. Preapprovals can be canceled regardless of the state they are in, such as active, expired, deactivated, and previously canceled.

## CancelPreapprovalRequest Message [#cancelpreapprovalrequest-message]

The `CancelPreapprovalRequest` message specifies which preapproval is to be canceled by identifying the preapproval with its the preapproval key.

### CancelPreapprovalRequest Fields [#cancelpreapprovalrequest-fields]

The table below lists the fields for the `CancelPreapprovalRequest` message.

| Field<br />             | Description<br />                                                                                                                                                 |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `preapprovalKey`<br />  | `xs:string`<br /&#x3E; &#x2A;(Required)* The preapproval key that identifies the preapproval to be canceled.<br />                                                |
| `requestEnvelope`<br /> | `common:requestEnvelope`<br /&#x3E; &#x2A;(Required)* Information common to each API operation, such as the language in which an error message is returned.<br /> |

### RequestEnvelope Fields [#requestenvelope-fields]

| Field<br />           | Description<br />                                                                                                                                                                                                             |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `detailLevel`<br />   | `common:DetailLevelCode`<br /&#x3E; &#x2A;(Optional)* Level of detail required by the client application for components. Value is:<br /> <br />`ReturnAll` — This value provides the maximum level of detail (default).<br /> |
| `errorLanguage`<br /> | `xs:string`<br /&#x3E; &#x2A;(Required)* RFC 3066 language in which error messages are returned; by default it is `en_US`, which is the only language currently supported.<br />                                              |

## CancelPreapprovalResponse Message [#cancelpreapprovalresponse-message]

The `CancelPreapprovalResponse` message contains information returned in response to a `CancelPreapprovalRequest` message.

### CancelPreapprovalResponse Fields [#cancelpreapprovalresponse-fields]

| Field<br />              | Description<br />                                                                                                                |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `responseEnvelope`<br /> | `common:ResponseEnvelope`<br /> Common response information, including a timestamp and the response acknowledgment status.<br /> |

### ResponseEnvelope Fields [#responseenvelope-fields]

| Field<br />           | Description<br />                                                                                                                                                                                                                                                                                                                                           |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ack`<br />           | `common:AckCode`<br /> Acknowledgment code. Value is:<br /> <br />`Success` — The operation completed successfully.<br />`Failure` — The operation failed.<br />`SuccessWithWarning` — The operation completed successfully; however, there is a warning message.<br />`FailureWithWarning` — The operation failed with a warning message.<br />            |
| `build`<br />         | `xs:string`<br /> Build number. It is used only by PayPal Merchant Technical Support.<br />                                                                                                                                                                                                                                                                 |
| `correlationId`<br /> | `xs:string`<br /> Correlation identifier. It is a 13-character, alphanumeric string (for example, `db87c705a910e`) that is used only by PayPal Merchant Technical Support.<br />  > **Note:** &#x2A;*Note:** You must log and store this data for every response you receive. PayPal Technical Support uses the information to assist with reported issues. |
| `timestamp`<br />     | `xs:datetime`<br /> Date on which the response was sent, for example:<br /> `2012-04-02T22:33:35.774-07:00`<br />  > **Note:** &#x2A;*Note:** You must log and store this data for every response you receive. PayPal Technical Support uses the information to assist with reported issues.                                                                |

## PPFault Message [#ppfault-message]

The `PPFaultMessage` returns `ErrorData` and the `ResponseEnvelope` information to your application if an error occurs.

### FaultMessage Fields [#faultmessage-fields]

| Field<br />              | Description<br />                                                                                                                |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `error`<br />            | `common:ErrorData`<br /> Detailed error information.<br />                                                                       |
| `responseEnvelope`<br /> | `common:ResponseEnvelope`<br /> Common response information, including a timestamp and the response acknowledgment status.<br /> |

### ErrorData Fields [#errordata-fields]

| Field<br />         | Description<br />                                                                                                                                                                                                                                                       |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `category`<br />    | `common:ErrorCategory`<br /> The location where the error occurred.<br /> Value is:<br /> <br />`System` — The system encountered errors; try again<br />`Application` — The application encountered errors; try again<br />`Request` — The request was incorrect<br /> |
| `domain`<br />      | `xs:string`<br /> The domain to which this service belongs.<br />                                                                                                                                                                                                       |
| `errorId`<br />     | `xs:long`<br /> A 6-digit number that uniquely identifies a particular error.<br />                                                                                                                                                                                     |
| `exceptionID`<br /> | This field is not used.<br />                                                                                                                                                                                                                                           |
| `message`<br />     | `xs:string`<br /> A description of the error.<br />                                                                                                                                                                                                                     |
| `parameter`<br />   | `common:ErrorParameter`<br /> Represents contextual information about the error.<br />                                                                                                                                                                                  |
| `severity`<br />    | `common:ErrorSeverity`<br /> The severity of the error encountered.<br /> Value is:<br /> <br />`Error` — Processing of the request was interrupted<br />`Warning` — Processing of the request was completed<br />                                                      |
| `subdomain`<br />   | This field is not used.<br />                                                                                                                                                                                                                                           |

### ResponseEnvelope Fields [#responseenvelope-fields-1]

| Field<br />           | Description<br />                                                                                                                                                                                                                                                                                                                                           |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ack`<br />           | `common:AckCode`<br /> Acknowledgment code. Value is:<br /> <br />`Success` — The operation completed successfully.<br />`Failure` — The operation failed.<br />`SuccessWithWarning` — The operation completed successfully; however, there is a warning message.<br />`FailureWithWarning `— The operation failed with a warning message.<br />            |
| `build`<br />         | `xs:string`<br /> Build number. It is used only by PayPal Merchant Technical Support.<br />                                                                                                                                                                                                                                                                 |
| `correlationId`<br /> | `xs:string`<br /> Correlation identifier. It is a 13-character, alphanumeric string (for example, `db87c705a910e`) that is used only by PayPal Merchant Technical Support.<br />  > **Note:** &#x2A;*Note:** You must log and store this data for every response you receive. PayPal Technical Support uses the information to assist with reported issues. |
| `timestamp`<br />     | `xs:datetime`<br /> Date on which the response was sent, for example:<br /> `2012-04-02T22:33:35.774-07:00`<br />  > **Note:** &#x2A;*Note:** You must log and store this data for every response you receive. PayPal Technical Support uses the information to assist with reported issues.                                                                |

## CancelPreapproval Errors [#cancelpreapproval-errors]

| Code<br /> | Message<br />                                              | Additional Information<br /> |
| ---------- | ---------------------------------------------------------- | ---------------------------- |
| 520002     | Internal error                                             |                              |
| 540031     | You don't have permission to cancel this preapproval<br /> |                              |
| 589019     | The preapproval key is invalid                             |                              |
