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

# Terminate Card

> Permanently terminate a virtual card. Remaining balance is returned to your wallet. DELETE /cards/{cardId}.

## Overview

Permanently terminate a card. Any remaining balance will be automatically returned to your business wallet. This action cannot be undone.

<Warning>
  Card termination is permanent. The card cannot be reactivated after termination.
</Warning>

## Path Parameters

| Parameter | Type   | Description                |
| --------- | ------ | -------------------------- |
| `cardId`  | string | The unique card identifier |

## Request Body (Optional)

| Field       | Type   | Required | Description                                                                                                                 |
| ----------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| `reference` | string | No       | Your unique reference for this operation. Defaults to cardId if not provided. Returned in webhooks for easy reconciliation. |

## Example Usage

<CodeGroup>
  ```php PHP theme={null}
  <?php
  $cardId = 'crd_8f3a2b1c4d5e6f7890abcdef12345678';
  $data = [
      'reference' => 'cancel-card-abc123'  // Optional: your unique reference
  ];

  $ch = curl_init('https://api.fyatu.com/api/v3/cards/' . $cardId);
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'DELETE',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . $accessToken,
          'Content-Type: application/json'
      ],
      CURLOPT_POSTFIELDS => json_encode($data)
  ]);

  $response = curl_exec($ch);
  $result = json_decode($response, true);

  if ($result['success']) {
      echo "Card terminated at: " . $result['data']['terminatedAt'] . "\n";
      echo "Reference: " . $result['data']['reference'] . "\n";
  }
  ```

  ```javascript Node.js theme={null}
  const cardId = 'crd_8f3a2b1c4d5e6f7890abcdef12345678';

  const response = await fetch(`https://api.fyatu.com/api/v3/cards/${cardId}`, {
    method: 'DELETE',
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      reference: 'cancel-card-abc123'  // Optional: your unique reference
    })
  });

  const result = await response.json();
  if (result.success) {
    console.log('Card terminated at:', result.data.terminatedAt);
    console.log('Reference:', result.data.reference);
  }
  ```
</CodeGroup>

## Error Responses

| Error Code           | Description                |
| -------------------- | -------------------------- |
| `ALREADY_TERMINATED` | Card is already terminated |

<Tip>
  If you want to temporarily disable a card without losing the balance, use the [Freeze Card](/v3/api-reference/cards/freeze) endpoint instead.
</Tip>


## OpenAPI

````yaml v3/openapi.json DELETE /cards/{cardId}
openapi: 3.1.0
info:
  title: FYATU API v3
  description: >-
    FYATU API v3 with JWT authentication for Collections, Payouts, and Card
    Issuing.
  version: 3.0.0
  contact:
    name: FYATU Support
    url: https://fyatu.com
    email: support@fyatu.com
servers:
  - url: https://api.fyatu.com/api/v3
    description: Production
security: []
tags:
  - name: Authentication
    description: JWT token management endpoints
  - name: Account
    description: Business account, wallet, and address management
  - name: Collections
    description: Accept payments from customers via checkout sessions
  - name: Refunds
    description: Issue refunds for completed collections
  - name: Payouts
    description: Send money to Fyatu account holders
  - name: Cardholders
    description: Cardholder management for card issuing programs
  - name: Cards
    description: Issue, fund, freeze, and manage virtual cards
  - name: Webhooks
    description: Webhook configuration and management
paths:
  /cards/{cardId}:
    delete:
      tags:
        - Cards
      summary: Terminate Card
      description: >-
        Permanently terminate a card. Any remaining balance will be returned to
        your business wallet.
      operationId: deleteCard
      parameters:
        - name: cardId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerminateCardRequest'
            example:
              reason: Card reported lost by customer
              reference: cancel-card-abc123
      responses:
        '200':
          description: Card terminated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardTerminateResponse'
              example:
                success: true
                status: 200
                message: Card terminated successfully
                data:
                  id: crd_8f3a2b1c4d5e6f7890abcdef12345678
                  status: TERMINATED
                  reason: Card reported lost by customer
                  refundedBalance: 45.5
                  terminatedAt: '2026-01-17T10:00:00+00:00'
                  reference: cancel-card-abc123
                meta:
                  requestId: req_a1b2c3d4e5f6
                  timestamp: '2026-01-17T10:00:00+00:00'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - BearerAuth: []
components:
  schemas:
    TerminateCardRequest:
      type: object
      properties:
        reason:
          type: string
          maxLength: 255
          description: >-
            Reason for terminating the card (e.g., 'Card lost', 'Card stolen',
            'Account closed'). Defaults to 'Terminated by the user' if not
            provided.
        reference:
          type: string
          maxLength: 100
          description: >-
            Your unique reference for this operation. Defaults to cardId if not
            provided.
    CardTerminateResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        status:
          type: integer
          example: 200
        message:
          type: string
        data:
          type: object
          properties:
            id:
              type: string
            status:
              type: string
              example: TERMINATED
            reason:
              type: string
              description: Reason for termination
            refundedBalance:
              type: number
              description: Remaining card balance refunded to business wallet
            terminatedAt:
              type: string
              format: date-time
            reference:
              type: string
              description: Your external reference
        meta:
          $ref: '#/components/schemas/Meta'
    Meta:
      type: object
      properties:
        requestId:
          type: string
          description: Unique request ID for tracking
          example: req_abc123def456
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp of the response
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        status:
          type: integer
          example: 401
        message:
          type: string
          example: Invalid credentials
        error:
          $ref: '#/components/schemas/Error'
        meta:
          $ref: '#/components/schemas/Meta'
    Error:
      type: object
      properties:
        code:
          type: string
          description: Error code for programmatic handling
          example: AUTH_INVALID_CREDENTIALS
        details:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
          description: Validation error details (for VALIDATION_ERROR)
    ValidationError:
      type: object
      properties:
        field:
          type: string
          description: Field that failed validation
          example: appId
        message:
          type: string
          description: Validation error message
          example: AppId is required
  responses:
    Unauthorized:
      description: Authentication required or token invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            status: 401
            message: Unable to identify business
            error:
              code: AUTH_TOKEN_INVALID
            meta:
              requestId: req_abc123
              timestamp: '2026-01-05T10:30:00+00:00'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            status: 404
            message: Wallet not found
            error:
              code: RESOURCE_NOT_FOUND
            meta:
              requestId: req_abc123
              timestamp: '2026-01-05T10:30:00+00:00'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT access token obtained from /auth/token

````