This API is in beta. Endpoints and response shapes may change before stable release.

Sideloading related resources

Several endpoints accept an include query parameter that causes related resources to be returned alongside the primary data in a single response. This avoids the need for clients to issue additional requests to resolve foreign keys.

The include parameter

Parameter Type Required Description
include string Comma-separated list of related resources to sideload. Accepted values vary by endpoint and are documented on each resource page. Unknown values are silently ignored.

Response shape

When any include is requested the response gains a top-level included key. Its value is a map keyed by resource type (always plural). Each type map is keyed by record UUID, so lookups are O(1) and duplicate records are automatically deduplicated.

The shape is the same for both list and show endpoints and for both to-one and to-many associations, so your client can use a single lookup path everywhere.

200 200 with ?include=products,storages
{
  "data": [...],
  "meta": {...},
  "included": {
    "products": {
      "<uuid>": {
        "id": "<uuid>",
        "organisation_id": "<uuid>",
        "name": "<string>",
        "inserted_at": "<iso8601>",
        "updated_at": "<iso8601>"
      }
    },
    "storages": {
      "<uuid>": {
        "id": "<uuid>",
        "organisation_id": "<uuid>",
        "name": "<string>",
        "inserted_at": "<iso8601>",
        "updated_at": "<iso8601>"
      }
    }
  }
}
Only IDs that appear in the primary data are fetched. If a record has a null foreign key the corresponding entry is simply absent from included.