CancelPreapproval API Operation

Use the CancelPreapproval API operation to handle the canceling of preapprovals. Preapprovals can be canceled regardless of the state they are in, such as active, expired, deactivated, and previously canceled.

CancelPreapprovalRequest Message

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

CancelPreapprovalRequest Fields

The table below lists the fields for the CancelPreapprovalRequest message.

Field

Description

preapprovalKey

xs:string

(Required) The preapproval key that identifies the preapproval to be canceled.

requestEnvelope

common:requestEnvelope

(Required) Information common to each API operation, such as the language in which an error message is returned.

RequestEnvelope Fields

Field

Description

detailLevel

common:DetailLevelCode

(Optional) Level of detail required by the client application for components. It is one of the following values:


  • ReturnAll – This value provides the maximum level of detail (default).

errorLanguage

xs:string

(Required) RFC 3066 language in which error messages are returned; by default it is en_US, which is the only language currently supported.

CancelPreapprovalResponse Message

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

CancelPreapprovalResponse Fields

Field

Description

responseEnvelope

common:ResponseEnvelope

Common response information, including a timestamp and the response acknowledgement status.

ResponseEnvelope Fields

Field

Description

ack

common:AckCode

Acknowledgement code. It is one of the following values:


  • Success – The operation completed successfully.

  • Failure – The operation failed.

  • SuccessWithWarning – The operation completed successfully; however, there is a warning message.

  • FailureWithWarning – The operation failed with a warning message.

build

xs:string

Build number. It is used only by PayPal Merchant Technical Support.

correlationId

xs:string

Correlation identifier. It is a 13-character, alphanumeric string (for example, db87c705a910e) that is used only by PayPal Merchant Technical Support.

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

xs:datetime

Date on which the response was sent, for example:

2012-04-02T22:33:35.774-07:00

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

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

FaultMessage Fields

Field

Description

error

common:ErrorData

Detailed error information.

responseEnvelope

common:ResponseEnvelope

Common response information, including a timestamp and the response acknowledgement status.

ErrorData Fields

Field

Description

category

common:ErrorCategory

The location where the error occurred.

Possible values are:


  • System – The system encountered errors; try again

  • Application – The application encountered errors; try again

  • Request – The request was incorrect

domain

xs:string

The domain to which this service belongs.

errorId

xs:long

A 6-digit number that uniquely identifies a particular error.

exceptionID

This field is not used.

message

xs:string

A description of the error.

parameter

common:ErrorParameter

Represents contextual information about the error.

severity

common:ErrorSeverity

The severity of the error encountered.

Possible values are:


  • Error – Processing of the request was interrupted

  • Warning – Processing of the request was completed

subdomain

This field is not used.

ResponseEnvelope Fields

Field

Description

ack

common:AckCode

Acknowledgement code. It is one of the following values:


  • Success – The operation completed successfully.

  • Failure – The operation failed.

  • SuccessWithWarning – The operation completed successfully; however, there is a warning message.

  • FailureWithWarning – The operation failed with a warning message.

build

xs:string

Build number. It is used only by PayPal Merchant Technical Support.

correlationId

xs:string

Correlation identifier. It is a 13-character, alphanumeric string (for example, db87c705a910e) that is used only by PayPal Merchant Technical Support.

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

xs:datetime

Date on which the response was sent, for example:

2012-04-02T22:33:35.774-07:00

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

Code

Message

Additional Information

520002 Internal error
540031

You don't have permission to cancel this preapproval

589019 The preapproval key is invalid