# invoice.finalized

An Invoice was finalized.

## Payload schema

- `object`
  - `api_version` (`any`)
  - `context` (`object`) - Present only when `source` is `api`. Identifies the acting project and API key.
    - `developer_platform_api_key_id` (`string | null`) - format: `uuid`
    - `developer_platform_project_id` (`string | null`) - format: `uuid`
  - `created_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
  - `data` (`object`)
    - `object` (`object`)
      - `booking_ids` (`array`) - The Bookings associated with the Invoice.
        - `items` (`string`) - format: `uuid`
      - `clinician_id` (`string | null`) - format: `uuid`; The Clinician associated with the Invoice.
      - `created_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
      - `currency` (`string | null`) - The ISO 4217 currency code.
      - `id` (`string`) - format: `uuid`; The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.
      - `invoice_notes` (`string | null`) - The sanitized HTML notes on the Invoice.
      - `invoice_number` (`string | null`) - The Invoice number, unique within the Organization.
      - `line_items` (`array`) - The charges included on the Invoice.
        - `items` (`object`)
          - `booking_id` (`string | null`) - format: `uuid`; The Booking associated with the line item.
          - `created_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
          - `currency` (`string | null`) - The ISO 4217 currency code.
          - `discount_amount` (`integer | null`) - The discount in minor currency units.
          - `gross_amount` (`integer | null`) - The gross amount in minor currency units.
          - `id` (`string`) - format: `uuid`; The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.
          - `net_amount` (`integer | null`) - The net amount in minor currency units.
          - `object` (`any`) - Discriminator value emitted at `object`.
          - `quantity` (`number | null`) - The quantity charged.
          - `service_variant_id` (`string | null`) - format: `uuid`; The ServiceVariant associated with the charge.
          - `tax_amount` (`integer | null`) - The tax amount in minor currency units.
          - `title` (`string | null`) - The line item description.
          - `total` (`integer | null`) - The line total in minor currency units.
          - `unit_price` (`integer | null`) - The unit price in minor currency units.
          - `updated_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
      - `links` (`object`) - URLs to related resources.
        - `patient` (`string | null`) - format: `uri`; The full URL of a related resource.
      - `object` (`any`) - Discriminator value emitted at `object`.
      - `patient_id` (`string | null`) - format: `uuid`; The Patient associated with the Invoice.
      - `payor_type` (`string | null`) - The type of party responsible for payment.
      - `status` (`string | null`) - enum: `awaiting_patient`, `being_processed`, `canceled`, `credited_error`, `credited_goodwill`, `credited_other`, `credited_overbilled`, `credited_service_not_delivered`, `draft`, `error`, `no_payment_required`, `overdue`, `overpaid`, `paid`, `partially_credited`, `partially_paid`, `partially_refunded`, `partially_written_off`, `payment_scheduled`, `refunded`, `scheduled_for_sending`, `sent_to_debt_collectors`, `sent_to_insurance_company`, `sent_to_other_recipient`, `unpaid`, `validated`, `written_off_nonpayer`, `written_off_other`, `null`; The Invoice's current status.
      - `subtotal` (`integer | null`) - The subtotal in minor currency units.
      - `supply_date` (`string | null`) - format: `date`; The date on which the invoiced services were supplied.
      - `tax_amount` (`integer | null`) - The tax amount in minor currency units.
      - `title` (`string | null`) - The Invoice title.
      - `total` (`integer`) - The total in minor currency units.
      - `total_discount_amount` (`integer | null`) - The total discount in minor currency units.
      - `total_outstanding` (`integer | null`) - The outstanding amount in minor currency units.
      - `total_paid` (`integer | null`) - The paid amount in minor currency units.
      - `updated_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
  - `developer_platform_project_id` (`string | null`) - format: `uuid`; The project ID whose credential caused the change. Null for `dashboard` events.
  - `id` (`string`) - Event identifier prefixed with `evt_`.
  - `livemode` (`boolean`) - `false` for test-event deliveries.
  - `object` (`any`)
  - `source` (`string`) - enum: `api`, `dashboard`; Origin of the change. `api` means a Developer Platform mutation; `dashboard` means a Carebit-initiated change.
  - `type` (`any`)

### Example payload

```json
{
  "id": "evt_00000000-0000-4000-8000-000000000012",
  "object": "event",
  "api_version": "v1",
  "created_at": "2026-01-01T09:00:00Z",
  "data": {
    "object": {
      "id": "00000000-0000-4000-8000-000000000027",
      "object": "invoice",
      "booking_ids": [
        "00000000-0000-4000-8000-000000000001"
      ],
      "clinician_id": "00000000-0000-4000-8000-000000000002",
      "created_at": "2026-01-01T09:00:00Z",
      "currency": "gbp",
      "invoice_notes": "<p>Payment is due within 30 days.</p>",
      "invoice_number": "INV-1001",
      "line_items": [
        {
          "id": "00000000-0000-4000-8000-000000000028",
          "object": "invoice_line_item",
          "booking_id": "00000000-0000-4000-8000-000000000001",
          "created_at": "2026-01-01T09:00:00Z",
          "currency": "gbp",
          "discount_amount": 0,
          "gross_amount": 25000,
          "net_amount": 25000,
          "quantity": 1,
          "service_variant_id": "00000000-0000-4000-8000-000000000006",
          "tax_amount": 0,
          "title": "Initial consultation",
          "total": 25000,
          "unit_price": 25000,
          "updated_at": "2026-01-01T09:00:00Z"
        }
      ],
      "links": {
        "patient": "https://api.carebit.co/v1/patients/00000000-0000-4000-8000-000000000004"
      },
      "patient_id": "00000000-0000-4000-8000-000000000004",
      "payor_type": "patient",
      "status": "unpaid",
      "subtotal": 25000,
      "supply_date": "2026-01-01",
      "tax_amount": 0,
      "title": "Initial consultation",
      "total": 25000,
      "total_discount_amount": 0,
      "total_outstanding": 25000,
      "total_paid": 0,
      "updated_at": "2026-01-01T09:00:00Z"
    }
  },
  "developer_platform_project_id": null,
  "livemode": false,
  "source": "dashboard",
  "type": "invoice.finalized"
}
```
