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

# Booking Price

> Calculate the price for a booking, including dynamic pricing adjustments.

# Booking Price

Calculates the total price for a booking at a specific resource and time slot. When [dynamic pricing](/member-portal/checkout/dynamic-pricing) is enabled, the response includes demand-based and last-minute price adjustments alongside the base price.

This endpoint is used by the Members Portal to display price annotations in the booking calendar and time selectors, but it can also be called directly to preview pricing before creating a booking.

## Authentication

Requires a valid customer bearer token.

## Query Parameters

<ParamField query="_shape" type="string">
  Comma-separated list of response fields to include. Use this to limit the response to only the fields you need.

  Example: `Price,DynamicPriceAdjustment,LastMinutePriceAdjustment,PriceFactorDemand`
</ParamField>

## Request Body

<ParamField body="ResourceId" type="number" required>
  The resource to calculate pricing for.
</ParamField>

<ParamField body="FromTime" type="string" required>
  Booking start time in ISO 8601 UTC format (e.g. `2026-04-06T10:00:00.000Z`).
</ParamField>

<ParamField body="ToTime" type="string" required>
  Booking end time in ISO 8601 UTC format (e.g. `2026-04-06T11:00:00.000Z`).
</ParamField>

<ParamField body="ChargeNow" type="boolean" required>
  Whether the booking should be charged immediately.
</ParamField>

<ParamField body="BookingVisitors" type="array">
  Array of visitor objects associated with the booking. Pass an empty array if none.
</ParamField>

<ParamField body="BookingProducts" type="array">
  Array of add-on products included in the booking. Pass an empty array if none.
</ParamField>

<ParamField body="CustomFields" type="object">
  Custom field values for the booking. Use `{ "Data": [] }` if none.
</ParamField>

<ParamField body="Id" type="number">
  Booking ID. Use `0` for new bookings. For existing bookings, pass the booking ID to preserve any previously locked-in pricing.
</ParamField>

<ParamField body="UniqueId" type="string">
  A unique identifier for the booking. Use a UUID for new bookings.
</ParamField>

<ParamField body="CoworkerFullName" type="string">
  Display name of the customer making the booking.
</ParamField>

## Response

<ResponseField name="Price" type="number" required>
  Total calculated price for the booking, including all dynamic adjustments.
</ResponseField>

<ResponseField name="DynamicPriceAdjustment" type="number" required>
  Absolute price adjustment from demand-based dynamic pricing. Positive values indicate a surcharge, negative values a discount. `0` when no demand adjustment applies.
</ResponseField>

<ResponseField name="LastMinutePriceAdjustment" type="number" required>
  Absolute price adjustment for last-minute bookings. Applied when the booking is made within the configured last-minute period before the start time. `0` when not applicable.
</ResponseField>

<ResponseField name="PriceFactorDemand" type="number" required>
  Demand factor as a decimal multiplier. For example, `0.1` means a 10% surcharge, `-0.15` means a 15% discount. `0` when no demand adjustment applies.
</ResponseField>

## Examples

### Calculate price for a one-hour booking

```http theme={null}
POST /api/public/bookings/price?_shape=Price,DynamicPriceAdjustment,LastMinutePriceAdjustment,PriceFactorDemand
Authorization: Bearer {token}
Content-Type: application/json

{
  "ResourceId": 1491,
  "FromTime": "2026-04-06T10:00:00.000Z",
  "ToTime": "2026-04-06T11:00:00.000Z",
  "ChargeNow": true,
  "BookingVisitors": [],
  "BookingProducts": [],
  "CustomFields": { "Data": [] },
  "Id": 0,
  "UniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "CoworkerFullName": "Jane Smith"
}
```

### Response with dynamic pricing surcharge

```json theme={null}
{
  "Price": 33.0,
  "DynamicPriceAdjustment": 3.0,
  "LastMinutePriceAdjustment": 0.0,
  "PriceFactorDemand": 0.1
}
```

In this example, the base price is $30 and a 10 percent demand surcharge of $3 has been applied, resulting in a total of \$33.

### Response with no dynamic pricing

```json theme={null}
{
  "Price": 30.0,
  "DynamicPriceAdjustment": 0.0,
  "LastMinutePriceAdjustment": 0.0,
  "PriceFactorDemand": 0.0
}
```

### Response with last-minute discount

```json theme={null}
{
  "Price": 22.5,
  "DynamicPriceAdjustment": 0.0,
  "LastMinutePriceAdjustment": -7.5,
  "PriceFactorDemand": 0.0
}
```

## TypeScript Integration

```typescript theme={null}
import endpoints from '@/api/endpoints'
import { BookingPrice } from '@/types/endpoints/BookingPrice'

const PRICE_SHAPE = 'Price,DynamicPriceAdjustment,LastMinutePriceAdjustment,PriceFactorDemand'
const url = `${endpoints.bookings.price().url}?_shape=${PRICE_SHAPE}`

const response = await httpClient.post<BookingPrice>(url, {
  ResourceId: 1491,
  FromTime: '2026-04-06T10:00:00.000Z',
  ToTime: '2026-04-06T11:00:00.000Z',
  ChargeNow: true,
  BookingVisitors: [],
  BookingProducts: [],
  CustomFields: { Data: [] },
  Id: 0,
  UniqueId: crypto.randomUUID(),
  CoworkerFullName: 'Jane Smith',
})
```

## Notes

* Dynamic pricing must be enabled via the `Nexudus.ML.DynamicPricing.Enabled` business setting. When disabled, `DynamicPriceAdjustment`, `LastMinutePriceAdjustment`, and `PriceFactorDemand` will all be `0`.
* Pricing is calculated per hour of the booking. Each hour may have a different demand level, so the total adjustment is the sum of all hourly adjustments.
* Previously charged bookings (non-zero `Id`) preserve their original pricing factors — the response reflects the locked-in adjustments rather than recalculating.
* See [Dynamic Pricing](/member-portal/checkout/dynamic-pricing) for a full explanation of how demand levels, availability thresholds, and last-minute adjustments are determined.
