# Draft invoice history

A billing-history record connecting a client and job to draft-invoice metadata.

## Fields

| Name | Type | Format | Nullable | Description | Example |
|  --- | --- | --- | --- | --- | --- |
| `clientId` | integer | — | Yes | Client identifier. | `7720` |
| `invoiceId` | integer | — | Yes | Invoice identifier. | `125890` |
| `jobId` | integer | — | Yes | Associated job or project identifier. | `2514` |
| `client` | object | [ClientSummary](#clientsummary) | Yes | Client summary. | — |
| `draftInvoice` | object | [DraftInvoice](#draftinvoice) | Yes | Draft-invoice metadata. | — |


## ClientSummary

| Name | Type | Format | Nullable | Description | Example |
|  --- | --- | --- | --- | --- | --- |
| `active` | boolean | — | Yes | Whether the client is active. | `true` |
| `clientRef` | string | — | Yes | External client reference. | `"TF-2024-789"` |
| `name` | string | — | Yes | Client name. | `"TechFlow Enterprises"` |
| `pmsRef` | string | — | Yes | Practice-management-system reference. | `"240815"` |


## DraftInvoice

| Name | Type | Format | Nullable | Description | Example |
|  --- | --- | --- | --- | --- | --- |
| `approvedAt` | string | date-time (ISO 8601) | Yes | Approval timestamp. | `"2024-03-15T14:32:18+00:00"` |
| `arTranId` | integer | — | Yes | Associated AR transaction identifier. | `125890` |
| `approverStaffId` | integer | — | Yes | Assigned approver identifier. | `301` |
| `approvedByStaffId` | integer | — | Yes | Staff member who approved the draft. | `301` |
| `invoiceId` | integer | — | Yes | Invoice identifier. | `125890` |
| `isActive` | boolean | — | Yes | Whether the draft is active. | `true` |
| `pms_invoice_number` | string | — | Yes | Invoice number in the practice-management system. | `"INV-2024-4850"` |
| `status` | string | — | Yes | Draft-invoice status. | `"APPROVED"` |
| `attachTimeEntries` | boolean | — | Yes | Whether time entries are attached to the invoice. | `false` |
| `automaticallyBillOn` | string | date-time (ISO 8601) | Yes | When the draft is scheduled to bill automatically. Null when it is not scheduled. | `null` |
| `billAddressContactInfoId` | integer | — | Yes | Identifier of the contact info used as the bill-to address. | `4410` |
| `billerStaffId` | integer | — | No | Identifier of the biller staff member. | `301` |
| `createdAt` | string | date-time (ISO 8601) | No | When the draft was created. | `"2024-05-12T22:50:20.595961+00:00"` |
| `createdByStaffId` | integer | — | Yes | Identifier of the staff member who created the draft. | `301` |
| `currentAssignedStaffId` | integer | — | No | Identifier of the staff member the draft is currently assigned to. | `301` |
| `deliveryMethod` | string | — | Yes | How the invoice will be delivered: EMAIL, DOWNLOAD, EMAIL_AND_DOWNLOAD or POST_ONLY. | `"EMAIL"` |
| `emailRecipients` | string | — | Yes | Email recipients for the invoice. | `"ap@techflow.example"` |
| `expenseLineItemStrategy` | string | — | Yes | How expenses are presented as line items: SINGLE_LINE, HIDE or ALL. | `"HIDE"` |
| `invoiceDate` | string | date (ISO 8601) | Yes | Invoice date to use when the draft is billed. | `null` |
| `lineItemStrategy` | string | — | Yes | How time is presented as line items. | `"JOB"` |
| `postOn` | string | date (ISO 8601) | Yes | Date the invoice is scheduled to post. | `null` |
| `reversalReason` | string | — | Yes | Reason the draft was reversed. | `null` |
| `reversedAt` | string | date-time (ISO 8601) | Yes | When the draft was reversed. | `null` |
| `reversedByStaffId` | integer | — | Yes | Identifier of the staff member who reversed the draft. | `null` |
| `reviewedAt` | string | date-time (ISO 8601) | Yes | When the draft was reviewed. | `"2024-03-14T10:05:00+00:00"` |
| `reviewedByStaffId` | integer | — | Yes | Identifier of the staff member who reviewed the draft. | `301` |
| `reviewerStaffId` | integer | — | No | Identifier of the reviewer staff member. | `301` |
| `scheduledByStaffId` | integer | — | Yes | Identifier of the staff member who scheduled the draft. | `null` |
| `senderStaffId` | integer | — | No | Identifier of the sender staff member. | `301` |
| `timeEntryGrouping` | string | — | Yes | How attached time entries are grouped. | `null` |
| `timeEntryPageOrientation` | string | — | Yes | Page orientation of attached time entries. | `null` |
| `updatedAt` | string | date-time (ISO 8601) | No | When the draft was last updated. | `"2024-05-12T22:50:20.595961+00:00"` |
| `wipUnbilledAsOf` | string | date-time (ISO 8601) | Yes | Cut-off date for unbilled WIP included in the draft. | `null` |