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

# DeleteInvoice

DELETE https://dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D

Deletes a single invoice

Input variables

- invoiceId: number of the invoice

Reference: https://apidoc.dreamclass.io/dream-class-api/invoices/delete-invoice

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D:
    delete:
      operationId: delete-invoice
      summary: DeleteInvoice
      description: |-
        Deletes a single invoice

        Input variables

        - invoiceId: number of the invoice
      tags:
        - subpackage_invoices
      parameters:
        - name: tenant
          in: header
          required: false
          schema:
            type: string
        - name: schoolCode
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoices_DeleteInvoice_Response_200'
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    Invoices_DeleteInvoice_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Invoices_DeleteInvoice_Response_200

```

## Examples



**Request**

```json
{
  "invoiceId": 12345
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://https/dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D"

payload = { "invoiceId": 12345 }
headers = {
    "tenant": "springfield-school",
    "schoolCode": "SPF123",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://https/dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D';
const options = {
  method: 'DELETE',
  headers: {
    tenant: 'springfield-school',
    schoolCode: 'SPF123',
    'Content-Type': 'application/json'
  },
  body: '{"invoiceId":12345}'
};

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

```go
package main

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

func main() {

	url := "https://https/dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D"

	payload := strings.NewReader("{\n  \"invoiceId\": 12345\n}")

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

	req.Header.Add("tenant", "springfield-school")
	req.Header.Add("schoolCode", "SPF123")
	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
require 'uri'
require 'net/http'

url = URI("https://https/dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D")

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

request = Net::HTTP::Delete.new(url)
request["tenant"] = 'springfield-school'
request["schoolCode"] = 'SPF123'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"invoiceId\": 12345\n}"

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

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

HttpResponse<String> response = Unirest.delete("https://https/dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D")
  .header("tenant", "springfield-school")
  .header("schoolCode", "SPF123")
  .header("Content-Type", "application/json")
  .body("{\n  \"invoiceId\": 12345\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://https/dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D', [
  'body' => '{
  "invoiceId": 12345
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'schoolCode' => 'SPF123',
    'tenant' => 'springfield-school',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://https/dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D");
var request = new RestRequest(Method.DELETE);
request.AddHeader("tenant", "springfield-school");
request.AddHeader("schoolCode", "SPF123");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"invoiceId\": 12345\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "tenant": "springfield-school",
  "schoolCode": "SPF123",
  "Content-Type": "application/json"
]
let parameters = ["invoiceId": 12345] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/dreamclassapi/v1/financial/invoices/delete/%7BinvoiceId%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```