> ## 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 ProductTimePasses

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

A ProductTimePass links a TimePass to a Product so that customers purchasing the product automatically receive an amount of check-in time.

**How time is calculated:**

* **Day Pass** (TimePass with MinutesIncluded = null): PassesIncluded is the number of calendar days. The customer can check in any number of times during each calendar day they hold.
* **Time Pass** (TimePass with MinutesIncluded set): PassesIncluded is the number of pass instances (each worth MinutesIncluded minutes). Multiply PassesIncluded by MinutesIncluded to get total hours. For example, PassesIncluded = 10 with a 60-minute time pass gives the customer 10 hours of check-in time to use across different dates.

**When is the time pass released?**

* **Admin sale (via CoworkerProduct):** An admin can choose to release the time pass before payment by setting ActivateNow = true when selling the product.
* **Member purchase (online, active contract):** Time passes are released immediately unless the Store.AlwaysInvoice business setting is enabled, in which case they release after payment.
* **Contact purchase (online, no active contract):** Time passes are released after the product is paid.

Use ExpirationType and ExpiresIn to control when the released time pass expires.

## 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 **`ProductTimePass-List`** role.
</Note>

## Enums

<Accordion title="eRecurrentChargePattern">
  | Value | Name |
  | - | - |
  | 1 | PricePlan |
  | 2 | Day |
  | 3 | Week |
  | 4 | Month |
  | 5 | Year |
  | 6 | LastDayOfMonth |
</Accordion>

## 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="ProductTimePass_Product" type="integer">
  Filter by iD of the product linked to this time pass record.
</ParamField>

<ParamField query="ProductTimePass_Product_Name" type="string">
  Filter by display value for Product.Name..
</ParamField>

<ParamField query="ProductTimePass_TimePass" type="integer">
  Filter by iD of the time pass linked to this record. The type of time pass determines how time is calculated: Day Pass (MinutesIncluded = null) gives calendar days of check-in access; Time Pass (MinutesIncluded set) gives instances worth MinutesIncluded minutes each.
</ParamField>

<ParamField query="ProductTimePass_TimePass_Name" type="string">
  Filter by display value for TimePass.Name..
</ParamField>

<ParamField query="ProductTimePass_PassesIncluded" type="integer">
  Filter by number of passes included: for Day Passes this is the number of calendar days the customer can check in; for Time Passes this is the number of pass instances (each worth the TimePass's MinutesIncluded minutes). Total time = PassesIncluded × MinutesIncluded for time passes.
</ParamField>

<ParamField query="ProductTimePass_ExpireTimeInMonths" type="integer">
  Filter by expiration period in months (legacy field, use ExpiresIn with ExpirationType instead).
</ParamField>

<ParamField query="ProductTimePass_ExpireTimeInWeeks" type="integer">
  Filter by expiration period in weeks (legacy field, use ExpiresIn with ExpirationType instead).
</ParamField>

<ParamField query="ProductTimePass_ExpirationType" type="integer">
  Filter by expiration type for the released time pass: PricePlan (expires at end of billing period of the main contract - customer must have a main contract), Day, Week, Month, Year, or LastDayOfMonth.
</ParamField>

<ParamField query="ProductTimePass_ExpiresIn" type="integer">
  Filter by number of periods (of ExpirationType) until the released time pass expires.
</ParamField>

### Range Filters

<ParamField query="from_ProductTimePass_PassesIncluded" type="integer">
  Filter by number of passes included: for Day Passes this is the number of calendar days the customer can check in; for Time Passes this is the number of pass instances (each worth the TimePass's MinutesIncluded minutes). Total time = PassesIncluded × MinutesIncluded for time passes greater than or equal to this value.
</ParamField>

<ParamField query="to_ProductTimePass_PassesIncluded" type="integer">
  Filter by number of passes included: for Day Passes this is the number of calendar days the customer can check in; for Time Passes this is the number of pass instances (each worth the TimePass's MinutesIncluded minutes). Total time = PassesIncluded × MinutesIncluded for time passes less than or equal to this value.
</ParamField>

<ParamField query="from_ProductTimePass_ExpireTimeInMonths" type="integer">
  Filter by expiration period in months (legacy field, use ExpiresIn with ExpirationType instead) greater than or equal to this value.
</ParamField>

<ParamField query="to_ProductTimePass_ExpireTimeInMonths" type="integer">
  Filter by expiration period in months (legacy field, use ExpiresIn with ExpirationType instead) less than or equal to this value.
</ParamField>

<ParamField query="from_ProductTimePass_ExpireTimeInWeeks" type="integer">
  Filter by expiration period in weeks (legacy field, use ExpiresIn with ExpirationType instead) greater than or equal to this value.
</ParamField>

<ParamField query="to_ProductTimePass_ExpireTimeInWeeks" type="integer">
  Filter by expiration period in weeks (legacy field, use ExpiresIn with ExpirationType instead) less than or equal to this value.
</ParamField>

<ParamField query="from_ProductTimePass_ExpiresIn" type="integer">
  Filter by number of periods (of ExpirationType) until the released time pass expires greater than or equal to this value.
</ParamField>

<ParamField query="to_ProductTimePass_ExpiresIn" type="integer">
  Filter by number of periods (of ExpirationType) until the released time pass expires less than or equal to this value.
</ParamField>

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

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

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

<ParamField query="to_ProductTimePass_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/producttimepasses?page=1&size=15&orderBy=CreatedOn&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/producttimepasses?' + new URLSearchParams({
      page: 1,
      size: 15,
      orderBy: 'CreatedOn',
      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/producttimepasses',
      params={
          'page': 1,
          'size': 15,
          'orderBy': 'CreatedOn',
          'dir': 0 // Ascending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

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

### Filtering by CreatedOn

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

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/producttimepasses?' + new URLSearchParams({
      ProductTimePass_CreatedOn: 'example-value',
      orderBy: 'CreatedOn',
      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/producttimepasses',
      params={
          'ProductTimePass_CreatedOn': 'example-value',
          'orderBy': 'CreatedOn',
          '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/producttimepasses?from_ProductTimePass_UpdatedOn=2025-01-01T00:00&to_ProductTimePass_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/producttimepasses?' + new URLSearchParams({
      from_ProductTimePass_UpdatedOn: '2025-01-01T00:00',
      to_ProductTimePass_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/producttimepasses',
      params={
          'from_ProductTimePass_UpdatedOn': '2025-01-01T00:00',
          'to_ProductTimePass_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="ProductTimePass[]">
  The list of ProductTimePass records matching the query. See the [Get one ProductTimePass](/rest-api/billing/get-producttimepasses-by-id) endpoint for the full list of properties returned for each record.
</ResponseField>

<Warning>
  **Partial records** — The listing endpoint returns a summary representation of each ProductTimePass. The following fields are **not populated** in the `Records[]` response: `ExpireTimeInMonths`, `ExpireTimeInWeeks`.

  To get all fields, fetch the full record using the [Get one ProductTimePass](/rest-api/billing/get-producttimepasses-by-id) endpoint.

  **Important for updates:** When updating a record via `PUT`, always retrieve the full record with a `GET` request first, apply your changes to that complete data, and then send the updated record. Do not use data from a listing response as the base for a `PUT` request, as missing fields may be unintentionally cleared.
</Warning>

<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": [
    {
      "ProductId": 0,
      "ProductName": null,
      "TimePassId": 0,
      "TimePassName": null,
      "PassesIncluded": 0,
      "ExpirationType": 0,
      "ExpiresIn": null,
      "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": "ProductTimePass Example",
      "LocalizationDetails": null,
      "CustomFields": null
    }
  ],
  "CurrentPageSize": 15,
  "CurrentPage": 1,
  "CurrentOrderField": "CreatedOn",
  "CurrentSortDirection": 1,
  "FirstItem": 1,
  "HasNextPage": false,
  "HasPreviousPage": false,
  "LastItem": 1,
  "PageNumber": 1,
  "PageSize": 15,
  "TotalItems": 1,
  "TotalPages": 1
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.