> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enfuce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a virtual VISA branded card

> This operation will create a credit or prepaid card media connected to  a given customer. An account id needs to be provided as well so we know to which account the card should be connected to. > **Note:** You cannot use this endpoint to order a physical plastic card. The virtual card does not have a PIN and hence, it might not work at ATMs.



## OpenAPI

````yaml card post /v4/VISA_VIRTUAL/customer/{customerId}/account/{accountId}/{cardRole}
openapi: 3.0.3
info:
  description: >
    Card API have different endpoints for creating, editing and updating a card
    via different methods.


    Below in the picture is the basic flow of a card lifecycle. Note we don't
    restrict changes,

    so it is possible although not advisable e.g. to change card status from
    Card Lost to Card OK.


    ![ Card lifecycle
    ](https://enfuce-public-resources.s3.eu-central-1.amazonaws.com/public/card_lifecycle.svg)


    Below is a short summary of each status:

    <table>
      <tr>
        <th>Status name</th>
        <th>Description</th>
        <th>Authorisations rejected</th>
        <th>Clearing transactions posting blocked</th>
      <tr>
        <td>Card OK</td>
        <td>Card is open and in normal status. Card has to be in this status in order for it to be renewed.</td>
        <td>No</td>
        <td>No</td>
      </tr>
      <tr>
        <td>Card Blocked</td>
        <td>Temporary block on the card that will prevent approval of authorisations. Can be used instead of account level temporary block if target is to block only a specific card.</td>
        <td>Yes</td>
        <td>No</td>
      </tr>
      <tr>
        <td>Suspected Fraud</td>
        <td>Temporary block on the card that will prevent approval of authorisations. Functionality the same as for "Card blocked", the different code allows to differentiate between the blocks.</td>
        <td>Yes</td>
        <td>No</td>
      </tr>
      <tr>
        <td>Card No Renewal</td>
        <td>Status set to prevent following card renewal. Does not affect card functionality in any way, only renewal.</td>
        <td>No</td>
        <td>No</td>
      </tr>
      <tr>
        <td>Card Closed Due To Fraud</td>
        <td>Used to close a card due to known fraud.</td>
        <td>Yes</td>
        <td>No</td>
      </tr>
      <tr>
        <td>Card Lost</td>
        <td>Used to close a card because it is lost.</td>
        <td>Yes</td>
        <td>No</td>
      </tr>
      <tr>
        <td>Card Stolen</td>
        <td>Used to close a card because it is stolen.</td>
        <td>Yes</td>
        <td>No</td>
      </tr>
      <tr>
        <td>Card Closed</td>
        <td>Used to close card by request from customer or bank, reason for closure is set with status update reason. Allows still clearing transaction posting.</td>
        <td>Yes</td>
        <td>No</td>
      </tr>
    </table>


    ### Encrypted payload for _Create card_ or _Get card_ with a full card
    number


    The payload field _encryptedData_ in create card requests is encrypted with
    JWE (JSON Web Encryption). 

    The field value must be presented using compact serialization scheme, i.e.
    Base64URL-encoded elements 

    separated by a ".".


    JWE should use RSA-OAEP-256 algorithm for encrypting the random symmetric
    key and A256GCM algorithm for

    encrypting the payload. Public keys used for encryption are provided in
    certificates below. 

    JWE header must also contain parameter "x5t#S256" with SHA256 fingerprint of
    the certificate used. 

    See RFC7516 section 4.1.10.


    The payload to be encrypted must be in JSON-format and contain field
    "cardNumber". For example:

            { "cardNumber": "5555555555554444" }

    Certificate for test environments (jwe-test-20260422.pem):

            -----BEGIN CERTIFICATE-----
            MIIDsTCCApmgAwIBAgIUNbIeMweA9gtL+71Uoctyok+LP5owDQYJKoZIhvcNAQEL
            BQAwaDELMAkGA1UEBhMCRkkxDjAMBgNVBAcMBUVzcG9vMQ8wDQYDVQQKDAZFbmZ1
            Y2UxETAPBgNVBAsMCENhcmQgQVBJMSUwIwYDVQQDDBxqd2UtdGVzdC0yMDI2MDQy
            Mi5lbmZ1Y2UuY29tMB4XDTI2MDQyMjA4MTQ1MVoXDTI4MDQxMTA4MTQ1MVowaDEL
            MAkGA1UEBhMCRkkxDjAMBgNVBAcMBUVzcG9vMQ8wDQYDVQQKDAZFbmZ1Y2UxETAP
            BgNVBAsMCENhcmQgQVBJMSUwIwYDVQQDDBxqd2UtdGVzdC0yMDI2MDQyMi5lbmZ1
            Y2UuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl9nrCsMtzGy2
            r/tfZugYW8vX/+GoZv9FUK2XfsEqgaTBWVQZvkbRKAijtdymHXwe72rZuVBotaUm
            ES/5Eqqhy5Mb6pYZ9H3VwV0tq6RSiq6A9nEevfPHe2UXl66K6XC8WWXtLyHu1sdk
            t9Gf4zLMspL7C+8m1OfJMZzBAEXcuoNcUPbWHzupyWpKvCZqbV1kwXDaYhCYR0cQ
            BLNUTxQS+fIYZrlrzIiwGng/3IDBsaVuJdFfa3OqRcNPt6rbcvtrQ3pN6zSvOPB6
            MVUKNPp7PeSBYomnPa+CI68XG9GfxK3fhos/uUlrQv4rnDP/qTtUvrK9VutDrg4r
            y/GXroEr8wIDAQABo1MwUTAdBgNVHQ4EFgQUnZQPK6mB0zIKBmPXjSkFWGJR4zMw
            HwYDVR0jBBgwFoAUnZQPK6mB0zIKBmPXjSkFWGJR4zMwDwYDVR0TAQH/BAUwAwEB
            /zANBgkqhkiG9w0BAQsFAAOCAQEAV7yknM6xyWA2lZlDKaQdg7Jug6pKvW6733IQ
            ois3/1VJPa1piDiNWfQcvvinxvTyczCjnh/HOdtbFfLJHezcj1R/YsrSE45VIc9Z
            d3gwK1MpLUNdb9ifmpxT9gfGy7mPNZC0FtzWHqWwcogzyScoLWT11usqHR64aZiZ
            /shfQPy6iK5gDF6yrwUB+Tv3TZl934GvYhFw/P3uk7ZSJ27/XhUrbnooagqRYZlN
            +/+2hvyGDZ4YVfdt7rhWfmm3xHNCVVyRjuLaaWOebWM+y705KN57DXyXxDPkmmud
            M2aru88ojhKc73QIQy8izAOTFKtyuOxtQR7PbDBpXcJhHGO/UQ==
            -----END CERTIFICATE-----

    Certificate for production environments (jwe-20260422.pem):

            -----BEGIN CERTIFICATE-----
            MIIDpzCCAo+gAwIBAgIUP+Z0k9p29DQZLP62py6KuG8XbRQwDQYJKoZIhvcNAQEL
            BQAwYzELMAkGA1UEBhMCRkkxDjAMBgNVBAcMBUVzcG9vMQ8wDQYDVQQKDAZFbmZ1
            Y2UxETAPBgNVBAsMCENhcmQgQVBJMSAwHgYDVQQDDBdqd2UtMjAyNjA0MjIuZW5m
            dWNlLmNvbTAeFw0yNjA0MjIwODE3NDZaFw0yODA0MTEwODE3NDZaMGMxCzAJBgNV
            BAYTAkZJMQ4wDAYDVQQHDAVFc3BvbzEPMA0GA1UECgwGRW5mdWNlMREwDwYDVQQL
            DAhDYXJkIEFQSTEgMB4GA1UEAwwXandlLTIwMjYwNDIyLmVuZnVjZS5jb20wggEi
            MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCCmlTBos5Q32mEL3XU0UjrPN22
            27YpyqCE234kwJ8BIBnzkQdrfkB27cucYnzj7HHg+1tn7CJBtprwkwzAEMW2CY5G
            /3kOD9hw9amFKtw1C/pMW4ZJh0W8pbbN1+9Y0Ti85hWQN7+UVyRybZqSr8aCXKV9
            5qyVU/00rdDT+mXdSjppzn3HU4jmWABIwJkT5wyxeIMonr+O+WHW08yd1LYd5ID6
            tfyC8o48pXI2uugyNGIPKdwiaK/C/qojiJYJRRZEaXatAk2OFFvq+ryeICO88TK9
            eB7ngEPpfa04nebkH8Scj4rbyYPmSyFpGfvVeXvzODixdI1Qxz/KK9j96PiNAgMB
            AAGjUzBRMB0GA1UdDgQWBBSFbT/MlsLoAOdcGNVwCbJWnEFVyTAfBgNVHSMEGDAW
            gBSFbT/MlsLoAOdcGNVwCbJWnEFVyTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3
            DQEBCwUAA4IBAQAHGOulvkVGjntcH9fJMRgOh32fjddc3+UDx5DKGluvDoqEgZdw
            ow1PFSRMNNHfMlOLCpNsiwuLJhA5weWUZnrMrizVkTGf2M39FkltlozY/mWwkJ97
            3sSfy6AN1lw/IbWJqOaYYU5wAWPgVP7lkiyDhJ21QtgHKeRQeTAtwuV3vv5cj/Cx
            ns/vYrXsoEJTboimlNm9eLUq61B+BFsZqJsvu8S3nT0icM4d4ZXwD0Ci/cs76wQN
            iLe3+O3GM1rQu+upvZJd9LqylXGa/mi5y0TwlunCG9ppIOotZQZpS3JlS8gKPTwS
            iUuAvpt0bTTTqMDpE+4i9pjqiU6hyGguFkaB
            -----END CERTIFICATE-----
  version: '1'
  title: Card details API
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: >-
      https://integration-api-cat2.{{environment}}.ext.{{realm}}.cia.enfuce.com/card
  - url: https://integration-api-cat2.live.ext.prod.cia.enfuce.com/card
    description: Live environment
security: []
tags:
  - name: Create card
    description: <p>Endpoints for creating a card</p>
  - name: Update card
    description: <p>Endpoints for updating a card</p>
  - name: Get card
    description: Endpoints for fetching a card
  - name: Get plastic
    description: Endpoints for fetching a plastic
  - name: Update plastic
    description: <p>Endpoints for updating a plastic</p>
  - name: Get application
    description: Endpoints for fetching an application
  - name: Update application
    description: <p>Endpoints for updating an application</p>
paths:
  /v4/VISA_VIRTUAL/customer/{customerId}/account/{accountId}/{cardRole}:
    post:
      tags:
        - Create card
      summary: Create a virtual VISA branded card
      description: >-
        This operation will create a credit or prepaid card media connected to 
        a given customer. An account id needs to be provided as well so we know
        to which account the card should be connected to. > **Note:** You cannot
        use this endpoint to order a physical plastic card. The virtual card
        does not have a PIN and hence, it might not work at ATMs.
      operationId: createVisaVirtualV4UsingPOST
      parameters:
        - name: customerId
          in: path
          description: The customer id of which customer you want to create the card on
          required: true
          schema:
            type: string
            format: biginteger
        - name: accountId
          in: path
          description: The account id that the card should be connected to
          required: true
          schema:
            type: string
            format: biginteger
        - name: cardRole
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/cardRole'
        - name: auditUser
          in: query
          description: The audit user to log the request
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/createVirtualResourceBody'
      responses:
        '201':
          description: Successful creation of the product
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/resourceResponse'
        '401':
          $ref: '#/components/responses/error401'
        '403':
          $ref: '#/components/responses/error403'
        '404':
          description: Customer does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '500':
          $ref: '#/components/responses/error500'
      deprecated: false
components:
  schemas:
    cardRole:
      type: string
      description: >
        A role needs to be provided for the connection to the account. Role is
        one way to categorize between  primary and supplementary card holders.
        Role MAIN will always create a card to have same account holder  and
        card holder. For a supplementary card there is a possibility to differ
        between account and card holder.
      enum:
        - MAIN
        - SUPPLEMENTARY
    resourceResponse:
      type: object
      properties:
        description:
          type: string
          description: Short description of the result of the action
        id:
          type: string
          description: Will contain the ID of the resource that has been created or updated
      title: resourceResponse
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaining the error reason
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occurred
    createVirtualResourceBody:
      allOf:
        - $ref: '#/components/schemas/createBaseResourceBody'
        - properties:
            embossing:
              $ref: '#/components/schemas/embossing'
            productCode:
              $ref: '#/components/schemas/productCode'
      title: createVirtualResourceBody
    createBaseResourceBody:
      type: object
      properties:
        expiration:
          $ref: '#/components/schemas/expiration'
        segment:
          $ref: '#/components/schemas/segment'
        pinStatus:
          $ref: '#/components/schemas/pinStatus'
        digitalLayoutCode:
          $ref: '#/components/schemas/digitalLayoutCode'
        scheduledClosing:
          $ref: '#/components/schemas/scheduledClosing'
        additionalValues:
          $ref: '#/components/schemas/additionalValues'
        encryptedData:
          type: string
          description: JWE encrypted card number, see details above
      title: createResourceBody
    embossing:
      type: object
      description: >
        Default set of allowed characters for fields embossed onto the card:


        A-Z, a-z, Áá, Ää, Åå, Ææ, Éé, Íí, Ðð, Óó, Öö, Øø, Úú, Üü, Ýý, Þþ, 0-9,
        symbols -/.,&+' and space.  


        For printed cards allowed characters are: (including the above)


        ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüý

        þÿĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıĲĳĴĵĶķĸĹ

        ĺĻļĽľĿŀŁłŃńŅņŇňŉŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵ

        ŶŷŸŹźŻżŽžſǪǫȘșȚțȪȫȮȯȲȳḐḑṢṣẞỌọ


        Printed or others characters sets must be agreed in advance.
      properties:
        additionalField1:
          type: string
          description: >
            Field value is forwarded to embossing house in order to be used as
            additional embossing lines. In order to use this field selected
            embossing house must in advance agree where this is put.
          maxLength: 32
        additionalField2:
          type: string
          description: >
            Field value is forwarded to embossing house in order to be used as
            additional embossing lines. In order to use this field selected
            embossing house must in advance agree where this is put.
          maxLength: 32
        additionalField3:
          type: string
          description: >
            Field value is forwarded to embossing house in order to be used as
            additional embossing lines. In order to use this field selected
            embossing house must in advance agree where this is put.
          maxLength: 32
        additionalField4:
          type: string
          description: >
            Field value is forwarded to embossing house in order to be used as
            additional embossing lines. In order to use this field selected
            embossing house must in advance agree where this is put.
          maxLength: 32
        additionalField5:
          type: string
          description: >
            Field value is forwarded to embossing house in order to be used as
            additional embossing lines. In order to use this field selected
            embossing house must in advance agree where this is put.
          maxLength: 32
        companyName:
          type: string
          description: ''
          maxLength: 26
          example: Enfuce Financial Services
        externalLayoutCode:
          type: string
          description: >
            Code forwarded to embossing house in order to select which plastic
            layout to use. In order to use this field selected embossing house
            must in advance agree on name for each layout.
          maxLength: 32
          example: BlueCard
        firstName:
          type: string
          description: >
            The length of firstName should not exceed 26 characters length. A
            combined length of firstName and lastName  should not exceed 26
            characters length.
          maxLength: 26
          example: Monica
        lastName:
          type: string
          description: >
            The length of lastName should not exceed 26 characters length. A
            combined length of firstName and lastName  should not exceed 26
            characters length.
          maxLength: 26
          example: Liikamaa
        additionalEmbossingName:
          type: string
          description: >
            Optional additional embossing name to be printed on the card as a
            second line,  alongside the primary embossing name.  Usage of this
            field and its placement on the card must be agreed with the relevant
            card bureau.
          maxLength: 26
          example: Card User Name
        manufacturer:
          type: string
          description: >
            Name of manufacturer for the card. This has to be agreed in advance
            with Enfuce in order to support  multiple embossing houses.
          pattern: '[A-Z0-9_\-]{1,32}'
          example: FACTORY_X
        physical:
          type: boolean
          description: >
            This tag will indicate will there be a physical representation of
            the card.  If true, the card will be placed for card personalisation
            and end user will receive a physical plastic.  If false, the card
            will not be placed for card personalisation and end user will not
            receive a physical plastic.
          example: true
    productCode:
      type: string
      description: >
        This field is used when the institution has multiple card products
        setup. The productCode is used to determine the specific card product.
        Use of this field as well as the values of the field, is dependent on
        institution setup and should be aligned with Enfuce prior to use.
      pattern: ^[A-Z][A-Z_0-9]{1,64}$
      example: MC_CARD_2, VISA_CARD1, VISA_VIRTUAL_3, MC_VIRTUAL_2, VISA_CARD
    expiration:
      type: object
      properties:
        year:
          type: integer
          format: int32
          description: Expiration year in format YYYY
          example: 2019
        month:
          type: integer
          format: int32
          description: Expiration month in format MM
          example: 1
      title: expiration
    segment:
      type: string
      description: >-
        Field enables to group an entity into a segment. This field will be
        exported but no logic is applied to this in Enfuce API
      enum:
        - SEGMENT_A
        - SEGMENT_B
        - SEGMENT_C
        - SEGMENT_D
        - SEGMENT_E
        - SEGMENT_F
      title: segment
    pinStatus:
      type: string
      description: >
        This flag will indicate current status for PIN generation. If not
        specified system will automatically assign D

        as default and make sure a PIN is calculated during next embossing
        process. If set to W, then card will be excluded

        from embossing process until a PIN has been set and status has been
        updated to S. It is also possible to revert

        to D, in order for system to generate PIN. Note that system will update
        to status S automatically when a PIN is

        set successfully.

        ### New card

        In order for a new card to not get a system generated PIN then pinStatus
        flag must be set to W when created,

        this will then halt the embossing process for given card until a PIN has
        been set.

        ### Reissue card

        When reissuing a card it is possible to set pinStatus to W in order to
        hold embossing process for given card

        until a PIN has been set. Update pinStatus is done on same card id that
        is reissued.

        ### Replace card

        When replacing a card it is possible to set pinStatus to W in order to
        hold embossing process for given card

        until a PIN has been set. Update pinStatus is done on new card id that
        is returned when replacing.

        - D - default and a random PIN will be generated

        - W - waiting for PIN to be manually set

        - S - PIN has been set successfully
      enum:
        - D
        - W
        - S
    digitalLayoutCode:
      type: string
      description: >
        Id used for digital wallet artwork and other related assets. Use of this
        need to be agreed with Enfuce separately
      maxLength: 32
      pattern: ^[a-zA-Z0-9]+$
      example: abc123abc
    scheduledClosing:
      type: object
      title: scheduledClosing
      description: >-
        Scheduled closing of the card. Use of this object should be aligned with
        Enfuce prior to use.
      properties:
        type:
          $ref: '#/components/schemas/scheduledClosingType'
        time:
          $ref: '#/components/schemas/scheduledClosingTime'
    additionalValues:
      type: array
      maxItems: 10
      description: >
        The additionalValues array is used to store information in the form of
        key-value pairs. 

        Enfuce does not perform any validation on these key-value pairs beyond
        ensuring they adhere to the character limit constraints. 

        The primary purpose of these key-value pairs is to store data without
        further processing.

        In newer versions of the card personalization files, these key-value
        pairs are included in the file. 

        However, this inclusion is version-dependent. We recommend consulting
        the specific version details of your card personalization files 

        to confirm whether these values will be added to the card
        personalization file in your case.
      items:
        $ref: '#/components/schemas/keyValuePair'
    scheduledClosingType:
      type: string
      description: >
        This field is used when there is a need to setup the scheduled closing
        of the card. Use of this field should be aligned with Enfuce prior to
        use.
      enum:
        - TIMEBASED
    scheduledClosingTime:
      type: string
      format: date-time
      description: >
        This field is used to determine the date for closing of the card. Card
        will be closed on that date which is selected. 

        The time specified in the closing time must adhere to the UTC time zone.
        Use of this field should be aligned with Enfuce prior to use.
      example: '2099-12-31T03:00:00.000Z'
    keyValuePair:
      type: object
      properties:
        key:
          type: string
          minLength: 1
          maxLength: 8
          pattern: ^[a-zA-Z0-9\-\_ ]*$
        value:
          type: string
          minLength: 1
          maxLength: 50
          pattern: >-
            ^[a-zA-Z0-9|\-_
            +.éàèùçâêîôûëïü'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıĲĳĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňŉŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſǪǫȘșȚțȪȫȮȯȲȳḐḑṢṣẞỌọ]*$
  requestBodies:
    createVirtualResourceBody:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/createVirtualResourceBody'
      description: >-
        The fields that you want to apply to your newly created card, these
        values will override the predefined template values
      required: true
  responses:
    error401:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error403:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error500:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'

````