community postIntegration & APIscommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: Does the API support Multi-level Expand (Multi layers)

The Business Central REST API supports multi-level expand (nested data retrieval) using nested parentheses in $expand syntax, allowing you to retrieve related resources across multiple layers, and also supports combining multi-level expands with filters and field selection.

post Dynamics 365 Lab

Yun Zhu · 2026-02-03 · 337 words · about 2 min

"each additional level of expansion requires an extra set of parentheses: $expand=salesOrderLines($expand=item($expand=itemCategory))"

Key points

  • Multi-level expand uses nested parentheses syntax like $expand=salesOrderLines($expand=item($expand=itemCategory))
  • You can expand multiple entities simultaneously and combine two-level expands with multi-level nested expands in a single query
  • Filter expressions and $select clauses can be added at each expansion level to retrieve only necessary fields
  • Each additional level of nesting requires an extra set of parentheses in the query structure

Quotes

  • “each additional level of expansion requires an extra set of parentheses: $expand=salesOrderLines($expand=item($expand=itemCategory))” (This clearly explains the syntax pattern for multi-level expand queries, essential for developers constructing nested API calls)
  • “You can also expand multiple entities simultaneously, such as combining a two-level expand with a multi-level (three-level) nested expand.” (Clarifies that developers can mix multiple expansion paths in a single query for efficient data retrieval)
  • “you can also include a $select clause at each level to retrieve only the necessary fields” (Shows that optimization is possible by limiting returned fields at each nesting level, reducing payload size)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

  • other “salesOrder”
  • other “salesOrderLines”
  • other “customer”
  • other “item”
  • other “itemCategory”
  • other “paymentTerm”
  • other “account”

Context

  • Features: multi-level expand, nested expand, resource navigation, filter expressions, field selection, API query syntax
  • Versions: v2.0

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.