> ## 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 Product Line

# Get Invoice Product Line

Returns the `CoworkerProduct` record linked to a specific invoice line. This endpoint enriches invoice lines that originate from a product purchase, providing details such as product ID, quantity, and recurrence type.

## 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="coworkerProductsUniqueId" type="string" required>
  The `UniqueId` of the customer product record associated with the invoice line. Available on the invoice line as `CoworkerProductUniqueId`.
</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=Product.Price,Product.Quantity,Product.Product.Name`.
</ParamField>

## Response

Returns a `CoworkerProduct` object.

<ResponseField name="Id" type="number">
  Unique identifier of the customer product record.
</ResponseField>

<ResponseField name="ProductId" type="number">
  ID of the underlying product in the catalogue.
</ResponseField>

<ResponseField name="Quantity" type="number">
  Quantity of the product purchased.
</ResponseField>

<ResponseField name="RegularCharge" type="boolean">
  Whether this product is set up as a recurring charge.
</ResponseField>

<ResponseField name="UniqueId" type="string">
  Globally unique identifier for this customer product record.
</ResponseField>

## Example Response

```json theme={null}
{
  "Id": 3001,
  "ProductId": 88,
  "Quantity": 2,
  "RegularCharge": false,
  "UniqueId": "a1b2c3d4-5678-90ef-abcd-1234567890ab"
}
```

## Usage in Portal

Used to render product details in invoice line rows within the basket and invoice summary.

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

### Typical integration pattern

```ts theme={null}
// From src/api/endpoints.ts
// endpoints.billing.invoices.coworkerProduct = (invoiceId: number, coworkerProductsUniqueId: string) => ({
//   url: `/api/public/billing/invoices/${invoiceId}/coworkerProducts/${coworkerProductsUniqueId}`,
//   type: null as unknown as CoworkerProduct,
// })

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

## Related Endpoints

* `GET /api/public/billing/invoices/{invoiceId}` – Get full invoice details
* `GET /api/public/store/products/{productId}` – Get store product details

## 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 customer product record does not exist.
</ResponseField>
