Invoice line item references
Summary
Invoice line items now expose the object they are associated with:
LineItem.referenceId- the ID of the related object.LineItem.referenceType- the public type of that related object.
This is additive. Existing invoice queries continue to behave as before unless you request the new fields.
What changed
You can now request reference data inside invoice.lineItems and invoices.data.lineItems:
query InvoiceLineItemReferences($invoiceId: ID!) {
invoice(id: $invoiceId) {
id
lineItems {
id
title
referenceId
referenceType
}
}
}
Possible referenceType values are:
| Value | referenceId identifies |
|---|---|
Booking | A booking or online booking |
Record | A consultation or clinical record |
Product | A product selected directly or used for legacy/default fallback references |
MembershipProduct | A membership product billed by auto-invoicing |
Pathway | A clinical pathway |
Line items without usable reference data return null for referenceId and referenceType.
Integration guidance
Use referenceType before interpreting referenceId. The ID is polymorphic, so the same field may point to a booking, record, product, membership product, or pathway depending on the line item source.
Refresh generated GraphQL clients or schema snapshots if they include the LineItem type.
See also
- API reference:
LineItem