> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dentolize.com/llms.txt
> Use this file to discover all available pages before exploring further.

# New Invoice

> Normalized invoice request sent when an invoice is created.

Invoice creation requests bundle totals, line items, and contextual patient details.

| Field              | Type   | Details                                                |
| ------------------ | ------ | ------------------------------------------------------ |
| id                 | string | Invoice identifier.                                    |
| total              | number | Total amount after all adjustments.                    |
| tax                | number | Tax value.                                             |
| discount           | number | Discount amount.                                       |
| subtotal           | number | Amount before tax and discount.                        |
| taxPercent         | number | Tax percentage applied.                                |
| discountPercent    | number | Discount percentage applied.                           |
| file\_no           | string | Invoice number (`payload.invoiceId`).                  |
| reference\_no      | string | External reference (`payload.referenceId`).            |
| invoice\_line\_ids | array  | Line items for services performed.                     |
| patient\_id        | string | Identifier for the billed patient.                     |
| patient\_data      | object | Patient snapshot with identifiers and contact info.    |
| branch\_data       | object | Branch context (`id`, `name`) when available.          |
| doctor\_data       | object | Treating doctor details (`id`, `name`) when available. |

### Invoice line schema

| Field       | Type   | Details                                  |
| ----------- | ------ | ---------------------------------------- |
| product\_id | string | Source operation identifier.             |
| quantity    | number | Units billed.                            |
| price\_unit | number | Price per unit.                          |
| name        | string | Display name of the billed service.      |
| service\_id | string | Linked procedure identifier, if present. |

```json theme={null}
{
  "id": "inv_2001",
  "total": 180,
  "tax": 20,
  "discount": 10,
  "subtotal": 170,
  "taxPercent": 12,
  "discountPercent": 5,
  "file_no": "INV-1",
  "reference_no": "REF-INV-1",
  "invoice_line_ids": [
    {
      "product_id": "op_01",
      "quantity": 1,
      "price_unit": 150,
      "name": "Extraction",
      "service_id": "proc_11"
    }
  ],
  "patient_id": "pat_123",
  "patient_data": {
    "id": "pat_123",
    "name": "Jane Doe",
    "file_no": "PT-00017",
    "reference_no": "REF-883",
    "nationalId": "1234567890",
    "phone": "+1",
    "mobile": "5551234567"
  },
  "branch_data": {
    "id": "br_01",
    "name": "Main Branch"
  },
  "doctor_data": {
    "id": "doc_09",
    "name": "Dr. Smith"
  }
}
```
