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

# Card Webhook

> This is not an endpoint. This is the description of a request that is sent to subscribed webhooks upon card creation, update or closure.

<Card title="Download OpenAPI specification" href="https://enfuce-public-resources.s3.eu-central-1.amazonaws.com/public/api/mycore/external/issuer/events/external/card-event.openapi.json" horizontal />


## OpenAPI

````yaml json-files/card-event.openapi.json post /card
openapi: 3.0.3
info:
  description: >
    All date-time fields adhere to the ISO 8601 standard unless specified
    otherwise.

    For example: 2024-05-31T06:55:17Z
  title: Issuer Card Event API
  version: 1.0.0
servers: []
security: []
tags:
  - name: Issuer event webhooks
paths:
  /card:
    post:
      tags:
        - Issuer event webhooks
      summary: Outgoing card event webhook endpoint
      description: >-
        This is not an endpoint. This is the description of a request that is
        sent to subscribed webhooks upon card creation, update or closure.
      operationId: cardEvent
      requestBody:
        description: Card event
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CardEvent'
      responses:
        '204':
          description: Event processed successfully.
        '500':
          description: Error while processing event. Event will be retried.
components:
  schemas:
    CardEvent:
      type: object
      allOf:
        - $ref: '#/components/schemas/CardResponse'
    CardResponse:
      type: object
      title: Create Single Card
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/Id'
          description: Unique identifier of a card.
        createdAt:
          $ref: '#/components/schemas/Created'
        updatedAt:
          $ref: '#/components/schemas/Updated'
        programId:
          allOf:
            - $ref: '#/components/schemas/Id'
          description: The program ID associated with the card.
        cardholderId:
          allOf:
            - $ref: '#/components/schemas/Id'
          description: Unique identifier of the cardholder associated with the card.
        accountId:
          allOf:
            - $ref: '#/components/schemas/AccountId'
          description: Unique identifier of the account associated with the card.
        plastic:
          $ref: '#/components/schemas/Plastic'
        cardVersions:
          type: array
          description: Card versions ordered by sequence number ascending.
          items:
            $ref: '#/components/schemas/CardVersion'
        role:
          $ref: '#/components/schemas/CardRole'
        mainCardId:
          allOf:
            - $ref: '#/components/schemas/Id'
          description: >-
            Unique identifier of the main card. Populated if this card is part
            of a card application
        cardConfigurationCode:
          $ref: '#/components/schemas/CardConfigurationCode'
        cardConfigurationType:
          $ref: '#/components/schemas/CardConfigurationType'
        cardScheme:
          $ref: '#/components/schemas/CardScheme'
        maskedPan:
          $ref: '#/components/schemas/MaskedPrimaryAccountNumber'
        pinStatus:
          $ref: '#/components/schemas/PinStatus'
        cardStatus:
          $ref: '#/components/schemas/CardStatus'
        automaticRenewal:
          $ref: '#/components/schemas/AutomaticRenewal'
        digitalLayoutCode:
          $ref: '#/components/schemas/DigitalLayoutCode'
        multiApplicationProperties:
          $ref: '#/components/schemas/MultiApplicationProperties'
        updateCount:
          $ref: '#/components/schemas/UpdateCount'
        additionalValues:
          $ref: '#/components/schemas/AdditionalValues'
        feeConfigId:
          allOf:
            - $ref: '#/components/schemas/FeeConfigId'
          nullable: true
    Id:
      type: string
      format: uuid
      description: Unique identifier of a resource.
      example: 20218aae-b15e-406c-9e9f-23735cd86a48
    Created:
      type: string
      format: date-time
      description: The date and time when the card was created.
    Updated:
      type: string
      format: date-time
      description: The date and time when the object/entity was updated last time.
    AccountId:
      type: string
      description: Unique identifier of an account.
      minLength: 1
      maxLength: 36
      example: 20218aae-b15e-406c-9e9f-23735cd86a48
      pattern: ^[a-zA-Z0-9-]+$
    Plastic:
      type: object
      properties:
        embossingName:
          $ref: '#/components/schemas/EmbossingName'
        preferredCardAddress:
          $ref: '#/components/schemas/Address'
        preferredCardDeliveryType:
          $ref: '#/components/schemas/CardDeliveryType'
        preferredPinAddress:
          $ref: '#/components/schemas/Address'
        preferredPinDeliveryType:
          $ref: '#/components/schemas/PinDeliveryType'
        manufacturerId:
          $ref: '#/components/schemas/Id'
        externalLayoutCode:
          $ref: '#/components/schemas/ExternalLayoutCode'
        createdAt:
          $ref: '#/components/schemas/Created'
        updatedAt:
          $ref: '#/components/schemas/Updated'
    CardVersion:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/CardVersionStatus'
        expirationTime:
          $ref: '#/components/schemas/ExpirationTime'
        renewalDate:
          $ref: '#/components/schemas/RenewalDate'
        sequenceNumber:
          $ref: '#/components/schemas/SequenceNumber'
        keySetId:
          $ref: '#/components/schemas/KeySetId'
        createdAt:
          $ref: '#/components/schemas/Created'
        updatedAt:
          $ref: '#/components/schemas/Updated'
    CardRole:
      type: string
      description: >-
        The role of the card. Multi application cards will have one main card
        and multiple card applications. Single cards will be treated as main
        cards.
      enum:
        - MAIN_CARD
        - CARD_APPLICATION
      example: MAIN_CARD
    CardConfigurationCode:
      type: string
      description: >-
        A unique code to identify the card configuration. Max character limit is
        36.
      example: MC_DEBIT_1
      minLength: 1
      maxLength: 36
      pattern: ^[A-Za-z0-9_-]+$
    CardConfigurationType:
      type: string
      description: The type of card defined by this card configuration.
      enum:
        - DEBIT
        - CREDIT
        - COMBO
      example: CREDIT
    CardScheme:
      type: string
      enum:
        - MASTERCARD
        - VISA
      example: MASTERCARD
    MaskedPrimaryAccountNumber:
      type: string
      description: A masked version of the primary account number
      example: 123456______4285
    PinStatus:
      type: string
      description: >
        - GENERATED - A pin has been randomly generated for the card.

        - WAITING - A pin is waiting to be set on the card.

        - SET - A pin has been manually set on the card.

        - INHERITED - For card applications only. The pin status is inherited
        from the main card.
      enum:
        - GENERATED
        - WAITING
        - SET
        - INHERITED
      example: GENERATED
    CardStatus:
      type: string
      description: >
        - ACTIVE - Card is active and is enabled for normal usage.

        - BLOCKED - Card is temporarily blocked.

        - BLOCKED_SUSPECTED_FRAUD - Card is temporarily blocked due to suspected
        fraud.

        - CLOSED_DUE_TO_FRAUD - Card has been closed due to fraud.

        - CLOSED_LOST - Card has been closed due to being lost.

        - CLOSED_STOLEN - Card has been closed due to being stolen.

        - CLOSED - Card has been manually closed.

        - CLOSED_EXPIRED - Card has no active or initial card versions and
        cannot be used.
      enum:
        - ACTIVE
        - BLOCKED
        - BLOCKED_SUSPECTED_FRAUD
        - CLOSED_DUE_TO_FRAUD
        - CLOSED_LOST
        - CLOSED_STOLEN
        - CLOSED
        - CLOSED_EXPIRED
      example: ACTIVE
    AutomaticRenewal:
      type: boolean
      description: A flag indicating whether automatic renewal is enabled or not.
    DigitalLayoutCode:
      type: string
      description: The digital layout code for the card. Max character limit is 36.
      minLength: 1
      maxLength: 36
      pattern: ^[a-zA-Z0-9-]+$
      example: 9
    MultiApplicationProperties:
      type: object
      properties:
        applicationName:
          $ref: '#/components/schemas/ApplicationName'
        applicationIndex:
          $ref: '#/components/schemas/ApplicationIndex'
        contactPriorityLevel:
          $ref: '#/components/schemas/ContactPriorityLevel'
        contactlessPriorityLevel:
          $ref: '#/components/schemas/ContactlessPriorityLevel'
        printed:
          $ref: '#/components/schemas/Printed'
        chipEnabled:
          $ref: '#/components/schemas/ChipEnabled'
    UpdateCount:
      type: integer
      description: The version number of the entity.
      example: 1
    AdditionalValues:
      type: object
      description: >
        You can include up to **30 additional key-value pairs** in the embossing
        file sent to the card manufacturer.


        - **Keys** must follow the pattern: `^[a-zA-Z0-9-]{1,36}$` (only
        letters, numbers, and hyphens, with a maximum length of 36 characters).

        - **Values** must follow the pattern: `^[a-zA-Z0-9|\-_
        +.@éàèùçâêîôûëïü'/=]{1,1000}$`.


        Enfuce **does not perform any additional validation** on these key-value
        pairs beyond ensuring they match the specified patterns.


        These fields are intended for **storing data without further
        processing**. If you need to store a **complex structure**, you can
        **base64 encode** the value. The encoded value will be passed as
        entered, without modifications.


        ⚠ **Important:** Any usage of these fields should be agreed upon with
        the manufacturer.
      maxProperties: 30
      additionalProperties:
        type: string
      example:
        keyWithPlainTextValue: value1
        keyWithBase64Value: dmFsdWUyYmFzZTY0ZW5jb2RlZA==
    FeeConfigId:
      type: string
      description: >
        Unique identifier of a fee configuration. When provided, this value
        overrides the program default. This feature must be enabled for the
        tenant; otherwise, this field can be left null and will not be used.
      minLength: 1
      maxLength: 36
      example: SILVER
      pattern: ^[a-zA-Z0-9_-]+$
    EmbossingName:
      type: string
      description: The name to be embossed on the card. Max character limit is 26.
      minLength: 1
      maxLength: 26
      pattern: >-
        ^[A-Za-z0-9 /.,&+'\-
        ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
        ĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıĲĳĴĵĶķĸĹ
        ĺĻļĽľĿŀŁłŃńŅņŇňŉŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰű
        ŲųŴŵŶŷŸŹźŻżŽžſǪǫȘșȚțȪȫȮȯȲȳḐḑṢṣẞỌọ]+$
      example: John Doe
    Address:
      type: object
      properties:
        address1:
          description: First line of address.
          type: string
          minLength: 1
          maxLength: 255
          pattern: ^(?!\s)(?!.*\s$).+(?<!\s)$
          example: Kings street 12
        address2:
          type: string
          pattern: ^(?!\s)(?!.*\s$).*(?<!\s)$
          description: >-
            Second line of address. Any string without trailing or leading
            whitespaces, or an empty string.
          maxLength: 255
          example: Apartment 5B
        address3:
          type: string
          pattern: ^(?!\s)(?!.*\s$).*(?<!\s)$
          description: >-
            Third line of address. Any string without trailing or leading
            whitespaces, or an empty string.
          maxLength: 255
          example: Building C
        address4:
          type: string
          pattern: ^(?!\s)(?!.*\s$).*(?<!\s)$
          description: >-
            Fourth line of the address. Any string without trailing or leading
            whitespaces, or an empty string.
          maxLength: 255
          example: Entrance North
        city:
          type: string
          minLength: 1
          maxLength: 255
          pattern: ^(?!\s)(?!.*\s$).+(?<!\s)$
          example: Mariehamn
        country:
          type: string
          description: A valid ISO-3166-1 alpha-3 country code.
          pattern: '[A-Z]{3}'
          example: FIN
        region:
          type: string
          maxLength: 32
          example: Åland Islands
        zipCode:
          type: string
          minLength: 1
          maxLength: 32
          pattern: ^(?!\s)(?!.*\s$).+(?<!\s)$
          example: 22100
      required:
        - address1
        - city
        - country
        - zipCode
    CardDeliveryType:
      type: string
      description: >-
        Select the type of delivery you prefer for the new card being created. -
        MAIL - The card would be sent via mail services. - COURIER - The card
        would be sent via courier services. - CUSTOM_1–CUSTOM_5 - Custom
        delivery types that can be used for shipping methods agreed between the
        customer and the bureau.
      enum:
        - MAIL
        - COURIER
        - CUSTOM_1
        - CUSTOM_2
        - CUSTOM_3
        - CUSTOM_4
        - CUSTOM_5
      example: MAIL
    PinDeliveryType:
      type: string
      description: >-
        Select the type of delivery you prefer for sending the card PIN. - MAIL
        - The card PIN would be sent via mail services. - COURIER - The card PIN
        would be sent via courier services. - EPIN - The card PIN would be sent
        digitally.
      enum:
        - MAIL
        - COURIER
        - EPIN
      example: MAIL
    ExternalLayoutCode:
      type: string
      description: >-
        Unique code forwarded to the embossing house; the code identifies the
        plastic layout to be used for printing the new card. Ensure beforehand,
        the selected embossing house is aligned with the code used for each
        layout.
      minLength: 1
      maxLength: 32
      pattern: ^[a-zA-Z0-9-_]+$
      example: 1
    CardVersionStatus:
      type: string
      description: >
        - ACTIVE - The card is completely operational. You can perform all
        actions with the card.

        - INITIAL - The specific card version is awaiting activation. During
        this state, the card can have limited usage, such as being added to a
        digital wallet or cardholder can view the PIN (if it is a plastic card).
        However, in the INITIAL state, the card cannot be used for payments.

        - CLOSED - The previous versions of the card are no longer valid as a
        new version is activated or the card is closed.
      enum:
        - ACTIVE
        - INITIAL
        - CLOSED
      example: ACTIVE
    ExpirationTime:
      type: string
      format: date-time
      description: >
        The expiration date-time of the card, always at 23:59:59 UTC on the last
        day of a month.


        If a different expiry than the program default is specified during card
        creation, it is

        converted to UTC (if a different offset is given) and rounded up to
        23:59:59 of the last day of

        its own month.


        To be sure of the exact expiration month, always specify this value with
        a Z (UTC) offset. For

        example, to expire the card in August 2030, set "2030-08-31T23:59:59Z".
      example: '2030-08-31T23:59:59Z'
    RenewalDate:
      type: string
      format: date
      description: The date when the auto renewal occurs.
    SequenceNumber:
      type: integer
      minimum: 1
      description: >-
        The sequence number of the card version, this value is also known as PSN
        (pan sequence number)
      example: 1
    KeySetId:
      type: string
      format: uuid
      description: The id of the key set used by this card version
      example: 01b20ad2-3c2a-48d2-ac2e-5bf6d8b246cd
    ApplicationName:
      type: string
      description: >
        Name of the application. Max character limit is 16. Only applicable to
        multi-application cards.

        Otherwise, the request will return 400 Bad Request.
      minLength: 1
      maxLength: 16
      pattern: ^[a-zA-Z ]+$
      example: Credit Application
    ApplicationIndex:
      type: integer
      description: The index of the application
      example: 1
    ContactPriorityLevel:
      type: integer
      description: >
        The contact priority level for given card. Only applicable to
        multi-application cards.

        Otherwise, the request will return 400 Bad Request.
      format: int32
      minimum: 0
    ContactlessPriorityLevel:
      type: integer
      description: >
        The contactless priority level of the given card. Only applicable to
        multi-application cards.

        Otherwise, the request will return 400 Bad Request.
      format: int32
      minimum: 0
    Printed:
      type: boolean
      description: >
        Indicates whether the specific card would be printed or not. Only
        applicable to multi-application cards.

        Otherwise, the request will return 400 Bad Request.
      example: true
    ChipEnabled:
      type: boolean
      description: >
        Whether the card should be visible in card terminal or not. Only
        applicable to multi-application cards.

        Otherwise, the request will return 400 Bad Request.
      example: true

````