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

# Update ExtraService

> Update an existing ExtraService record.

Updates an existing ExtraService record. You must include the `Id` of the record to update along with all required fields.

## 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-Edit`** 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="Id" type="integer" required>
  The Id of the ExtraService record to update.
</ParamField>

<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.
</ParamField>

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

<ParamField body="ChargePeriod" type="integer" required>
  Charge period.
</ParamField>

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

<ParamField body="LastMinuteAdjustmentType" type="integer" required>
  Last-minute discount type.
</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.
</ParamField>

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

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

<ParamField body="RemovedResourceTypes" type="integer[]">
  Removed 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="AddedTariffs" type="integer[]">
  Added Tariffs.
</ParamField>

<ParamField body="RemovedTariffs" type="integer[]">
  Removed 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>

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

<ParamField body="RemovedTeams" type="integer[]">
  Removed 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 PUT \
    "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,
      "Id": 87654321,
      "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: 'PUT',
      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,
        Id: 87654321,
        TimeSlots: [object Object]
      })
    }
  );

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

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

  response = requests.put(
      '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,
          'Id': 87654321,
          '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 update.
</ResponseField>

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

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

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

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "ExtraService was successfully updated.",
  "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
}
```
