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

# Invoice

POST https://#post9
Content-Type: application/json

Webhook related to invoices, trigged upon

- Invoice created: INVOICE_CREATED
    
- Invoice updated: INVOICE_UPDATED
    
- Invoice deleted: INVOICE_DELETED
    

Using the provided id, use the GetInvoie API to retrieve more data. Using the provided fees.id use the GetPeriodFees to retrieve more data

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /#post9:
    post:
      operationId: invoice
      summary: Invoice
      description: >-
        Webhook related to invoices, trigged upon


        - Invoice created: INVOICE_CREATED
            
        - Invoice updated: INVOICE_UPDATED
            
        - Invoice deleted: INVOICE_DELETED
            

        Using the provided id, use the GetInvoie API to retrieve more data.
        Using the provided fees.id use the GetPeriodFees to retrieve more data
      tags:
        - subpackage_webhooks
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhooks_Invoice_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                data:
                  $ref: >-
                    #/components/schemas/Post9PostRequestBodyContentApplicationJsonSchemaData
                type:
                  type: string
                tenant:
                  type: string
                signature:
                  type: string
                timestamp:
                  type: integer
              required:
                - id
                - data
                - type
                - tenant
                - signature
                - timestamp
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    Post9PostRequestBodyContentApplicationJsonSchemaDataFeesItems:
      type: object
      properties:
        id:
          type: integer
      required:
        - id
      title: Post9PostRequestBodyContentApplicationJsonSchemaDataFeesItems
    Post9PostRequestBodyContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: integer
        fees:
          type: array
          items:
            $ref: >-
              #/components/schemas/Post9PostRequestBodyContentApplicationJsonSchemaDataFeesItems
        email:
          type: string
          format: email
        amount:
          type: integer
        status:
          type: integer
        address:
          type: string
        dueDate:
          type: string
          format: date
        fullname:
          type: string
        createdAt:
          type: string
          format: date-time
        issueDate:
          type: string
          format: date
        telephone:
          type: string
        publicNotes:
          description: Any type
        invoiceRefId:
          type: string
        privateNotes:
          description: Any type
      required:
        - id
        - fees
        - email
        - amount
        - status
        - address
        - dueDate
        - fullname
        - createdAt
        - issueDate
        - telephone
        - invoiceRefId
      title: Post9PostRequestBodyContentApplicationJsonSchemaData
    Webhooks_Invoice_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Webhooks_Invoice_Response_200

```

## Examples



**Request**

```json
{
  "id": "aa3a27d6-05b5-4fcd-bd04-505bfffacfc2",
  "data": {
    "id": 16,
    "fees": [
      {
        "id": 86
      },
      {
        "id": 85
      },
      {
        "id": 84
      }
    ],
    "email": "test@test.com",
    "amount": 300,
    "status": 1,
    "address": "Address 1",
    "dueDate": "2024-10-31",
    "fullname": "John Sample",
    "createdAt": "2024-10-02T16:02:00.544+00:00",
    "issueDate": "2024-10-01",
    "telephone": "123456789",
    "invoiceRefId": "abc123"
  },
  "type": "INVOICE_CREATED",
  "tenant": "my-school",
  "signature": "4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=",
  "timestamp": 1727884920561
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://https/#post9"

payload = {
    "id": "aa3a27d6-05b5-4fcd-bd04-505bfffacfc2",
    "data": {
        "id": 16,
        "fees": [{ "id": 86 }, { "id": 85 }, { "id": 84 }],
        "email": "test@test.com",
        "amount": 300,
        "status": 1,
        "address": "Address 1",
        "dueDate": "2024-10-31",
        "fullname": "John Sample",
        "createdAt": "2024-10-02T16:02:00.544+00:00",
        "issueDate": "2024-10-01",
        "telephone": "123456789",
        "invoiceRefId": "abc123"
    },
    "type": "INVOICE_CREATED",
    "tenant": "my-school",
    "signature": "4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=",
    "timestamp": 1727884920561
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://https/#post9';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"id":"aa3a27d6-05b5-4fcd-bd04-505bfffacfc2","data":{"id":16,"fees":[{"id":86},{"id":85},{"id":84}],"email":"test@test.com","amount":300,"status":1,"address":"Address 1","dueDate":"2024-10-31","fullname":"John Sample","createdAt":"2024-10-02T16:02:00.544+00:00","issueDate":"2024-10-01","telephone":"123456789","invoiceRefId":"abc123"},"type":"INVOICE_CREATED","tenant":"my-school","signature":"4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=","timestamp":1727884920561}'
};

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/#post9"

	payload := strings.NewReader("{\n  \"id\": \"aa3a27d6-05b5-4fcd-bd04-505bfffacfc2\",\n  \"data\": {\n    \"id\": 16,\n    \"fees\": [\n      {\n        \"id\": 86\n      },\n      {\n        \"id\": 85\n      },\n      {\n        \"id\": 84\n      }\n    ],\n    \"email\": \"test@test.com\",\n    \"amount\": 300,\n    \"status\": 1,\n    \"address\": \"Address 1\",\n    \"dueDate\": \"2024-10-31\",\n    \"fullname\": \"John Sample\",\n    \"createdAt\": \"2024-10-02T16:02:00.544+00:00\",\n    \"issueDate\": \"2024-10-01\",\n    \"telephone\": \"123456789\",\n    \"invoiceRefId\": \"abc123\"\n  },\n  \"type\": \"INVOICE_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=\",\n  \"timestamp\": 1727884920561\n}")

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

	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/#post9")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"id\": \"aa3a27d6-05b5-4fcd-bd04-505bfffacfc2\",\n  \"data\": {\n    \"id\": 16,\n    \"fees\": [\n      {\n        \"id\": 86\n      },\n      {\n        \"id\": 85\n      },\n      {\n        \"id\": 84\n      }\n    ],\n    \"email\": \"test@test.com\",\n    \"amount\": 300,\n    \"status\": 1,\n    \"address\": \"Address 1\",\n    \"dueDate\": \"2024-10-31\",\n    \"fullname\": \"John Sample\",\n    \"createdAt\": \"2024-10-02T16:02:00.544+00:00\",\n    \"issueDate\": \"2024-10-01\",\n    \"telephone\": \"123456789\",\n    \"invoiceRefId\": \"abc123\"\n  },\n  \"type\": \"INVOICE_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=\",\n  \"timestamp\": 1727884920561\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.post("https://https/#post9")
  .header("Content-Type", "application/json")
  .body("{\n  \"id\": \"aa3a27d6-05b5-4fcd-bd04-505bfffacfc2\",\n  \"data\": {\n    \"id\": 16,\n    \"fees\": [\n      {\n        \"id\": 86\n      },\n      {\n        \"id\": 85\n      },\n      {\n        \"id\": 84\n      }\n    ],\n    \"email\": \"test@test.com\",\n    \"amount\": 300,\n    \"status\": 1,\n    \"address\": \"Address 1\",\n    \"dueDate\": \"2024-10-31\",\n    \"fullname\": \"John Sample\",\n    \"createdAt\": \"2024-10-02T16:02:00.544+00:00\",\n    \"issueDate\": \"2024-10-01\",\n    \"telephone\": \"123456789\",\n    \"invoiceRefId\": \"abc123\"\n  },\n  \"type\": \"INVOICE_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=\",\n  \"timestamp\": 1727884920561\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/#post9', [
  'body' => '{
  "id": "aa3a27d6-05b5-4fcd-bd04-505bfffacfc2",
  "data": {
    "id": 16,
    "fees": [
      {
        "id": 86
      },
      {
        "id": 85
      },
      {
        "id": 84
      }
    ],
    "email": "test@test.com",
    "amount": 300,
    "status": 1,
    "address": "Address 1",
    "dueDate": "2024-10-31",
    "fullname": "John Sample",
    "createdAt": "2024-10-02T16:02:00.544+00:00",
    "issueDate": "2024-10-01",
    "telephone": "123456789",
    "invoiceRefId": "abc123"
  },
  "type": "INVOICE_CREATED",
  "tenant": "my-school",
  "signature": "4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=",
  "timestamp": 1727884920561
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://https/#post9");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"id\": \"aa3a27d6-05b5-4fcd-bd04-505bfffacfc2\",\n  \"data\": {\n    \"id\": 16,\n    \"fees\": [\n      {\n        \"id\": 86\n      },\n      {\n        \"id\": 85\n      },\n      {\n        \"id\": 84\n      }\n    ],\n    \"email\": \"test@test.com\",\n    \"amount\": 300,\n    \"status\": 1,\n    \"address\": \"Address 1\",\n    \"dueDate\": \"2024-10-31\",\n    \"fullname\": \"John Sample\",\n    \"createdAt\": \"2024-10-02T16:02:00.544+00:00\",\n    \"issueDate\": \"2024-10-01\",\n    \"telephone\": \"123456789\",\n    \"invoiceRefId\": \"abc123\"\n  },\n  \"type\": \"INVOICE_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=\",\n  \"timestamp\": 1727884920561\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "id": "aa3a27d6-05b5-4fcd-bd04-505bfffacfc2",
  "data": [
    "id": 16,
    "fees": [["id": 86], ["id": 85], ["id": 84]],
    "email": "test@test.com",
    "amount": 300,
    "status": 1,
    "address": "Address 1",
    "dueDate": "2024-10-31",
    "fullname": "John Sample",
    "createdAt": "2024-10-02T16:02:00.544+00:00",
    "issueDate": "2024-10-01",
    "telephone": "123456789",
    "invoiceRefId": "abc123"
  ],
  "type": "INVOICE_CREATED",
  "tenant": "my-school",
  "signature": "4sB3kHjsoz0srhd/dd+55xSKhlFd/hUXzyrMIJWrXTM=",
  "timestamp": 1727884920561
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/#post9")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```