Embedded resources
This topic describes how to pre-load additional objects with an API request. These additional objects are referred to as embedded resources.
Use the ?expand
query parameter to expand and include embedded objects within the _embedded
property of the response. The _embedded
property contains an array of objects keyed by the expand parameter values. To expand multiple objects, pass them as a comma-separated list of objects.
Expand may be used on GET
, PATCH
, POST
, PUT
requests.
Important warning
It is highly recommended to use expand
for single resources only. This operation will negatively affect performance on collections.
Example request containing multiple objects:
?expand=recentInvoice,customer
Example response:
'_embedded': ['recentInvoice': { ... }, 'customer': { ... }]