Cancel an Invoice {#invoicing-services-cancel-intro}
====================================================

You can cancel an unpaid invoice. Partially paid or fully paid invoices cannot be cancelled.  
Cancelling an invoice requires the invoice number that was assigned when the invoice was created.

Endpoints
---------

Send your API request message to one of these endpoints:  
**Production:** `POST ``https://api.visaacceptance.com``/invoicing/v2/invoices/`*{id}*`/cancelation`  
**Test:** `POST ``https://apitest.visaacceptance.com``/invoicing/v2/invoices/`*{id}*`/cancelation`  
The *`{id}`* is the invoice number from the response to the create invoice request.

Successful Response
-------------------

A successful request is indicated by the `canceled` status in the status response field and an updated time in the submitTimeUtc response field.

Example: Cancelling an Invoice {#invoicing-services-cancel-ex-rest}
===================================================================

Endpoint with an Invoice Number

```keyword
https://apitest.visaacceptance.com/invoicing/v2/invoices/2675/cancelation
```

Request

```
{}
```

Response to a Successful Request

```
{
  "_links": {
    "self": {
      "href": "/v2/invoices/2675",
      "method": "GET"
    }
  },
  "id": "2675",
  "submitTimeUtc": "2024-07-24T19:56:06.410896558Z",
  "status": "CANCELED",
  "customerInformation": {
    "name": "Tanya Lee",
    "email": "tanya.lee@my-email.world",
    "merchantCustomerId": "1234",
    "company": {
      "name": "ABC"
    }
  },
  "processingInformation": {
    "requestPhone": false,
    "requestShipping": false
  },
  "invoiceInformation": {
    "invoiceNumber": "2675",
    "description": "This is a test invoice",
    "dueDate": "2019-07-11",
    "allowPartialPayments": true,
    "deliveryMode": "None"
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": 2623.64,
      "currency": "USD",
      "balanceAmount": 2623.64,
      "discountAmount": 126.08,
      "discountPercent": 5,
      "subAmount": 2749.72,
      "minimumPartialAmount": 20,
      "taxDetails": {
        "type": "State Tax",
        "amount": 208,
        "rate": 8.25
      },
      "freight": {
        "amount": 20,
        "taxable": true
      }
    },
    "lineItems": [
      {
        "productSku": "P653727383",
        "productName": "First line item's name",
        "unitPrice": 12.05,
        "quantity": 20,
        "discountAmount": 13.04,
        "taxAmount": 0,
        "taxRate": 0,
        "totalAmount": 247.86
      }
    ]
  }
}
```

REST Interactive Example: Cancel an Invoice {#invoicing-services-cancel-ex-live}
================================================================================

Click this image to access the interactive code example for cancelling an invoice.

#### Figure:

Interactive Code [![Image and link to the interactive code example for creating a new
invoice.](/content/dam/documentation/cybs/en-us/topics/payments-processing/payment-services/invoicing/images/invoicing-services-cancel-vas.png/jcr:content/renditions/original)](https://developer.visaacceptance.com/api-reference-assets/index.md#invoicing_invoices_cancel-an-invoice "")
