Create and Update Cards

Learn what a Marqeta card is as well as how to create and update it.

A card is a payment card that’s owned by a user. It can either be a physical or a virtual card. The behavior and the attributes of the card are defined by the card product object associated with it. We can also define the attributes of the card inside the card object. In that case, the definition inside the card object will take precedence over the definition inside the card product object.

In this lesson, we’ll learn how to create and update a Marqeta payment card.

Create a card

We can create a Marqeta payment card by making a POST request to the {BASE_URL}/cards endpoint. We can provide basic information about the card in the request’s body. This includes the shipping information. We also need to specify the user_token of the card owner and the card_product_token of the card product that controls the card. Therefore, we need to create a user and a card product before we create a new Marqeta card.

Request parameters

Parameter

Type

Category

Description

show_cvv_number

Boolean

Optional

true to show the CVV2 number in the response, otherwise false

Note: This is a query parameter.

show_pan

Boolean

Optional

true to show the card’s PAN (primary account number) in the response, otherwise false

Note: This is a query parameter.

card_product_token

String

Optional

Token of the card product

expedite

Boolean

Optional

true when we want to request the fulfillment provider to expedite card processing, otherwise false

Default value: false

metadata

Object

Optional

Adds metadata provided by the customer to the card

Allowable values: Maximum 20 key-value pairs allowed

Format: "my_name_1": "my_value_1"

expiration_offset

Object

Optional

Defines the duration for card validity after issuance

token

String

Optional

Unique token of the card

Length: 1–36 characters

Note: If not specified, the system generates one automatically. This value cannot be updated once set.

user_token

String

Mandatory

Unique token of the card user

fulfillment

Object

Optional

Contains shipping information and the physical characteristics of the card

reissue_pan_from_card_token

String

Optional

Reissues the specified card and assigns the new card the same PAN and PIN (personal identification number) but a new expiration date and CVV2 number

Maximum length: 36 characters

translate_pin_from_card_token

String

Optional

Assigns the newly created card the same PIN as the specified card

Maximum length: 36 characters

Note: Both cards must belong to the same user. Additionally, reissue_pan_from_card_token must not be set.

activation_actions

Object

Optional

Contains actions to perform at card activation

Note: The fields in this object are mutually exclusive.

bulk_issuance_token

String

Optional

Token of the bulk card order to link the card to

Note: This field cannot be updated once set.

Maximum length: 36 characters

Note: Please refer to the Additional Parameters and Response Fields lesson for details of the expiration_offset, fulfillment, and activation_actions ...

Access this course and 1400+ top-rated courses and projects.