DeleteInvoice API Operation

Deletes a draft invoice.

If the specified invoice is not in the draft state, this API returns an error.

Note that once you've deleted a draft invoice, it can no longer be used. For example, you can no longer access the invoice using GetInvoiceDetails.

Since a deleted invoice can't be accessed, you can reuse its invoice number in another invoice.

The difference between DeleteInvoice and CancelInvoice is that CancelInvoice works on invoices already sent, not on invoices in the draft state. DeleteInvoice, on the other hand, works only on invoices in the draft state.

DeleteInvoiceRequest Message

Use the DeleteInvoiceRequest message to pass the information required to delete a draft invoice.

DeleteInvoiceRequest Fields

Field Description
invoiceID xs:string (Required) The ID of the draft invoice to be deleted. This field cannot be null or blank.
requestEnvelope common:requestEnvelope (Required) Information common to all API requests, such as the language in which error messages are returned.

RequestEnvelope Fields

Field Description
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.

DeleteInvoiceResponse Message

The DeleteInvoiceResponse message indicates whether the specified invoice was successfully deleted, or provides information about an error.

DeleteInvoiceResponse Fields

Field Description
responseEnvelope common:ResponseEnvelope Structure containing information common to all API responses, including a timestamp and the response acknowledgment status. See ResponseEnvelope Fields for details.

PPFault Message

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

FaultMessage Fields

Field Description
error common:ErrorData Detailed error information.
responseEnvelope common:ResponseEnvelope Structure containing information common to all API responses, including a timestamp and the response acknowledgment status. See ResponseEnvelope Fields for details.

ErrorData Fields

Field Description
category common:ErrorCategory The location where the error occurred. Value is:
  • 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. Value is:
  • 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 Acknowledgment code. Value is:
  • 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.

DeleteInvoice API Errors

Code Message Additional Information
520002 Internal error.
520003 Authentication failed. API credentials are incorrect.
520009 Account is restricted.
570054 Invalid token.
570058 Authentication failed. User account is not confirmed.
571001 The specified invoice ID is invalid because the invoice has already been deleted.
571002 The specified invoice cannot be deleted. Only invoices in a draft state can be deleted.
580022 This error code corresponds to validation error messages that deal with errors of supplied parameters.