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

# Search CoworkerInvoiceHistories

> Search and list CoworkerInvoiceHistory records with filtering, sorting, and pagination.

A **CoworkerInvoiceHistory** records a history entry for a customer invoice. Each entry captures an activity or event that occurred on that invoice, such as the invoice being sent, an e-invoicing action, a payment receipt, or a payment error.

Use `IsProblem` to flag entries that represent errors or issues (e.g. a failed payment attempt). Set `Notify` to trigger a notification when the history entry is created.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`CoworkerInvoiceHistory-List`** role.
</Note>

## Query Parameters

### Pagination & Sorting

<ParamField query="page" type="integer" default="1">
  The page number to retrieve.
</ParamField>

<ParamField query="size" type="integer" default="25">
  The number of records per page.
</ParamField>

<ParamField query="orderBy" type="string">
  The property name to sort results by (e.g. `Name`, `CreatedOn`).
</ParamField>

<ParamField query="dir" type="integer">
  Sort direction. `0` for ascending, `1` for descending.
</ParamField>

### Filters

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice" type="integer">
  Filter by Coworker Invoice Id.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_Coworker_Id" type="integer">
  Filter by Coworker Invoice Coworker Id.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_Business_Id" type="integer">
  Filter by Coworker Invoice Business Id.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_Business_Currency_Code" type="string">
  Filter by Coworker Invoice Business Currency Code.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_Coworker_FullName" type="string">
  Filter by full name of the customer who owns the invoice.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_TotalAmount" type="string">
  Filter by total amount of the related customer invoice.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_InvoiceNumber" type="string">
  Filter by invoice number of the related customer invoice.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_BillToName" type="string">
  Filter by Coworker Invoice Bill To Name.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_Paid" type="string">
  Filter by whether the related customer invoice has been fully paid.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_PaidOn" type="string">
  Filter by Coworker Invoice Paid On.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_Refunded" type="boolean">
  Filter by Coworker Invoice Refunded.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_RefundedOn" type="string">
  Filter by Coworker Invoice Refunded On.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_DueDate" type="string">
  Filter by Coworker Invoice Due Date.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_CoworkerInvoice_Draft" type="string">
  Filter by whether the related customer invoice is still in draft.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_Name" type="string">
  Filter by short title of the history entry (e.g. 'Invoice sent', 'Payment received').
</ParamField>

<ParamField query="CoworkerInvoiceHistory_Description" type="string">
  Filter by detailed description of the activity or event recorded by this history entry.
</ParamField>

<ParamField query="CoworkerInvoiceHistory_IsProblem" type="boolean">
  Filter by flags this history entry as an error or issue (e.g. a failed payment attempt or e-invoicing error).
</ParamField>

<ParamField query="CoworkerInvoiceHistory_Notify" type="boolean">
  Filter by whether to send a notification when this history entry is created.
</ParamField>

### Range Filters

<ParamField query="from_CoworkerInvoiceHistory_CoworkerInvoiceCoworkerId" type="integer">
  Filter by coworker invoice coworker id greater than or equal to this value.
</ParamField>

<ParamField query="to_CoworkerInvoiceHistory_CoworkerInvoiceCoworkerId" type="integer">
  Filter by coworker invoice coworker id less than or equal to this value.
</ParamField>

<ParamField query="from_CoworkerInvoiceHistory_CoworkerInvoiceBusinessId" type="integer">
  Filter by coworker invoice business id greater than or equal to this value.
</ParamField>

<ParamField query="to_CoworkerInvoiceHistory_CoworkerInvoiceBusinessId" type="integer">
  Filter by coworker invoice business id less than or equal to this value.
</ParamField>

<ParamField query="from_CoworkerInvoiceHistory_CoworkerInvoicePaidOn" type="string">
  Filter by coworker invoice paid on greater than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_CoworkerInvoiceHistory_CoworkerInvoicePaidOn" type="string">
  Filter by coworker invoice paid on less than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="from_CoworkerInvoiceHistory_CoworkerInvoiceRefundedOn" type="string">
  Filter by coworker invoice refunded on greater than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_CoworkerInvoiceHistory_CoworkerInvoiceRefundedOn" type="string">
  Filter by coworker invoice refunded on less than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="from_CoworkerInvoiceHistory_CoworkerInvoiceDueDate" type="string">
  Filter by coworker invoice due date greater than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_CoworkerInvoiceHistory_CoworkerInvoiceDueDate" type="string">
  Filter by coworker invoice due date less than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="from_CoworkerInvoiceHistory_CreatedOn" type="string">
  Filter records created on or after this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_CoworkerInvoiceHistory_CreatedOn" type="string">
  Filter records created on or before this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="from_CoworkerInvoiceHistory_UpdatedOn" type="string">
  Filter records updated on or after this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_CoworkerInvoiceHistory_UpdatedOn" type="string">
  Filter records updated on or before this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

## Code Examples

### Simple listing

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/billing/coworkerinvoicehistories?page=1&size=15&orderBy=Name&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/coworkerinvoicehistories?' + new URLSearchParams({
      page: 1,
      size: 15,
      orderBy: 'Name',
      dir: 1 // Ascending
    }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/billing/coworkerinvoicehistories',
      params={
          'page': 1,
          'size': 15,
          'orderBy': 'Name',
          'dir': 0 // Ascending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

### Filtering by Name

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/billing/coworkerinvoicehistories?CoworkerInvoiceHistory_Name=example-value&orderBy=Name&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/coworkerinvoicehistories?' + new URLSearchParams({
      CoworkerInvoiceHistory_Name: 'example-value',
      orderBy: 'Name',
      dir: 1
    }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/billing/coworkerinvoicehistories',
      params={
          'CoworkerInvoiceHistory_Name': 'example-value',
          'orderBy': 'Name',
          'dir': 0 // Ascending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

### Range filters

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/billing/coworkerinvoicehistories?from_CoworkerInvoiceHistory_UpdatedOn=2025-01-01T00:00&to_CoworkerInvoiceHistory_UpdatedOn=2025-12-31T23:59&orderBy=UpdatedOn&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/coworkerinvoicehistories?' + new URLSearchParams({
      from_CoworkerInvoiceHistory_UpdatedOn: '2025-01-01T00:00',
      to_CoworkerInvoiceHistory_UpdatedOn: '2025-12-31T23:59',
      orderBy: 'UpdatedOn',
      dir: 1 // Descending
     }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/billing/coworkerinvoicehistories',
      params={
          'from_CoworkerInvoiceHistory_UpdatedOn': '2025-01-01T00:00',
          'to_CoworkerInvoiceHistory_UpdatedOn': '2025-12-31T23:59',
          'orderBy': 'UpdatedOn',
          'dir': 1 // Descending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Records" type="CoworkerInvoiceHistory[]">
  The list of CoworkerInvoiceHistory records matching the query. See the [Get one CoworkerInvoiceHistory](/rest-api/billing/get-coworkerinvoicehistories-by-id) endpoint for the full list of properties returned for each record.
</ResponseField>

<ResponseField name="CurrentPage" type="integer">
  Current page number.
</ResponseField>

<ResponseField name="CurrentPageSize" type="integer">
  Number of records per page.
</ResponseField>

<ResponseField name="CurrentOrderField" type="string">
  The field used for sorting.
</ResponseField>

<ResponseField name="CurrentSortDirection" type="integer">
  The sort direction (`0` = ascending, `1` = descending).
</ResponseField>

<ResponseField name="FirstItem" type="integer">
  Index of the first item on the current page.
</ResponseField>

<ResponseField name="LastItem" type="integer">
  Index of the last item on the current page.
</ResponseField>

<ResponseField name="TotalItems" type="integer">
  Total number of matching records across all pages.
</ResponseField>

<ResponseField name="TotalPages" type="integer">
  Total number of pages.
</ResponseField>

<ResponseField name="HasNextPage" type="boolean">
  Whether there is a next page of results.
</ResponseField>

<ResponseField name="HasPreviousPage" type="boolean">
  Whether there is a previous page of results.
</ResponseField>

```json Example Response theme={null}
{
  "Records": [
    {
      "CoworkerInvoiceId": 0,
      "CoworkerInvoiceCoworkerId": null,
      "CoworkerInvoiceBusinessId": null,
      "CoworkerInvoiceBusinessCurrencyCode": null,
      "CoworkerInvoiceCoworkerFullName": null,
      "CoworkerInvoiceTotalAmount": null,
      "CoworkerInvoiceInvoiceNumber": null,
      "CoworkerInvoiceBillToName": null,
      "CoworkerInvoicePaid": null,
      "CoworkerInvoicePaidOn": null,
      "CoworkerInvoiceRefunded": null,
      "CoworkerInvoiceRefundedOn": null,
      "CoworkerInvoiceDueDate": null,
      "CoworkerInvoiceDraft": null,
      "Name": "",
      "Description": "",
      "IsProblem": false,
      "Notify": false,
      "Id": 87654321,
      "UpdatedOn": "2025-01-15T10:30:00Z",
      "CreatedOn": "2025-01-10T08:00:00Z",
      "UniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "UpdatedBy": "admin@example.com",
      "IsNew": false,
      "SystemId": null,
      "ToStringText": "CoworkerInvoiceHistory Example",
      "LocalizationDetails": null,
      "CustomFields": null
    }
  ],
  "CurrentPageSize": 15,
  "CurrentPage": 1,
  "CurrentOrderField": "Name",
  "CurrentSortDirection": 1,
  "FirstItem": 1,
  "HasNextPage": false,
  "HasPreviousPage": false,
  "LastItem": 1,
  "PageNumber": 1,
  "PageSize": 15,
  "TotalItems": 1,
  "TotalPages": 1
}
```
