List Cards

Learn how to retrieve Marqeta cards’ information.

Overview

In this lesson, we’ll learn how to get a list of all Marqeta cards owned by a specific user. We’ll also learn how to get information about a specific card.

Get all cards owned by a specific user

We can get a list of all Marqeta cards associated with a certain user by making a GET request to the {BASE_URL}/cards/user/{token} endpoint. The path parameter ({token}) refers to the token of the user that we want to retrieve information from. This gives us a list of all the cards associated with that specific user.

This endpoint allows us to filter the visibility of the response fields if necessary. It also supports pagination, which allows us to retrieve a specific range of resources from a complete and sorted list of the returned resources.

Moreover, this endpoint supports object expansion, which lets us optimize API calls and response sizes because it allows us to specify which objects to expand from those returned in the response. For example, as part of the response, this endpoint returns the token of the user who owns the card. We can specify if we want to retrieve the complete user object that corresponds to the returned token as part of the response. This gives us the card object data and the user data with a one API call instead of two.

Get hands-on with 1200+ tech skills courses.