Skip to main content

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:

ValuereferenceId identifies
BookingA booking or online booking
RecordA consultation or clinical record
ProductA product selected directly or used for legacy/default fallback references
MembershipProductA membership product billed by auto-invoicing
PathwayA 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