> ## Documentation Index
> Fetch the complete documentation index at: https://www.marqeta.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Object Expansion

> Marqeta's Core API provides object expansion as a way to optimize the number of API calls you make and the size of the responses.

The Core API provides object expansion as a way to optimize the number of API calls and the size of the responses.

Some objects contain tokens of related objects in their response representations. For example, a card may have an associated user token. By default, a `GET` request returns an object representation that includes only tokens of associated objects, thus minimizing the response size.

Alternatively, you can use the `expand` query parameter to include the associated objects in the response, thus decreasing the number of required subsequent API calls. Objects that can be expanded are described in this page.

<h2 id="_query_parameter_details">
  Query parameter details
</h2>

| Fields                                       | Description                                                                                                                                                  |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| expand<br /><br />string<br /><br />Optional | Embeds the associated object of the specified type into the response, for all `GET``/cards` endpoints.<br /><br />**Allowable Values:**`user`, `cardproduct` |

<h2 id="_sample_requests_and_responses">
  Sample requests and responses
</h2>

To retrieve a card object that includes only the token of the associated user, use the `GET` request without the `expand` query parameter:

`GET /cards/{card_token}`

This request returns a card object that contains the `user_token` field:

```json JSON expandable lines wrap theme={null}
{
  "created_time": "2019-12-28T18:31:23Z",
  "last_modified_time": "2021-02-14T19:32:38Z",
  "token": "my_user_01_card_02",
  "user_token": "my_user_01",
  "card_product_token": "red_cardproduct",
  "last_four": "0865",
  "pan": "1111111824980865",
  "expiration": "1220",
  "expiration_time": "2024-12-31T23:59:59Z",
  "cvv_number": "137",
  "barcode": "25815105237561780909",
  "pin_is_set": false,
  "state": "UNACTIVATED",
  "state_reason": "New card",
  "fulfillment_status": "DIGITALLY_PRESENTED",
  "fulfillment": {
    "shipping": {
      "method": "FEDEX_REGULAR",
      "care_of_line": "my_care_of_value"
    }
  }
}
```

To embed the expanded `user` object in the response, use the `GET` request with the `expand` query parameter:

`GET /cards/{card_token}?expand=user`

This request returns a card object with the complete `user` object embedded within it:

```json JSON expandable lines wrap theme={null}
{
  "created_time": "2019-12-28T18:31:23Z",
  "last_modified_time": "2021-02-14T19:32:38Z",
  "token": "my_user_01_card_02",
  "user_token": "my_user_01",
  "card_product_token": "red_cardproduct",
  "last_four": "0865",
  "pan": "1111111824980865",
  "expiration": "1220",
  "expiration_time": "2024-12-31T23:59:59Z",
  "cvv_number": "137",
  "barcode": "25815105237561780909",
  "pin_is_set": false,
  "state": "UNACTIVATED",
  "state_reason": "New card",
  "fulfillment_status": "DIGITALLY_PRESENTED",
  "fulfillment": {
    "shipping": {
      "method": "FEDEX_REGULAR",
      "care_of_line": "my_care_of_value"
    }
  },
  "user": {
    "token": "my_user_01",
    "active": true,
    "metadata": {},
    "uses_parent_account": false,
    "created_time": "2019-04-07T19:01:08Z",
    "last_modified_time": "2019-04-07T19:01:08Z"
  }
}
```


## Related topics

- [Cards](/docs/core-api/cards.md)
- [Ledger Entries](/docs/core-api/credit-account-ledger-entries.md)
- [Journal Entries](/docs/core-api/credit-account-journal-entries.md)
- [Bundles](/docs/core-api/credit-bundles.md)
- [Views](/docs/diva-api/views.md)
