This guide uses the following endpoints
To issue a card you will need to
1. Get the Account ID
Before you can issue a card, you will need to obtain theid for the account that the card will be issued against. This can be accomplished by making a GET request to the account endpoint.
id for the account that the card will be issued against.
2. Get the Card Product ID
Individual cards (both physical and virtual) are based on a what is known as a card product. Card products act much like templates. They contain all of the program settings, customizations, and behaviors for the cards that you issue (including whether the card are physical or virtual). In general, Card Products will be configured by Treasury Prime when you set up your card program. Thecardproduct endpoint is available for reference purposes, but will not allow you to directly configure a card product at this time.
To obtain the id for the card product that the card will be modeled after, make a GET request to the cardproduct endpoint.
id for the card product that the card will be modeled after.
3. Get the Person ID
Cards are issued against accounts, but they also need to be tied to a specific person. To specify the person this card will be issued to, we need to obtain their Person ID. The first step in acquiring the Person ID is to make aGET request to the accounts endpoint, passing in the ID (shown here as :id) of the account that this card will be issued against (which was retrieved earlier in this exercise).
primary_person_id which contains the Person ID of the primary account holder. The second is person_ids which contains an Array of Person IDs representing each of the listed owners for this account.
4. Issue the Card
Now that you have collected the Account ID, Card Product ID, and Person ID, it’s time to issue the card! In production, this will result in a card being issued to the specified account and user; however, physical issuance of a card has been disabled in the Developer Sandbox for testing purposes. To issue the card, make aPOST request to the card endpoint, passing along the account_id, card_product_id, and person_id.
You may also include optional creation_options sub-object with name_line_two text to be printed under the cardholder name, up to a maximum of 21 characters.
status is set to “unactivated”. Before transactions can be made with this card, the card will need to be activated, which we will cover in the next section.
Reissuing an Existing Card
If you’d like to reissue a card with the same PAN and pin number, but a new CVV and expiration date you can use the optionalreissue_pan_from_card_id field and input an existing card object when creating a card.
{% alert severity=“warning” %} Reissuing a card is a great option when a card may be damaged or about to expire. If a card has been compromised, lost, or stolen it is best to create an entirely new card and PAN. {% /alert %}
5. Activate the Card
The final step in the card issuance process is card activation. To accomplish this, make aPATCH request to the card endpoint passing the id of the card to be updated, and set the status property to “active” in the request body.