Expand to include embedded objects

Rebilly provides the ability to pre-load additional objects with a request.

You can use ?expand param on most requests 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 value(s).

You may expand multiple objects by passing them as comma-separated to the expand value like so:

?expand=recentInvoice,customer

And in the response, you would see:

"_embedded": [
    "recentInvoice": {...},
    "customer": {...}
]

Expand may be utilitized not only on GET requests but also on PATCH, POST, PUT requests too.