Skip to main content
POST
/
v2
/
invoicing
/
invoices
/
{invoice_id}
/
cancel
Cancel sent invoice
curl --request POST \
  --url https://api-m.sandbox.paypal.com/v2/invoicing/invoices/{invoice_id}/cancel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subject": "<string>",
  "note": "<string>",
  "send_to_invoicer": false,
  "send_to_recipient": true,
  "additional_recipients": [
    "<string>"
  ]
}
'
{
  "name": "INVALID_REQUEST",
  "message": "Request is not well-formed, syntactically incorrect, or violates schema.",
  "details": [
    {
      "issue": "INVALID_STRING_MAX_LENGTH",
      "field": "<string>",
      "value": "<string>",
      "location": "body",
      "description": "Field value exceeded the maximum allowed number of characters."
    }
  ],
  "debug_id": "<string>",
  "links": [
    {
      "href": "<string>",
      "rel": "<string>",
      "method": "GET"
    }
  ]
}

Authorizations

Authorization
string
header
required

Oauth 2.0 authentication

Path Parameters

invoice_id
string
required

The ID of the draft invoice to delete.

Maximum string length: 2147483647

Body

application/json

The email or SMS notification that will be sent to the payer on cancellation.

The email or SMS notification to send to the invoicer or payer on sending an invoice.

subject
string

The subject of the email that is sent as a notification to the recipient.

Note: User-provided values for this field will not be honored and the subject will always be defaulted to a system-defined value.

Maximum string length: 4000
note
string

A note to the payer.

Note: User-provided values for this field will not be honored and the note will always be defaulted to a system-defined value.

Maximum string length: 4000
send_to_invoicer
boolean
default:false

Indicates whether to send a copy of the email to the merchant.

send_to_recipient
boolean
default:true

Indicates whether to send a copy of the email to the recipient.

additional_recipients
string<ppaas_common_email_address_v2>[]

An array of one or more CC: emails to which notifications are sent. If you omit this parameter, a notification is sent to all CC: email addresses that are part of the invoice.

Note: Valid values are email addresses in the additional_recipients value associated with the invoice.

Maximum array length: 100

The internationalized email address.

Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

Required string length: 3 - 254

Response

A successful request returns the HTTP 204 No Content status code with no JSON response body.