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

# Delete Product

> Delete a card product. Permanently removes it if no active cards exist, or archives it automatically if cards are still in use. DELETE /products/{id}. Requires accounts:write scope.

## Overview

Smart delete: a single `DELETE` call handles both cases automatically.

| Condition                       | What happens                                                     | `data.action` |
| ------------------------------- | ---------------------------------------------------------------- | ------------- |
| Product has **no active cards** | Permanently deleted — cannot be recovered                        | `"deleted"`   |
| Product has **active cards**    | Archived — no new cards can be issued, existing cards unaffected | `"archived"`  |

Check `data.action` in the response to know what was done. Archived products can be restored with [`POST /products/{id}/activate`](/v3.20/api-reference/products/activate).

## Path Parameters

| Parameter | Type   | Description                    |
| --------- | ------ | ------------------------------ |
| `id`      | string | The product ID (prefix `prd_`) |

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://api.fyatu.com/api/v3.20/products/prd_01HXYZ1111ABCDEF0002 \
    -H "Authorization: Bearer $FYATU_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const resp = await fetch(
    'https://api.fyatu.com/api/v3.20/products/prd_01HXYZ1111ABCDEF0002',
    {
      method: 'DELETE',
      headers: { 'Authorization': `Bearer ${process.env.FYATU_API_KEY}` }
    }
  );
  const body = await resp.json();
  if (body.data.action === 'deleted') {
    console.log('Product permanently deleted');
  } else {
    console.log('Product archived — had active cards');
  }
  ```

  ```python Python theme={null}
  import os, requests

  resp = requests.delete(
      'https://api.fyatu.com/api/v3.20/products/prd_01HXYZ1111ABCDEF0002',
      headers={'Authorization': f'Bearer {os.environ["FYATU_API_KEY"]}'}
  )
  body = resp.json()
  print(body['data']['action'])  # "deleted" or "archived"
  ```
</CodeGroup>

## Success Response (200) — Permanently Deleted

```json theme={null}
{
  "success": true,
  "status":  200,
  "message": "Product deleted",
  "data":    { "action": "deleted" },
  "meta": {
    "requestId": "req_01HXY123456ABCDEF",
    "platform":  "Fyatu CaaS",
    "timestamp": "2026-05-26T11:30:00Z"
  }
}
```

## Success Response (200) — Archived (Has Active Cards)

```json theme={null}
{
  "success": true,
  "status":  200,
  "message": "Product archived — has active cards",
  "data":    { "action": "archived" },
  "meta": {
    "requestId": "req_01HXY123456ABCDEF",
    "platform":  "Fyatu CaaS",
    "timestamp": "2026-05-26T11:30:00Z"
  }
}
```

## Error Codes

| Code                 | HTTP | Cause                                                 |
| -------------------- | ---- | ----------------------------------------------------- |
| `PRODUCT_NOT_FOUND`  | 404  | Product does not exist or belongs to another business |
| `INSUFFICIENT_SCOPE` | 403  | Key lacks `accounts:write` scope                      |
| `INTERNAL_ERROR`     | 500  | Server error                                          |


## OpenAPI

````yaml v3.20/openapi.json DELETE /products/{id}
openapi: 3.1.0
info:
  title: FYATU CaaS API v3.20
  description: >-
    FYATU Cards-as-a-Service API â€” API key authentication, Cardholder
    lifecycle, Card issuance, Transactions, Webhooks, and Programs.
  version: 3.20.0
  contact:
    name: FYATU Support
    url: https://fyatu.com
    email: support@fyatu.com
servers:
  - url: https://api.fyatu.com/api/v3.20
    description: >-
      FYATU CaaS API â€” the environment (LIVE or SANDBOX) is determined by the
      API key, not the URL
security:
  - BearerAuth: []
tags:
  - name: Meta
    description: Liveness, account info, and supported event types
  - name: Account
    description: Account-level balance and funding status
  - name: Programs
    description: Read card program configuration
  - name: Cardholders
    description: Create and manage cardholder profiles
  - name: Cards
    description: Issue, fund, freeze, and terminate virtual cards
  - name: Transactions
    description: Read-only card transaction history
  - name: Webhooks
    description: Manage webhook endpoints for real-time event delivery
  - name: Products
    description: Read card product configurations
paths:
  /products/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Product ID (prefix `prd_`)
        example: prd_01HXYZ1111ABCDEF0001
    delete:
      tags:
        - Products
      summary: Delete a product
      description: >-
        Smart delete: permanently removes the product if it has no active cards,
        or archives it if active cards exist. Check `data.action` in the
        response to determine what happened. Archived products can be restored
        with `POST /products/{id}/activate`.
      operationId: deleteProduct
      responses:
        '200':
          description: Product deleted or archived
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  status:
                    type: integer
                    example: 200
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      action:
                        type: string
                        enum:
                          - deleted
                          - archived
                        description: >-
                          "deleted" = permanently removed; "archived" = product
                          had active cards and was archived instead
                  meta:
                    $ref: '#/components/schemas/Meta'
              examples:
                deleted:
                  summary: Permanently deleted (no active cards)
                  value:
                    success: true
                    status: 200
                    message: Product deleted
                    data:
                      action: deleted
                    meta:
                      requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
                      platform: Fyatu CaaS
                      timestamp: '2026-05-26T11:30:00Z'
                archived:
                  summary: Archived (has active cards)
                  value:
                    success: true
                    status: 200
                    message: Product archived — has active cards
                    data:
                      action: archived
                    meta:
                      requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
                      platform: Fyatu CaaS
                      timestamp: '2026-05-26T11:30:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Product not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                status: 404
                message: Product not found
                error:
                  code: PRODUCT_NOT_FOUND
                  detail: Product not found
                meta:
                  requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
                  platform: Fyatu CaaS
                  timestamp: '2026-05-26T11:30:00Z'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Meta:
      type: object
      properties:
        requestId:
          type: string
          example: req_a1b2c3d4e5f6a7b8c9d0e1f2
        platform:
          type: string
          example: Fyatu CaaS
        timestamp:
          type: string
          format: date-time
          example: '2026-05-22T15:00:00Z'
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        status:
          type: integer
          example: 422
        message:
          type: string
          example: Human readable message
        error:
          $ref: '#/components/schemas/ErrorBody'
        meta:
          $ref: '#/components/schemas/Meta'
    ErrorBody:
      type: object
      properties:
        code:
          type: string
          example: VALIDATION_ERROR
        detail:
          type: string
          example: dateOfBirth must be in YYYY-MM-DD format
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: API key missing
              value:
                success: false
                status: 401
                message: API key is required
                error:
                  code: AUTH_TOKEN_MISSING
                  detail: API key is required
                meta:
                  requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
                  platform: Fyatu CaaS
                  timestamp: '2026-05-22T15:00:00Z'
            invalid:
              summary: API key invalid
              value:
                success: false
                status: 401
                message: Invalid API key
                error:
                  code: AUTH_TOKEN_INVALID
                  detail: Invalid API key
                meta:
                  requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
                  platform: Fyatu CaaS
                  timestamp: '2026-05-22T15:00:00Z'
    Forbidden:
      description: Scope denied or business suspended
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            status: 403
            message: Scope denied
            error:
              code: INSUFFICIENT_SCOPE
              detail: This endpoint requires the cards:write scope
            meta:
              requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
              platform: Fyatu CaaS
              timestamp: '2026-05-22T15:00:00Z'
    RateLimitExceeded:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            status: 429
            message: Rate limit exceeded
            error:
              code: RATE_LIMIT_EXCEEDED
              detail: Too many requests
            meta:
              requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
              platform: Fyatu CaaS
              timestamp: '2026-05-22T15:00:00Z'
    InternalError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            status: 500
            message: Internal error
            error:
              code: INTERNAL_ERROR
              detail: An unexpected error occurred
            meta:
              requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
              platform: Fyatu CaaS
              timestamp: '2026-05-22T15:00:00Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from the FYATU CaaS portal. Pass as `Authorization: Bearer
        <key>`.

````