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

# Get Invoice Booking Line

# Get Invoice Booking Line

Returns the `Booking` record linked to a specific invoice line. This endpoint is used to enrich invoice line items that originate from a booking, giving the UI access to full booking details (resource name, times, floor plan, etc.) alongside the invoice.

## Authentication

This endpoint requires an authenticated customer session.

## Path Parameters

<ParamField path="invoiceId" type="number" required>
  The unique identifier of the parent invoice.
</ParamField>

<ParamField path="bookingUniqueId" type="string" required>
  The `UniqueId` of the booking associated with the invoice line. This value is available on the invoice line object as `BookingUniqueId`.
</ParamField>

## Query Parameters

<ParamField query="_shape" type="string">
  Comma-separated list of field paths to include in the response. When provided, only the
  specified fields are returned — useful for reducing payload size. Supports nested paths
  using dot notation. Example: `_shape=Booking.ResourceName,Booking.FromTime,Booking.ToTime`.
</ParamField>

## Response

Returns a `Booking` object.

<ResponseField name="Id" type="number">
  Unique identifier of the booking.
</ResponseField>

<ResponseField name="UniqueId" type="string">
  Globally unique identifier of the booking.
</ResponseField>

<ResponseField name="ResourceId" type="number">
  ID of the booked resource.
</ResponseField>

<ResponseField name="ResourceName" type="string">
  Display name of the booked resource.
</ResponseField>

<ResponseField name="FromTime" type="string">
  ISO 8601 datetime for the start of the booking.
</ResponseField>

<ResponseField name="ToTime" type="string">
  ISO 8601 datetime for the end of the booking.
</ResponseField>

<ResponseField name="CoworkerId" type="number">
  ID of the customer who made the booking.
</ResponseField>

<ResponseField name="InvoiceId" type="number">
  ID of the associated invoice.
</ResponseField>

<ResponseField name="Tentative" type="boolean">
  Whether the booking is still tentative/unconfirmed.
</ResponseField>

<ResponseField name="Cancelled" type="boolean">
  Whether the booking has been cancelled.
</ResponseField>

## Example Response

```json theme={null}
{
  "Id": 9876,
  "UniqueId": "b1a2c3d4-e5f6-7890-abcd-ef1234567890",
  "ResourceId": 55,
  "ResourceName": "Focus Room 2",
  "FromTime": "2025-10-15T09:00:00",
  "ToTime": "2025-10-15T11:00:00",
  "CoworkerId": 987,
  "InvoiceId": 12345,
  "Tentative": false,
  "Cancelled": false
}
```

## Usage in Portal

This endpoint is used to render booking-specific details within an invoice line row in the basket/invoice summary UI.

* File: `src/components/Basket/invoiceLines/BookingInvoiceLineRow.tsx`

### Typical integration pattern

```ts theme={null}
// From src/api/endpoints.ts
// endpoints.billing.invoices.booking = (invoiceId: number, bookingUniqueId: string) => ({
//   url: `/api/public/billing/invoices/${invoiceId}/bookings/${bookingUniqueId}`,
//   type: null as unknown as Booking,
// })

// Usage in React
const endpoint = endpoints.billing.invoices.booking(invoice.Id, line.BookingUniqueId)
const { resource: booking } = useData<typeof endpoint.type>(httpClient, endpoint.url)
```

## Related Endpoints

* `GET /api/public/billing/invoices/{invoiceId}` – Get full invoice details
* `GET /api/public/bookings/{id}` – Get booking details directly

## Error Responses

<ResponseField name="401 Unauthorized" type="error">
  The current user is not authenticated or does not have access to this invoice.
</ResponseField>

<ResponseField name="404 Not Found" type="error">
  The invoice or booking does not exist or cannot be associated.
</ResponseField>
