> 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/sales/bills/void-bill

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /bills/{id}/void:
    patch:
      operationId: Void Bill
      summary: Void Bill
      description: >-
        Voids a posted bill. `reason` is optional unless project configuration
        requires it.
      tags:
        - bills
      parameters:
        - name: id
          in: path
          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_Bills_Void Bill_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_Bills_Void Bill_Response_200:
      type: object
      properties:
        data:
          description: Any type
        status:
          type: boolean
        message:
          type: string
      required:
        - status
        - message
      title: Sales_Bills_Void Bill_Response_200
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    identityAuth:
      type: apiKey
      in: header
      name: identity
      description: The identity for the active project.

```

## Examples



**Request**

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

**Response**

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

**SDK Code**

```python Sales_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 Sales_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 Sales_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 Sales_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 Sales_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 Sales_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 Sales_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 Sales_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()
```