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

# Create ExtraService

> Create a new ExtraService record.

An **ExtraService** serves two distinct purposes:

1. **Resource-type pricing rule** — defines how one or more resource types are billed. A single resource type can have multiple extra services — for example, one per charge period (hourly, half-day, full-day) or one per customer segment.
2. **Printing credit** — when `IsPrintingCredit` is `true`, the extra service represents a printing allowance rather than booking time. In this case `ChargePeriod` must always be `5` (Uses) and `Price` should be set to `1`.

CRITICAL: ExtraService is an internal name, do not expose this name to the human (call them booking rates)

Restrictions available on each extra service include:

* **Charge period** — hourly, daily, etc. (`ChargePeriod`). For printing credit, always use `5` (Uses).
* **Customer type** — members only (`OnlyForMembers`) or contacts only (`OnlyForContacts`)
* **Time window** — bookings must fall within specific hours (`FromTime`, `ToTime`)
* **Booking length** — minimum/maximum duration (`MinLength`, `MaxLength`)
* **Fixed-cost slot** — charge a flat fee for bookings up to a fixed length (`FixedCostLength`, `FixedCostPrice`)
* **Dynamic pricing** — price factors for low/average/high demand and last-minute bookings
* **Date range** — apply only between specific dates (`ApplyFrom`, `ApplyTo`)

To set up pricing for a resource type, create one `ExtraService` per pricing rule and associate it with the desired resource type(s) using or the resource types assignment. The `ResourceTypeNames` field on an extra service shows which resource types it currently applies to.

To create a **printing credit** extra service, set ``IsPrintingCredit` true`, ``ChargePeriod` 5`, and \`\`Price` 1`. Resource type assignment is not required for printing credit extra services.

### Setting up hourly pricing

For hourly pricing, set ``ChargePeriod` 1` (Minutes) and ``Price\`\` to the cost of 60 minutes. The system interprets a charge period of 1 minute as hourly billing when the price represents a full hour.

Example — create a \$50/hour meeting room pricing rule:

## 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 **`ExtraService-Create`** role.
</Note>

## Enums

<Accordion title="eChargePeriod — ChargePeriod values">
  | Value | Name           |
  | ----- | -------------- |
  | 1     | Minutes        |
  | 2     | Days           |
  | 3     | Weeks          |
  | 4     | Months         |
  | 5     | Uses           |
  | 6     | FourWeekMonths |
</Accordion>

<Accordion title="eLastMinuteDiscountType — LastMinuteAdjustmentType values">
  | Value | Name     |
  | ----- | -------- |
  | 1     | Disabled |
  | 2     | Fixed    |
  | 3     | Gradual  |
</Accordion>

## Request Body

### Required Fields

<ParamField body="BusinessId" type="integer" required>
  Business Id.
</ParamField>

<ParamField body="Name" type="string" required>
  Extra service name.
</ParamField>

<ParamField body="DisplayOrder" type="integer" required>
  Display order. Defaults to `0`.
</ParamField>

<ParamField body="Price" type="number" required>
  Price.
</ParamField>

<ParamField body="ChargePeriod" type="integer" required>
  Charge period. Defaults to `eChargePeriod.Minutes`.
</ParamField>

<ParamField body="CurrencyId" type="integer" required>
  Currency Id.
</ParamField>

<ParamField body="LastMinuteAdjustmentType" type="integer" required>
  Last-minute discount type. Defaults to `eLastMinuteDiscountType.Gradual`.
</ParamField>

### Optional Fields

<ParamField body="Description" type="string">
  Description.
</ParamField>

<ParamField body="InvoiceLineDisplayAs" type="string">
  Invoice line display text.
</ParamField>

<ParamField body="Visible" type="boolean">
  Whether the price is visible on the portal and app. Defaults to `true`.
</ParamField>

<ParamField body="ResourceTypes" type="integer[]">
  Resource Types.
</ParamField>

<ParamField body="CreditPrice" type="number">
  Credit price.
</ParamField>

<ParamField body="MaximumPrice" type="number">
  Maximum price cap.
</ParamField>

<ParamField body="IsDefaultPrice" type="boolean">
  Use as the default price for matched resource types if more than one price applies.
</ParamField>

<ParamField body="UsePerNightPricing" type="boolean">
  Use per-night pricing.
</ParamField>

<ParamField body="TaxRateId" type="integer">
  Tax Rate Id.
</ParamField>

<ParamField body="ReducedTaxRateId" type="integer">
  Reduced Tax Rate Id.
</ParamField>

<ParamField body="ExemptTaxRateId" type="integer">
  Exempt Tax Rate Id.
</ParamField>

<ParamField body="FinancialAccountId" type="integer">
  Financial Account Id.
</ParamField>

<ParamField body="FromTime" type="integer">
  Start time restriction (minutes from midnight).
</ParamField>

<ParamField body="ToTime" type="integer">
  End time restriction (minutes from midnight).
</ParamField>

<ParamField body="MinLength" type="integer">
  Minimum booking length (minutes).
</ParamField>

<ParamField body="MaxLength" type="integer">
  Maximum booking length (minutes).
</ParamField>

<ParamField body="OnlyWithinAvailableTimes" type="boolean">
  Only apply within the resource's available times.
</ParamField>

<ParamField body="FixedCostLength" type="integer">
  Fixed cost booking length threshold (minutes).
</ParamField>

<ParamField body="FixedCostPrice" type="number">
  Fixed cost price applied once the threshold is reached.
</ParamField>

<ParamField body="Tariffs" type="integer[]">
  Tariffs.
</ParamField>

<ParamField body="OnlyForContacts" type="boolean">
  Only available for contacts.
</ParamField>

<ParamField body="OnlyForMembers" type="boolean">
  Only available for members.
</ParamField>

<ParamField body="IsBookingCredit" type="boolean">
  Price uses booking credits.
</ParamField>

<ParamField body="IsPrintingCredit" type="boolean">
  Price uses printing credits.
</ParamField>

<ParamField body="ApplyChargeToVisitors" type="boolean">
  Apply charge to visitors.
</ParamField>

<ParamField body="PriceFactorLowDemand" type="number">
  Price factor for low demand periods.
</ParamField>

<ParamField body="PriceFactorAverageDemand" type="number">
  Price factor for average demand periods.
</ParamField>

<ParamField body="PriceFactorHighDemand" type="number">
  Price factor for high demand periods.
</ParamField>

<ParamField body="PriceFactorLastMinute" type="number">
  Price factor for last-minute bookings.
</ParamField>

<ParamField body="LastMinutePeriodMinutes" type="integer">
  Last-minute period threshold (minutes before booking).
</ParamField>

<ParamField body="ApplyFrom" type="string">
  Date from which this price applies.
</ParamField>

<ParamField body="ApplyTo" type="string">
  Date until which this price applies.
</ParamField>

<ParamField body="ResourceTypeNames" type="string">
  Comma-separated names of associated resource types.
</ParamField>

<ParamField body="Teams" type="integer[]">
  Teams.
</ParamField>

### Children

<ParamField body="TimeSlots" type="object[]">
  The days and times this extra service price is available for booking. The year, month and day component of FromTime/ToTime is always 1976-01-01.

  <Expandable>
    <ParamField body="DayOfWeek" type="integer" required>
      Day Of Week.
    </ParamField>

    <ParamField body="FromTime" type="string" required>
      Start time of the availability window. Only the time-of-day component is used; the date component is always 1976-01-01..
    </ParamField>

    <ParamField body="ToTime" type="string" required>
      End time of the availability window. Only the time-of-day component is used; the date component is always 1976-01-01..
    </ParamField>

    <ParamField body="Available" type="boolean">
      Whether the extra service is available for booking during this time slot. When false, the slot acts as an explicit block..
    </ParamField>
  </Expandable>
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/billing/extraservices" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "BusinessId": 0,
      "Name": "",
      "DisplayOrder": 0,
      "Price": 0,
      "ChargePeriod": 0,
      "CurrencyId": 0,
      "LastMinuteAdjustmentType": 0,
      "TimeSlots": [
          {
              "DayOfWeek": 0,
              "FromTime": "2025-01-15T10:30:00Z",
              "ToTime": "2025-01-15T10:30:00Z",
              "Available": null
          }
      ]
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/extraservices',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        BusinessId: 0,
        Name: '',
        DisplayOrder: 0,
        Price: 0,
        ChargePeriod: 0,
        CurrencyId: 0,
        LastMinuteAdjustmentType: 0,
        TimeSlots: [object Object]
      })
    }
  );

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

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

  response = requests.post(
      'https://spaces.nexudus.com/api/billing/extraservices',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'Name': '',
          'DisplayOrder': 0,
          'Price': 0,
          'ChargePeriod': 0,
          'CurrencyId': 0,
          'LastMinuteAdjustmentType': 0,
          'TimeSlots': [object Object]
      }
  )

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

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the creation.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the newly created record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the extraservice was created successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "ExtraService was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "Name: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Name"
    }
  ],
  "WasSuccessful": false
}
```
