Skip to main content

Invoice — new field locationDetails (InvoiceLocation)

Summary

The GraphQL type Invoice now exposes a read-only field locationDetails of type InvoiceLocation, containing:

  • id — the location's ObjectId, suitable for matching against other records.
  • name, header, address — the same display details previously only available as a single string via location.
  • metadata — the location's stored [MetadataEntry] (key/value pairs), for example a secondary identifier from an integration partner.

Previously, Invoice.location returned only the location's name as a String. Two locations with the same name could not be distinguished, and any additional location data (including metadata) required a separate practice query. locationDetails resolves both problems in a single call.

location is deprecated in favour of locationDetails but continues to return the location name as a String — existing queries are unaffected.

Query example

query GetInvoice($id: ID!) {
invoice(id: $id) {
id
location
locationDetails {
id
name
header
address {
address
city
postcode
country
}
metadata {
key
value
}
}
}
}

Integration guidance

  • Optional field: Add locationDetails { ... } only when your integration needs the location id, address, or metadata; omit it otherwise.
  • Prefer id over name for matching: Use locationDetails.id to reliably identify a location, since location names are not guaranteed to be unique.
  • Reading partner identifiers: If a location has metadata such as an external system reference, request metadata { key value } instead of making a follow-up practice query.
  • locationDetails may be null: Invoices that are not associated with a specific location (for example, automatically generated invoices) return null for locationDetails.

Migration

This release is additive. Existing invoice and invoices clients do not need to change unless they want to read structured location data or metadata via locationDetails.