/
10 minute read
September 1, 2022

Account Cards

Use the /credit/accounts/{account_token}/cards endpoint to create and retrieve credit cards that can access the credit line on a credit account.

Once a credit card is created, you can use the /cards endpoint to update the card or manage lost, stolen, or damaged cards.

To receive webhook notifications when card transition or card action events occur, see Card transition events and Card action events in Event Types.

Create account card

Action: POST
Endpoint: /credit/accounts/{account_token}/cards

Create a credit card for an existing credit account.

Note
You can ship cards to an address different from the user 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.

URL path parameters

Fields Description

account_token

string
Required

The unique identifier of the credit account for which to create a credit card.

Send a GET request to /credit/accounts to retrieve existing credit account tokens.

Allowable Values:

Existing account token

Request body

Fields Description

token

string
Optional

Unique identifier of the credit card.

Allowable Values:

36 char max

card_product_token

string
Required

Unique identifier of the associated card product.

Allowable Values:

Existing card product token

user_token

string
Required

Unique identifier of the credit cardholder.

Allowable Values:

Existing user token

reissue_pan_from_card_token

string
Optional

Reissues the specified card (known as the "source" card).

This field reissues a card by copying the PAN and PIN from the specified source card to the newly created card. The reissued card has the same PAN and PIN as the source card but a new expiration date and CVV2 number.

NOTE: By default, the source card is automatically terminated when the reissued card is activated. However, if your program is configured for multiple active cards, you can prevent the source card from being automatically terminated by setting the activation_actions.terminate_reissued_source_card field to false.

Allowable Values:

36 char max

Existing card token

new_pan_from_card_token

string
Optional

Reissues the specified card (known as the "source" card) with a new primary account number (PAN).

This field reissues a card with a new PAN from the specified source card. The source card is automatically terminated when the card is reissued with the new PAN. Use this field when reissuing a lost or stolen card.

Allowable Values:

36 char max

Existing card token

expiration_offset

object
Optional

Contains information on how long after the date of issue for when the cards are valid.

If this field is not specified, the card uses the config.card_life_cycle.expiration_offset of the bulk card order or card product as appropriate.

Allowable Values:

Existing expiration_offet object

expiration_offset.unit

string
Optional

The units for the value field.

Allowable Values:

255 char max

expiration_offset.value

integer
Optional

Specifies the number of time units (as defined by the unit field in this object) that this card is valid. In other words, cards expire value x unit after the date of issue.

This number is rounded as follows:

  • YEARS - Rounds up to the last second of the last day of the month of expiration. For example, if the issue date is 1 Jan 2021 and value = 1, the cards expire on the last day of Jan 2022.

  • MONTHS - Rounds up to the last second of the last day of the month of expiration. For example, if the issue date is 1 May 2022 and value = 1, the cards expire on the last day of June 2022.

  • DAYS - Rounds up to the last second of the day of expiration.

  • HOURS, MINUTES, SECONDS - No rounding.

Allowable Values:

Any integer

translate_pin_from_card_token

string
Optional

Copies the PIN from the specified card to the newly created card.

Both cards must belong to the same user. This field is not allowed if reissue_pan_from_card_token is set.

Send a GET request to /cards/user/{token} to retrieve card tokens for a particular user.

Allowable Values:

36 char max

Existing card token

activation_actions

object
Optional

Contains information on actions that can be performed when a card is activated.

Allowable Values:

Existing activation_actions object

activation_actions.terminate_reissued_source_card

boolean
Optional

If you are reissuing a card, the source card is terminated by default. To prevent the source card from being terminated, set this field to false.

Only relevant when reissue_pan_from_card_token is set.

Allowable Values:

true, false

Default value:
true

activation_actions.swap_digital_wallet_tokens_from_card_token

string
Optional

Token of the card from which to move digital wallet tokens. All digital wallet tokens are move from the card specified in this field to the new card.

Not relevant when reissue_pan_from_card_token is set.

Send a GET request to /cards/user/{token} to retrieve card tokens for a particular user.

Allowable Values:

Existing card token

Sample request body

JSON
Copied

Is this helpful?

Yes
No

Response body

Fields Description

token

string
Returned

Unique identifier of the credit card.

Allowable Values:

36 char max

account_token

string
Returned

Unique identifier of the associated credit account.

Allowable Values:

36 char max

Existing credit account token

user_token

string
Returned

Unique identifier of the credit cardholder.

Allowable Values:

Existing user token

created_time

datetime
Returned

Date and time when the card was created on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

updated_time

datetime
Returned

Date and time when the card was last modified on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

Sample response body

JSON
Copied

Is this helpful?

Yes
No

List account cards

Action: GET
Endpoint: /credit/accounts/{account_token}/cards

Retrieve an array of cards for a credit account.

This endpoint supports sorting and pagination.

URL path parameters

Fields Description

account_token

string
Required

The unique identifier of the credit account for which to retrieve credit cards.

Send a GET request to /credit/accounts to retrieve existing credit account tokens.

Allowable Values:

Existing account token

URL query parameters

Fields Description

status

string
Optional

The status of the credit cards to return.

Allowable Values:

Valid credit card status

count

integer
Optional

The number of resources to retrieve.

Allowable Values:

1–100

start_index

integer
Optional

Sort order index of the first resource in the returned array.

Allowable Values:

0 min

sort_by

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

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.

Allowable Values:

lastModifiedTime, -lastModifiedTime

Response body

Fields Description

count

integer
Returned

Number of resources returned.

Allowable Values:

1-10

start_index

integer
Returned

Sort order index of the first resource in the returned array.

Allowable Values:

Any integer

end_index

integer
Returned

Sort order index of the last resource in the returned array.

Allowable Values:

Any integer

is_more

boolean
Returned

A value of true indicates that more unreturned resources exist.

Allowable Values:

true, false

data

array of objects
Returned

Contains one or more credit cards.

Allowable Values:

One or more credit card objects

data[].token

string
Returned

Unique identifier of the credit card.

Allowable Values:

36 char max

data[].account_token

string
Returned

Unique identifier of the associated credit account.

Allowable Values:

36 char max

Existing credit account token

data[].user_token

string
Returned

Unique identifier of the credit cardholder.

Allowable Values:

Existing user token

data[].created_time

datetime
Returned

Date and time when the card was created on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

data[].updated_time

datetime
Returned

Date and time when the card was last modified on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

Sample response body

JSON
Copied

Is this helpful?

Yes
No

Retrieve account card

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

Retrieve a credit card for a credit account.

URL path parameters

Fields Description

account_token

string
Required

The unique identifier of the credit account for which to retrieve a credit card.

Send a GET request to /credit/accounts to retrieve existing credit account tokens.

Allowable Values:

Existing account token

card_token

string
Required

The unique identifier of the credit card to retrieve.

Send a GET request to /credit/accounts/{account_token}/cards to retrieve existing credit card tokens.

Allowable Values:

Existing card token

Response body

Fields Description

token

string
Returned

Unique identifier of the credit card.

Allowable Values:

36 char max

account_token

string
Returned

Unique identifier of the associated credit account.

Allowable Values:

36 char max

Existing credit account token

user_token

string
Returned

Unique identifier of the credit cardholder.

Allowable Values:

Existing user token

created_time

datetime
Returned

Date and time when the card was created on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

updated_time

datetime
Returned

Date and time when the card was last modified on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

Sample response body

JSON
Copied

Is this helpful?

Yes
No

Join our developer newsletter