> ## 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.

# Replace Card

> Send a request to this endpoint when you want to replace the current card. The old card is closed and a new card is issued, where the PAN and the expiry date are updated.



## OpenAPI

````yaml json-files/card.openapi.json post /v1/cards/{id}/replace
openapi: 3.0.3
info:
  description: >
    Endpoints for doing various actions connected to the Card entity.

    All date-time fields adhere to the ISO 8601 standard unless specified
    otherwise.

    For example: 2024-05-31T06:55:17Z
  version: '1'
  title: Card API
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
servers:
  - url: https://api.{{tenant}}.ext-uat1-sandbox.mycore.enfuce.com/issuer
    description: UAT Sandbox
  - url: https://api.{{tenant}}.eu.live.prod.mycore.enfuce.com/issuer
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Create Card
    description: Endpoints for creating a card
  - name: Get card
    description: Endpoints for fetching a card
  - name: Update card
    description: Endpoints for updating a card
paths:
  /v1/cards/{id}/replace:
    post:
      tags:
        - Update card
      summary: Replace Card
      description: >-
        Send a request to this endpoint when you want to replace the current
        card. The old card is closed and a new card is issued, where the PAN and
        the expiry date are updated.
      operationId: replaceCard
      parameters:
        - name: id
          in: path
          description: Unique identifier of the card to be replaced.
          required: true
          schema:
            type: string
            format: uuid
        - in: header
          name: x-idempotency-key
          required: false
          description: Idempotency key of the request.
          schema:
            type: string
        - $ref: '#/components/parameters/x-audit-user'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceCardBody'
      responses:
        '200':
          description: Successful replacement of card
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    x-audit-user:
      in: header
      name: x-audit-user
      required: false
      description: Optional audit user header
      schema:
        type: string
  schemas:
    ReplaceCardBody:
      type: object
      properties:
        description:
          type: string
          description: Description of why the card should be replaced.
          example: The cardholder’s wallet was stolen, so the card must be replaced.
        pinStatus:
          $ref: '#/components/schemas/ChangePinStatus'
    ResourceResponse:
      type: object
      properties:
        description:
          type: string
          description: A description of the response returned.
        id:
          allOf:
            - $ref: '#/components/schemas/Id'
          description: A unique identifier assigned to identify the endpoint request.
    ChangePinStatus:
      type: string
      description: |
        - GENERATED - A pin should be randomly generated for the card.
        - WAITING - A pin is waiting to be set on the card.
      enum:
        - GENERATED
        - WAITING
      example: GENERATED
    Id:
      type: string
      format: uuid
      description: Unique identifier of a resource.
      example: 20218aae-b15e-406c-9e9f-23735cd86a48
    ErrorResponse:
      type: object
      properties:
        type:
          description: The problem type.
          type: string
        title:
          description: The reason phrase of HttpStatus.
          type: string
        status:
          description: HTTP problem status.
          type: number
        detail:
          description: The problem detail.
          type: string
        instance:
          description: The request path.
          type: string
        id:
          description: Unique error identifier.
          type: string
          format: uuid
        timestamp:
          description: Date-time when error occurred.
          type: string
          format: date-time
  responses:
    BadRequest:
      description: Bad request
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: about:blank
            title: Bad Request
            status: 400
            detail: 'JSON parse error: Unexpected character...'
            instance: /v1/cards
            id: 5cc541cb-f456-4331-b537-d2380fca0400
            timestamp: '2026-02-24T12:34:56Z'
    Unauthorized:
      description: Unauthorized
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: about:blank
            title: Forbidden
            status: 403
            detail: Access Denied
            instance: /v1/cards
            id: 5cc541cb-f456-4331-b537-d2380fca0403
            timestamp: '2026-02-24T12:34:56Z'
    NotFound:
      description: Not found
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: about:blank
            title: Not Found
            status: 404
            detail: >-
              Entity not found - Program with id:
              2ec117b7-454e-4cc5-8b89-dea5485aab2b
            instance: /v1/cards
            id: 5cc541cb-f456-4331-b537-d2380fca0404
            timestamp: '2026-02-24T12:34:56Z'
    Conflict:
      description: Conflict
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: about:blank
            title: Conflict
            status: 409
            detail: Customer number is not unique.
            instance: /v1/cardholders
            id: 5cc541cb-f456-4331-b537-d2380fca0409
            timestamp: '2026-02-26T10:34:47.522+00:00'
    InternalServerError:
      description: Internal server error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: about:blank
            title: Internal Server Error
            status: 500
            detail: Unexpected error occurred.
            instance: /v1/cards
            id: 5cc541cb-f456-4331-b537-d2380fca0500
            timestamp: '2026-02-24T12:34:56Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````