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, aDocumentation 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.
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.
Query parameter details
| Fields | Description |
|---|---|
| expand string Optional | Embeds the associated object of the specified type into the response, for all GET``/cards endpoints.Allowable Values: user, cardproduct |
Sample requests and responses
To retrieve a card object that includes only the token of the associated user, use theGET request without the expand query parameter:
GET /cards/{card_token}
This request returns a card object that contains the user_token field:
JSON
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