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

# CreateInvoice

POST https://dreamclassapi/v1/financial/invoices/create
Content-Type: application/json

Creates a new Invoice

Input variables

- json representation of new Invoice parameters
    - entityType (student | guardian)
        - to select if you are invoicing a Student or a Guardian
    - entityId
        - the id of the entity you are invoicing
    - schoolPeriodId
        - the id of the School Period you are invoicing
    - feesFromDate
        - include all uninvoiced feed from that date
    - feesToDate
        - include all uninvoiced feed to that date
    - issueDate
    - dueDate
    - privateNotes
    - publicNotes
    - notify (true | false)
        - to send auto notification to the invoice recipient

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /dreamclassapi/v1/financial/invoices/create:
    post:
      operationId: create-invoice
      summary: CreateInvoice
      description: |-
        Creates a new Invoice

        Input variables

        - json representation of new Invoice parameters
            - entityType (student | guardian)
                - to select if you are invoicing a Student or a Guardian
            - entityId
                - the id of the entity you are invoicing
            - schoolPeriodId
                - the id of the School Period you are invoicing
            - feesFromDate
                - include all uninvoiced feed from that date
            - feesToDate
                - include all uninvoiced feed to that date
            - issueDate
            - dueDate
            - privateNotes
            - publicNotes
            - notify (true | false)
                - to send auto notification to the invoice recipient
      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_CreateInvoice_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                notify:
                  type: boolean
                dueDate:
                  type: string
                  format: date
                entityId:
                  type: integer
                issueDate:
                  type: string
                  format: date
                entityType:
                  type: string
                feesToDate:
                  type: string
                  format: date
                publicNotes:
                  type: string
                feesFromDate:
                  type: string
                  format: date
                privateNotes:
                  type: string
                schoolPeriodId:
                  type: integer
              required:
                - notify
                - dueDate
                - entityId
                - issueDate
                - entityType
                - feesToDate
                - publicNotes
                - feesFromDate
                - privateNotes
                - schoolPeriodId
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    DreamclassapiV1FinancialInvoicesCreatePostResponsesContentApplicationJsonSchemaFeesItems:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          description: Any type
        amount:
          type: integer
        status:
          type: string
        expireDate:
          description: Any type
        paidamount:
          type: integer
      required:
        - id
        - name
        - amount
        - status
        - paidamount
      title: >-
        DreamclassapiV1FinancialInvoicesCreatePostResponsesContentApplicationJsonSchemaFeesItems
    Invoices_CreateInvoice_Response_200:
      type: object
      properties:
        id:
          type: integer
        fees:
          type: array
          items:
            $ref: >-
              #/components/schemas/DreamclassapiV1FinancialInvoicesCreatePostResponsesContentApplicationJsonSchemaFeesItems
        email:
          type: string
          format: email
        amount:
          type: integer
        status:
          type: integer
        address:
          type: string
        dueDate:
          type: string
          format: date
        fullname:
          type: string
        payments:
          type: array
          items:
            description: Any type
        createdAt:
          type: string
          format: date-time
        issueDate:
          type: string
          format: date
        telephone:
          type: string
        paidAmount:
          type: integer
        publicNotes:
          type: string
        invoiceRefId:
          description: Any type
        privateNotes:
          type: string
      required:
        - id
        - fees
        - email
        - amount
        - status
        - address
        - dueDate
        - fullname
        - payments
        - createdAt
        - issueDate
        - telephone
        - paidAmount
        - publicNotes
        - privateNotes
      title: Invoices_CreateInvoice_Response_200

```

## Examples



**Request**

```json
{
  "notify": false,
  "dueDate": "2023-06-30",
  "entityId": 16,
  "issueDate": "2023-05-01",
  "entityType": "student",
  "feesToDate": "2023-12-31",
  "publicNotes": "This is a public notes",
  "feesFromDate": "2023-05-01",
  "privateNotes": "some private notes here",
  "schoolPeriodId": 1
}
```

**Response**

```json
{
  "id": 11,
  "fees": [
    {
      "id": 65,
      "name": "Tuition - Monthly Fee",
      "amount": 100,
      "status": "INVOICED",
      "paidamount": 0
    }
  ],
  "email": "test@test.com",
  "amount": 100,
  "status": 1,
  "address": "",
  "dueDate": "2023-06-30",
  "fullname": "John Brown ",
  "payments": [],
  "createdAt": "2024-09-16T10:05:23.633+00:00",
  "issueDate": "2023-05-01",
  "telephone": "123",
  "paidAmount": 0,
  "publicNotes": "This is a public notes",
  "privateNotes": "some private notes here"
}
```

**SDK Code**

```python Invoices_CreateInvoice_example
import requests

url = "https://https/dreamclassapi/v1/financial/invoices/create"

payload = {
    "notify": False,
    "dueDate": "2023-06-30",
    "entityId": 16,
    "issueDate": "2023-05-01",
    "entityType": "student",
    "feesToDate": "2023-12-31",
    "publicNotes": "This is a public notes",
    "feesFromDate": "2023-05-01",
    "privateNotes": "some private notes here",
    "schoolPeriodId": 1
}
headers = {
    "tenant": "{{tenant}}",
    "schoolCode": "{{schoolCode}}",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Invoices_CreateInvoice_example
const url = 'https://https/dreamclassapi/v1/financial/invoices/create';
const options = {
  method: 'POST',
  headers: {
    tenant: '{{tenant}}',
    schoolCode: '{{schoolCode}}',
    'Content-Type': 'application/json'
  },
  body: '{"notify":false,"dueDate":"2023-06-30","entityId":16,"issueDate":"2023-05-01","entityType":"student","feesToDate":"2023-12-31","publicNotes":"This is a public notes","feesFromDate":"2023-05-01","privateNotes":"some private notes here","schoolPeriodId":1}'
};

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

```go Invoices_CreateInvoice_example
package main

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

func main() {

	url := "https://https/dreamclassapi/v1/financial/invoices/create"

	payload := strings.NewReader("{\n  \"notify\": false,\n  \"dueDate\": \"2023-06-30\",\n  \"entityId\": 16,\n  \"issueDate\": \"2023-05-01\",\n  \"entityType\": \"student\",\n  \"feesToDate\": \"2023-12-31\",\n  \"publicNotes\": \"This is a public notes\",\n  \"feesFromDate\": \"2023-05-01\",\n  \"privateNotes\": \"some private notes here\",\n  \"schoolPeriodId\": 1\n}")

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

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

url = URI("https://https/dreamclassapi/v1/financial/invoices/create")

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

request = Net::HTTP::Post.new(url)
request["tenant"] = '{{tenant}}'
request["schoolCode"] = '{{schoolCode}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"notify\": false,\n  \"dueDate\": \"2023-06-30\",\n  \"entityId\": 16,\n  \"issueDate\": \"2023-05-01\",\n  \"entityType\": \"student\",\n  \"feesToDate\": \"2023-12-31\",\n  \"publicNotes\": \"This is a public notes\",\n  \"feesFromDate\": \"2023-05-01\",\n  \"privateNotes\": \"some private notes here\",\n  \"schoolPeriodId\": 1\n}"

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

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

HttpResponse<String> response = Unirest.post("https://https/dreamclassapi/v1/financial/invoices/create")
  .header("tenant", "{{tenant}}")
  .header("schoolCode", "{{schoolCode}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"notify\": false,\n  \"dueDate\": \"2023-06-30\",\n  \"entityId\": 16,\n  \"issueDate\": \"2023-05-01\",\n  \"entityType\": \"student\",\n  \"feesToDate\": \"2023-12-31\",\n  \"publicNotes\": \"This is a public notes\",\n  \"feesFromDate\": \"2023-05-01\",\n  \"privateNotes\": \"some private notes here\",\n  \"schoolPeriodId\": 1\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/dreamclassapi/v1/financial/invoices/create', [
  'body' => '{
  "notify": false,
  "dueDate": "2023-06-30",
  "entityId": 16,
  "issueDate": "2023-05-01",
  "entityType": "student",
  "feesToDate": "2023-12-31",
  "publicNotes": "This is a public notes",
  "feesFromDate": "2023-05-01",
  "privateNotes": "some private notes here",
  "schoolPeriodId": 1
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'schoolCode' => '{{schoolCode}}',
    'tenant' => '{{tenant}}',
  ],
]);

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

```csharp Invoices_CreateInvoice_example
using RestSharp;

var client = new RestClient("https://https/dreamclassapi/v1/financial/invoices/create");
var request = new RestRequest(Method.POST);
request.AddHeader("tenant", "{{tenant}}");
request.AddHeader("schoolCode", "{{schoolCode}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"notify\": false,\n  \"dueDate\": \"2023-06-30\",\n  \"entityId\": 16,\n  \"issueDate\": \"2023-05-01\",\n  \"entityType\": \"student\",\n  \"feesToDate\": \"2023-12-31\",\n  \"publicNotes\": \"This is a public notes\",\n  \"feesFromDate\": \"2023-05-01\",\n  \"privateNotes\": \"some private notes here\",\n  \"schoolPeriodId\": 1\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Invoices_CreateInvoice_example
import Foundation

let headers = [
  "tenant": "{{tenant}}",
  "schoolCode": "{{schoolCode}}",
  "Content-Type": "application/json"
]
let parameters = [
  "notify": false,
  "dueDate": "2023-06-30",
  "entityId": 16,
  "issueDate": "2023-05-01",
  "entityType": "student",
  "feesToDate": "2023-12-31",
  "publicNotes": "This is a public notes",
  "feesFromDate": "2023-05-01",
  "privateNotes": "some private notes here",
  "schoolPeriodId": 1
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/dreamclassapi/v1/financial/invoices/create")! 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()
```