> 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 Bill

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

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

Reference: https://api-docs.papertracc.com/papertracc/purchases/bills/void-bill

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.
- `identity` header (required) — The identity for the active project.

## Servers

- `https://api.papertracc.com/v1` (Production, default)
- `https://api.papertracc.com/rc-1` (Release Candidate 1)

## Request

### Path parameters

- `id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `reason` (string, optional)

## Response

### 200

OK

- `status` (boolean, required)
- `message` (string, required)
- `data` (any, optional)

## Examples

**Request**

```json
{
  "reason": "Created in error"
}
```

**Response**

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

**SDK Code**

```python Purchases_Bills_Void Bill_example
import requests

url = "https://api.papertracc.com/v1/bills/id/void"

payload = { "reason": "Created in error" }
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Purchases_Bills_Void Bill_example
const url = 'https://api.papertracc.com/v1/bills/id/void';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"reason":"Created in error"}'
};

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

```go Purchases_Bills_Void Bill_example
package main

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

func main() {

	url := "https://api.papertracc.com/v1/bills/id/void"

	payload := strings.NewReader("{\n  \"reason\": \"Created in error\"\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 Purchases_Bills_Void Bill_example
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/bills/id/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\": \"Created in error\"\n}"

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

```java Purchases_Bills_Void Bill_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.papertracc.com/v1/bills/id/void")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reason\": \"Created in error\"\n}")
  .asString();
```

```php Purchases_Bills_Void Bill_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.papertracc.com/v1/bills/id/void', [
  'body' => '{
  "reason": "Created in error"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Purchases_Bills_Void Bill_example
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/bills/id/void");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"reason\": \"Created in error\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Purchases_Bills_Void Bill_example
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["reason": "Created in error"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.papertracc.com/v1/bills/id/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()
```