> ## 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.

# Account Cards

> Use Account Cards to create and retrieve a card that can access the credit line on a credit account.

export const EndpointCard = ({method = "API", title, children, href, arrow = true}) => {
  const METHOD_STYLES = {
    GET: {
      bg: "mint-bg-green-400/20 dark:mint-bg-green-400/20",
      text: "mint-text-green-700 dark:mint-text-green-400",
      border: "mint-border-green-300 dark:mint-border-green-700"
    },
    POST: {
      bg: "mint-bg-blue-400/20 dark:mint-bg-blue-400/20",
      text: "mint-text-blue-700 dark:mint-text-blue-400"
    },
    PUT: {
      bg: "mint-bg-yellow-400/20 dark:mint-bg-yellow-400/20",
      text: "mint-text-yellow-700 dark:mint-text-yellow-400"
    },
    PATCH: {
      bg: "mint-bg-orange-400/20 dark:mint-bg-orange-400/20",
      text: "mint-text-orange-700 dark:mint-text-orange-400"
    },
    DELETE: {
      bg: "mint-bg-red-400/20 dark:mint-bg-red-400/20",
      text: "mint-text-red-700 dark:mint-text-red-400"
    },
    API: {
      bg: "mint-bg-black",
      text: "mint-text-white"
    }
  };
  const MethodBadge = ({method}) => {
    const style = METHOD_STYLES[method?.toUpperCase()] ?? METHOD_STYLES.GET;
    return <span className={`
          method-pill rounded-lg font-semibold px-1.5 py-0.5 text-xs leading-5 ${style.bg} ${style.text}`}>
        {method?.toUpperCase()}
      </span>;
  };
  const content = <div className="group flex items-center gap-4 border border-gray-200 dark:border-gray-700 rounded-xl p-5 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md transition-all cursor-pointer">
      {}
      <div className="shrink-0">
        <MethodBadge method={method} />
      </div>
      {}
      <div className="flex-1 min-w-0">
        <p className="font-semibold text-gray-900 dark:text-white text-sm leading-snug">{title}</p>
        {children && <p className="mt-1 text-sm text-gray-500 dark:text-gray-400 line-clamp-2">{children}</p>}
      </div>
    </div>;
  if (!href) return content;
  return <a href={href} className="block no-underline border-b-0 mb-2">
      {content}
    </a>;
};

Use the account cards endpoints to create and retrieve credit cards that can access the credit line on a [credit account](/core-api/credit-accounts/).

Once a credit card is created, you can use the `/cards` endpoint to [update the card](/core-api/cards/#put_cards_token) or [manage lost, stolen, or damaged cards](/developer-guides/managing-lost-stolen-or-damaged-cards/).

To receive webhook notifications when card transition or card action events occur, see [Card transition events](/core-api/event-types/#_card_transition_events) and [Card action events](/core-api/event-types/#_card_action_events) in Event Types.

<h2 id="create_card_for_account">
  Create account card
</h2>

**Action:** `POST`\
**Endpoint:** `/credit/accounts/{account_token}/cards`

Create a credit card for an existing credit account.

<Note>
  **Note**\
  You can ship cards to an address different from the [user](/core-api/users/) address. After creating a card, send a `PUT` request to the `/cards` endpoint with the new address in the `fulfillment.shipping` object. For more, see [Update card](/core-api/cards/#put_cards_token).
</Note>

<h3 id="_url_path_parameters">
  URL path parameters
</h3>

| Fields                                               | Description                                                                                                                                                                                                                                     |
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| account\_token<br /><br />string<br /><br />Required | Unique identifier of the credit account for which to create a credit card.<br /><br />Send a `GET` request to `/credit/accounts` to retrieve existing credit account tokens.<br /><br />**Allowable Values:**<br /><br />Existing account token |

<h3 id="_request_body">
  Request body
</h3>

Expected request body to create a credit card for an existing credit account. Refer to [Create card](/core-api/cards/#post_cards) for the complete list of fields.

<h3 id="_sample_request_body">
  Sample request body
</h3>

```json JSON lines wrap theme={null}
{
  "card_product_token": "my-card-product1234",
  "user_token": "user1234"
}
```

<h3 id="_response_body">
  Response body
</h3>

| Fields                                                | Description                                                                                                                                                  |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| token<br /><br />string<br /><br />Returned           | Unique identifier of the credit card.<br /><br />**Allowable Values:**<br /><br />36 char max                                                                |
| account\_token<br /><br />string<br /><br />Returned  | Unique identifier of the associated credit account.<br /><br />**Allowable Values:**<br /><br />36 char max<br /><br />Existing account token                |
| user\_token<br /><br />string<br /><br />Returned     | Unique identifier of the credit cardholder.<br /><br />**Allowable Values:**<br /><br />Existing user token                                                  |
| created\_time<br /><br />datetime<br /><br />Returned | Date and time when the card was created on Marqeta’s credit platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ       |
| updated\_time<br /><br />datetime<br /><br />Returned | Date and time when the card was last modified on Marqeta’s credit platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ |

<h3 id="_sample_response_body">
  Sample response body
</h3>

```json JSON lines wrap theme={null}
{
  "token": "my_credit_card_token1234",
  "account_token": "my_account_token_12",
  "user_token": "user1234",
  "created_time": "2024-09-03T19:39:53.719Z",
  "updated_time": "2024-09-03T19:39:53.719Z"
}
```

<h2 id="get_cards_by_account">
  List account cards
</h2>

**Action:** `GET`\
**Endpoint:** `/credit/accounts/{account_token}/cards`

Retrieve an array of cards for a credit account.

This endpoint supports [sorting and pagination](/core-api/sorting-and-pagination/).

<h3 id="_url_path_parameters_2">
  URL path parameters
</h3>

| Fields                                               | Description                                                                                                                                                                                                                                      |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| account\_token<br /><br />string<br /><br />Required | Unique identifier of the credit account for which to retrieve credit cards.<br /><br />Send a `GET` request to `/credit/accounts` to retrieve existing credit account tokens.<br /><br />**Allowable Values:**<br /><br />Existing account token |

<h3 id="_url_query_parameters">
  URL query parameters
</h3>

| Fields                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| status<br /><br />string<br /><br />Optional        | Status of the credit cards to retrieve.<br /><br />**Allowable Values:**<br /><br />Valid credit card status                                                                                                                                                                                                                                                                                                 |
| count<br /><br />integer<br /><br />Optional        | Number of credit card resources to retrieve.<br /><br />**Allowable Values:**<br /><br />1–100                                                                                                                                                                                                                                                                                                               |
| start\_index<br /><br />integer<br /><br />Optional | Sort order index of the first resource in the returned array.<br /><br />**Allowable Values:**<br /><br />0 min                                                                                                                                                                                                                                                                                              |
| sort\_by<br /><br />string<br /><br />Optional      | Field on which to sort. Prefix the field name with a hyphen (`-`) to sort in descending order. Omit the hyphen to sort in ascending order.<br /><br />**NOTE:** You must sort using system field names such as `lastModifiedTime`, and not by the field names appearing in response bodies such as `last_modified_time`.<br /><br />**Allowable Values:**<br /><br />`lastModifiedTime`, `-lastModifiedTime` |

<h3 id="_response_body_2">
  Response body
</h3>

| Fields                                                            | Description                                                                                                                                                  |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| count<br /><br />integer<br /><br />Returned                      | Number of resources returned.<br /><br />**Allowable Values:**<br /><br />1-10                                                                               |
| start\_index<br /><br />integer<br /><br />Returned               | Sort order index of the first resource in the returned array.<br /><br />**Allowable Values:**<br /><br />Any integer                                        |
| end\_index<br /><br />integer<br /><br />Returned                 | Sort order index of the last resource in the returned array.<br /><br />**Allowable Values:**<br /><br />Any integer                                         |
| is\_more<br /><br />boolean<br /><br />Returned                   | A value of `true` indicates that more unreturned resources exist.<br /><br />**Allowable Values:**<br /><br />`true`, `false`                                |
| data<br /><br />array of objects<br /><br />Returned              | Contains one or more credit cards.<br /><br />**Allowable Values:**<br /><br />One or more credit card objects                                               |
| data\[].**token**<br /><br />string<br /><br />Returned           | Unique identifier of the credit card.<br /><br />**Allowable Values:**<br /><br />36 char max                                                                |
| data\[].**account\_token**<br /><br />string<br /><br />Returned  | Unique identifier of the associated credit account.<br /><br />**Allowable Values:**<br /><br />36 char max<br /><br />Existing account token                |
| data\[].**user\_token**<br /><br />string<br /><br />Returned     | Unique identifier of the credit cardholder.<br /><br />**Allowable Values:**<br /><br />Existing user token                                                  |
| data\[].**created\_time**<br /><br />datetime<br /><br />Returned | Date and time when the card was created on Marqeta’s credit platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ       |
| data\[].**updated\_time**<br /><br />datetime<br /><br />Returned | Date and time when the card was last modified on Marqeta’s credit platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ |

<h3 id="_sample_response_body_2">
  Sample response body
</h3>

```json JSON expandable lines wrap theme={null}
{
  "count": 2,
  "start_index": 0,
  "end_index": 0,
  "is_more": false,
  "data": [
    {
      "token": "credit_card_token1234",
      "account_token": "my_account_token_12",
      "user_token": "user1234",
      "created_time": "2024-09-03T19:39:53.719Z",
      "updated_time": "2024-09-03T19:39:53.719Z"
    },
    {
      "token": "credit_card_token5678",
      "account_token": "my_account_token_13",
      "user_token": "user5678",
      "created_time": "2024-09-13T19:19:51.412Z",
      "updated_time": "2024-09-13T19:19:51.421Z"
    }
  ]
}
```

<h2 id="get_card_by_account">
  Retrieve account card
</h2>

**Action:** `GET`\
**Endpoint:** `/credit/accounts/{account_token}/cards/{card_token}`

Retrieve a credit card for a credit account.

<h3 id="_url_path_parameters_3">
  URL path parameters
</h3>

| Fields                                               | Description                                                                                                                                                                                                                                       |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| account\_token<br /><br />string<br /><br />Required | Unique identifier of the credit account for which to retrieve a credit card.<br /><br />Send a `GET` request to `/credit/accounts` to retrieve existing credit account tokens.<br /><br />**Allowable Values:**<br /><br />Existing account token |
| card\_token<br /><br />string<br /><br />Required    | Unique identifier of the credit card to retrieve.<br /><br />Send a `GET` request to `/credit/accounts/{account_token}/cards` to retrieve existing credit card tokens.<br /><br />**Allowable Values:**<br /><br />Existing card token            |

<h3 id="_response_body_3">
  Response body
</h3>

| Fields                                                | Description                                                                                                                                                  |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| token<br /><br />string<br /><br />Returned           | Unique identifier of the credit card.<br /><br />**Allowable Values:**<br /><br />36 char max                                                                |
| account\_token<br /><br />string<br /><br />Returned  | Unique identifier of the associated credit account.<br /><br />**Allowable Values:**<br /><br />36 char max<br /><br />Existing account token                |
| user\_token<br /><br />string<br /><br />Returned     | Unique identifier of the credit cardholder.<br /><br />**Allowable Values:**<br /><br />Existing user token                                                  |
| created\_time<br /><br />datetime<br /><br />Returned | Date and time when the card was created on Marqeta’s credit platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ       |
| updated\_time<br /><br />datetime<br /><br />Returned | Date and time when the card was last modified on Marqeta’s credit platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ |

<h3 id="_sample_response_body_3">
  Sample response body
</h3>

```json JSON lines wrap theme={null}
{
  "token": "my_credit_card_token1234",
  "account_token": "my_account_token_12",
  "user_token": "user1234",
  "created_time": "2024-09-03T19:39:53.719Z",
  "updated_time": "2024-09-03T19:39:53.719Z"
}
```


## Related topics

- [About Account Holders](/docs/developer-guides/about-account-holders.md)
- [About Credit Accounts](/docs/developer-guides/about-credit-accounts.md)
- [Platform Overview](/docs/developer-guides/platform-overview.md)
- [Transfers](/docs/core-api/digital-banking-transfers.md)
- [Cards](/docs/core-api/cards.md)
