> For the complete documentation index, see [llms.txt](https://developers.spiffy.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.spiffy.co/api/getting-started/resource-expansion.md).

# Resource Expansion

Many endpoints support expanding related resources in a single request using the `include` parameter. This reduces the number of API calls needed to fetch related data.

**Example:**

```
GET /v2/customers/cus_123?include=cards,stats,fields
```

This returns the customer with their payment cards, statistics, and custom fields included:

```json
{
  "id": "cus_123",
  "email": "john@example.com",
  "name": "John Smith",
  // ... other customer fields ...
  "cards": [
    { "id": "card_456", "last4": "4242", "brand": "Visa" }
  ],
  "stats": {
    "total_orders": 15,
    "total_spent": 1250.00,
    "avg_order_value": 83.33
  },
  "fields": [
    { "name": "preferred_contact", "value": "email" }
  ]
}
```

Available expansions are listed in each endpoint's documentation. Multiple expansions can be requested as a comma-separated list.
