> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api-docs.papertracc.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api-docs.papertracc.com/_mcp/server.

# Void Invoice

PATCH https://api.papertracc.com/v1/invoices/{id}/void
Content-Type: application/json

Voids a posted invoice. `reason` is optional unless project configuration requires it.

Reference: https://api-docs.papertracc.com/papertracc/sales/invoices/void-invoice

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /invoices/{id}/void:
    patch:
      operationId: Void Invoice
      summary: Void Invoice
      description: >-
        Voids a posted invoice. `reason` is optional unless project
        configuration requires it.
      tags:
        - invoices
      parameters:
        - name: id
          in: path
          description: Invoice ID.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sales_Invoices_Void Invoice_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
              required:
                - reason
servers:
  - url: https://api.papertracc.com/v1
    description: Production
  - url: https://api.papertracc.com/rc-1
    description: Release Candidate 1
components:
  schemas:
    Sales_Invoices_Void Invoice_Response_200:
      type: object
      properties:
        status:
          type: boolean
        message:
          type: string
      required:
        - status
        - message
      title: Sales_Invoices_Void Invoice_Response_200
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    identityAuth:
      type: apiKey
      in: header
      name: identity
      description: The identity for the active project.

```

## Examples

### Sales_Invoices_Void Invoice_example



**Request**

```json
undefined
```

**Response**

```json
{
  "status": true,
  "message": "Successfully voided invoice"
}
```

**SDK Code**

```python Sales_Invoices_Void Invoice_example
import requests

url = "https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void"

headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, headers=headers)

print(response.json())
```

```javascript Sales_Invoices_Void Invoice_example
const url = 'https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Sales_Invoices_Void Invoice_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Sales_Invoices_Void Invoice_example
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Sales_Invoices_Void Invoice_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Sales_Invoices_Void Invoice_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Sales_Invoices_Void Invoice_example
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Sales_Invoices_Void Invoice_example
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Void a posted invoice



**Request**

```json
{
  "reason": "Customer requested cancellation after the invoice was posted."
}
```

**Response**

```json
{
  "status": true,
  "message": "Successfully voided invoice"
}
```

**SDK Code**

```python Void a posted invoice
import requests

url = "https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void"

payload = { "reason": "Customer requested cancellation after the invoice was posted." }
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Void a posted invoice
const url = 'https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"reason":"Customer requested cancellation after the invoice was posted."}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Void a posted invoice
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void"

	payload := strings.NewReader("{\n  \"reason\": \"Customer requested cancellation after the invoice was posted.\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Void a posted invoice
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"reason\": \"Customer requested cancellation after the invoice was posted.\"\n}"

response = http.request(request)
puts response.read_body
```

```java Void a posted invoice
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reason\": \"Customer requested cancellation after the invoice was posted.\"\n}")
  .asString();
```

```php Void a posted invoice
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void', [
  'body' => '{
  "reason": "Customer requested cancellation after the invoice was posted."
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Void a posted invoice
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"reason\": \"Customer requested cancellation after the invoice was posted.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Void a posted invoice
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["reason": "Customer requested cancellation after the invoice was posted."] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.papertracc.com/v1/invoices/1243891e-40a8-4a88-8e1f-0397adcbf85e/void")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```