Skip to main content
GET
/
api
/
public
/
billing
/
invoices
/
{invoiceId}
/
coworkerProducts
/
{coworkerProductsUniqueId}
{
  "Id": 123,
  "ProductId": 123,
  "Quantity": 123,
  "RegularCharge": true,
  "UniqueId": "<string>",
  "401 Unauthorized": {},
  "404 Not Found": {}
}

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

invoiceId
number
required
The unique identifier of the parent invoice.
coworkerProductsUniqueId
string
required
The UniqueId of the customer product record associated with the invoice line. Available on the invoice line as CoworkerProductUniqueId.

Query Parameters

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

Response

Returns a CoworkerProduct object.
Id
number
Unique identifier of the customer product record.
ProductId
number
ID of the underlying product in the catalogue.
Quantity
number
Quantity of the product purchased.
RegularCharge
boolean
Whether this product is set up as a recurring charge.
UniqueId
string
Globally unique identifier for this customer product record.

Example Response

{
  "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

// 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)
  • GET /api/public/billing/invoices/{invoiceId} – Get full invoice details
  • GET /api/public/store/products/{productId} – Get store product details

Error Responses

401 Unauthorized
error
The current user is not authenticated or does not have access to this invoice.
404 Not Found
error
The invoice or customer product record does not exist.