---
title: "Register Card"
method: PUT
path: "/v2/issuers/{issuerId}/cards/{cardId}"
tags: ["Card"]
---

# Register Card

`PUT /v2/issuers/{issuerId}/cards/{cardId}`

This request is used to register a card with corresponding cards credentials.
This operation is applicable for card product supporting:
  - No authorisation mode
  - Light authorisation mode

The cardId used to register the card shall be unique. A cardId can be reused to register another card (having a different PAN) under several conditions:
  - The cardId to be reused is linked with a DELETED or REPLACED card
  - The cardId to be reused is not associated to a card issued by D1 (a card created using the CREATE card API).
  - The cardId to be reused is not associated with a card product used for making transactions
  - In any case, it is not possible to register a card PAN already deleted or replaced. Even by reusing a cardId.
Reusing a cardId for another consumer is not recommanded. Since the cardId will disappear from the previous consumer cards list.

## Request body

- object
  - `consumerId` string, required — Unique identifier of the end user.
  - `cardProductId` string, required — Unique identifier of the type of card (defined during the onboarding of D1)
  - `state` 'ACTIVE' | 'SUSPENDED' — The state of the card<br/>If not provided, the card is considered ACTIVE
  - `name` string, required — Name of the card holder as it will be printed/embossed on the card.<br/>For virtual card this value will be used exclusively for card display.<br/>Empty string supported.
  - `secondName` string — Optional second card holder name as it will be printed/embossed on the card under the first card holder name.<br/>Not used in case of virtual card.
  - `encryptedData` string, required — The encryptedData is the encrypted json (cf http://www.json.org/) representation of the Card information. This value is encrypted using the JWE encryption (please refer to the **[Encrypt sensitive data](../../../integrate-the-d1-api/encrypt-sensitive-data)** for more details) <br/><br/>Once deciphered, the plaintext contains a json structure with: |JSON field parameter name|description|MOC|Format| |-------|-------|-------|-------| |pan|The funding pan value.|M|string - up to 19 digits| |exp|The expiry date of the card.|M|string - 4 digits, following the format MMYY| |auxiliaryPan|The auxiliary funding pan value. It shall be provided when cobadge is supported and if the card has an auxiliary pan.|C|string - up to 19 digits| |auxiliaryExp|The auxiliary expiry date of the card. It shall be provided when cobadge is supported and if the card has an auxiliary pan.|C|string - 4 digits, following the format MMYY| As D1 is able to compute the CVV2, the cvv parameter is not expected. <br> <br>

## Response `204`

Successful card registration

## Other responses

- `400` — Bad Request, Invalid request URI, header, paramters. The below table defines the possible 'Bad request' error: | errorCode | error | Retryable | Comments | | -------------- | ------------| ----------| -----------------------------------| | - | - | no | No error details available | | FIELD_INVALID_FORMAT | Contains the field in error (first found) | no | One field is not expected format as defined in this documentation | | CRYPTO_ERROR | - | no | Not possible to decrypt the provided encrypted data | | FIELD_INVALID_VALUE | - | no | One field value is not allowed for the given field | | INVALID_PAN | - | no | PAN is invalid | | INVALID_EXPIRY_DATE | Expiry date is invalid |
- `401` — Unauthorized request, the provided Authorization header is missing or invalid. In the table below only the field "error" is provided. | errorCode | error | Retryable | Comments | | -------------- | ------------| ----------| -----------------------------------| | AUTHORIZER_UNAUTHORIZED | Unauthorized message | no | Access token not valid |
- `403` — Forbidden action detected by WAF or the application. The below table defines the possible error: | errorCode | error | Retryable | Comments | | -------------- | ------------| ----------| -----------------------------------| | - | - | no | No error details available | | AUTHORIZER_FORBIDDEN | not\_authorized error message | no | User\_is\_not\_authorized\_to\_access\_this\_resource | | CARD_ALREADY_EXISTS | - | no | CardId already registered in the solution | | CARD_INVALID_STATE | - | no | CardId already registered in the solution and has an invalid card state (REPLACED or DELETED) | | CONSUMER_INVALID_STATE| - | no | Consumer exists with an invalid consumer state (DELETED) | | OPERATION_NOT_ALLOWED | Name of the operation/field that is not allowed in this operation | no | Register is not allowed for this card product |
- `404` — Ressource not found, Unknown issuerId
- `500` — Internal Server Error. The below table defines the possible error: |errorCode | error | Retryable | Comments | | -------------- | ------------| ----------| -----------------------------------| | - | - | yes | No error details available | | INTERNAL_ERROR | error details if any | no | The server has encountered an error when executing the request. |
- `503` — The service is temporarily unavailable. You may retry your request later.

---

[API](https://skmtc.net/thalescloud/apis/d1-oauth-api.md) · [All operations](https://skmtc.net/thalescloud/apis/d1-oauth-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thalescloud/d1-oauth-api/versions/96089514858c/schema)
