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

# Replace a customer card

> Replace a customer card. This operation is scoped to the customer portal and returns only customer-accessible data.



## OpenAPI

````yaml /openapi/tenant-customer-v1.openapi.yaml post /cards/{cardId}/replace
openapi: 3.1.0
info:
  title: Anbyan Customer Portal API
  version: 1.0.0
  description: >
    Customer portal API for password and passkey authentication, accounts,
    cards, statements, transactions, and other customer-owned resources.
servers:
  - url: https://{tenantDomain}/api/v1/customer
    description: Customer portal API on a tenant domain
    variables:
      tenantDomain:
        default: tenant.example.com
security:
  - bearerAuth: []
tags:
  - name: Customer Settings
  - name: Customer Auth
  - name: Customer Accounts
  - name: Customer Cards
  - name: Customer Statements
  - name: Customer Transactions
paths:
  /cards/{cardId}/replace:
    post:
      tags:
        - Customer Cards
      summary: Replace a customer card
      description: >-
        Replace a customer card. This operation is scoped to the customer portal
        and returns only customer-accessible data.
      operationId: replaceCustomerCard
      parameters:
        - $ref: '#/components/parameters/CardId'
      requestBody:
        $ref: '#/components/requestBodies/CardStatusRequest'
      responses:
        '200':
          description: Card replacement requested.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerCardResponse'
components:
  parameters:
    CardId:
      name: cardId
      in: path
      required: true
      schema:
        type: string
  requestBodies:
    CardStatusRequest:
      required: false
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CardStatusRequest'
  schemas:
    CustomerCardResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CustomerCard'
    CardStatusRequest:
      type: object
      properties:
        reason:
          type: string
        reasonCode:
          type: string
        preservePan:
          type: boolean
    CustomerCard:
      type: object
      properties:
        id:
          type: string
        accountId:
          type: string
        accountParticipantId:
          type:
            - string
            - 'null'
        cardProgramId:
          type:
            - string
            - 'null'
        cardType:
          type: string
        productType:
          type:
            - string
            - 'null'
        formFactor:
          type:
            - string
            - 'null'
        network:
          type:
            - string
            - 'null'
        last4:
          type: string
        expiryMonth:
          type:
            - integer
            - 'null'
        expiryYear:
          type:
            - integer
            - 'null'
        cardholderName:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - active
            - inactive
            - locked
            - blocked
            - cancelled
            - expired
        issuedAt:
          type:
            - string
            - 'null'
          format: date-time
        activatedAt:
          type:
            - string
            - 'null'
          format: date-time
        lockedAt:
          type:
            - string
            - 'null'
          format: date-time
        blockedAt:
          type:
            - string
            - 'null'
          format: date-time
        cancelledAt:
          type:
            - string
            - 'null'
          format: date-time
        account:
          $ref: '#/components/schemas/CustomerCardAccount'
        accountParticipant:
          $ref: '#/components/schemas/AccountParticipant'
        cardProgram:
          $ref: '#/components/schemas/CustomerCardProgram'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CustomerCardAccount:
      type: object
      properties:
        id:
          type: string
        clientId:
          type: string
        currency:
          type: string
        accountNumberLast4:
          type: string
        status:
          type: string
    AccountParticipant:
      type: object
      properties:
        id:
          type: string
        clientId:
          type: string
        clientType:
          type:
            - string
            - 'null'
        role:
          type: string
        canTransact:
          type: boolean
        canReceiveCard:
          type: boolean
        canViewCardDetails:
          type: boolean
        status:
          type: string
    CustomerCardProgram:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        name:
          type: string
        networkScheme:
          type: string
        cardType:
          type: string
        productType:
          type:
            - string
            - 'null'
        formFactor:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.