# Delete an invoice

> Deletes a draft or voided invoice. Invoices in any other status can't be deleted.

Source: https://help.boltapp.com/api-reference/invoicing/invoices/deleteinvoice

`DELETE /v1/invoices/{publicId}`

## OpenAPI definition

This endpoint as it appears in the OpenAPI document, with every schema it references included.

```json
{
  "openapi": "3.2.0",
  "info": {
    "title": "Invoicing API",
    "version": "v1",
    "description": "API for creating and managing invoices, and for listing a customer's invoices in the customer portal."
  },
  "servers": [
    {
      "url": "https://api.boltapp.com",
      "description": "The Production URL (Live Data)."
    },
    {
      "url": "https://api-sandbox.boltapp.com",
      "description": "The Sandbox URL (Test Data)."
    },
    {
      "url": "https://api-staging.boltapp.com",
      "description": "The Staging URL (Staged Data)."
    }
  ],
  "security": [
    {
      "X-API-Key": [],
      "X-Publishable-Key": []
    }
  ],
  "paths": {
    "/v1/invoices/{publicId}": {
      "delete": {
        "operationId": "deleteInvoice",
        "summary": "Delete an invoice",
        "description": "Deletes a draft or voided invoice. Invoices in any other status can't be deleted.",
        "tags": [
          "Invoices"
        ],
        "responses": {
          "200": {
            "description": "The invoice was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "examples": [
                        true
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - the invoice is not a draft or voided."
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden - the invoice belongs to another merchant."
          },
          "404": {
            "description": "Invoice not found."
          }
        }
      },
      "parameters": [
        {
          "in": "path",
          "name": "publicId",
          "schema": {
            "type": "string"
          },
          "required": true,
          "description": "Public ID of the invoice.",
          "examples": {
            "default": {
              "value": "inv_9Pq3Xw7Rt2"
            }
          }
        }
      ]
    }
  },
  "components": {
    "securitySchemes": {
      "X-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "X-Publishable-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Publishable-Key"
      },
      "PortalToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "A customer portal token."
      },
      "PortalTokenQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "token",
        "description": "A customer portal token, passed as a query parameter."
      }
    }
  }
}
```
