> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fluveo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fluveo.com/_mcp/server.

# Expanding responses

Many response fields hold the **id** of a related object — a PaymentIntent's
`latest_charge` is a `ch_...` string, a Charge's `customer` is a `cus_...` string.
Pass the `expand[]` parameter to have the API return the full related object
inline instead of the id, saving you a second request.

`expand[]` is accepted as a query parameter on retrieve and list endpoints
(Charges, Customers, Events, Payment Intents, Payment Methods, Refunds, Webhook
Endpoints) and as a body parameter on write calls that return the object you are
mutating (creating, updating, confirming, capturing, or canceling a
PaymentIntent; creating or updating a Customer or Refund).

## Expanding on a retrieve

```bash
curl -G https://api.devfluveo.com/v1/payment_intents/pi_3Nk8AzB2xQRH9Jf \
  -u sk_test_123: \
  -d "expand[]=latest_charge"
```

The response's `latest_charge` is now the full Charge object rather than a
`ch_...` id:

```json
{
  "id": "pi_3Nk8AzB2xQRH9Jf",
  "object": "payment_intent",
  "latest_charge": {
    "id": "ch_3Nk8AzB2xQRH9Jf",
    "object": "charge",
    "status": "succeeded"
  }
}
```

## Expanding on a write

Write endpoints accept `expand` in the form body, so the object you get back is
already expanded:

```bash
curl https://api.devfluveo.com/v1/payment_intents \
  -u sk_test_123: \
  -d amount=4242 \
  -d currency=usd \
  -d "expand[]=latest_charge"
```

## Expanding inside a list

On list endpoints the items live under `data`, so prefix the path with `data.` —
the standard Stripe-shape convention:

```bash
curl -G https://api.devfluveo.com/v1/payment_intents \
  -u sk_test_123: \
  -d limit=10 \
  -d "expand[]=data.latest_charge"
```

## What can be expanded

Expandable fields are the id-reference fields on each object — the
[API Reference](/api-reference) is the source of truth for which fields each
endpoint supports. Pass multiple `expand[]` entries to expand several fields in
one request, and use dot notation to reach nested references. Requesting an
expansion an endpoint does not support returns an `invalid_request_error`
naming the offending `param`.

Expansion is a convenience for reads you would otherwise do anyway — expanding
many fields across large list pages makes responses heavier and slower, so
expand only what you consume.