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

# Block Card

> Block an NFC card from transactions

<Warning>
  Blocking a card prevents all transactions. Use for lost cards, suspected fraud, or at customer request.
</Warning>

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer olive_live_xxx` or `Bearer eyJ...` (JWT)
</ParamField>

### Path Parameters

<ParamField path="serial" type="string" required>
  Card serial number (e.g., `OLIV0001`)
</ParamField>

### Body Parameters

<ParamField body="reason" type="string" required>
  Reason for blocking (logged for audit)
</ParamField>

<ParamField body="pin" type="string">
  Subscriber's PIN (required for self-service blocking)
</ParamField>

***

## Response

<ResponseField name="success" type="boolean">
  Whether block succeeded
</ResponseField>

<ResponseField name="message" type="string">
  Result message
</ResponseField>

***

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://demo.api.vultlocal.com/api/v1/cards/OLIV0001/block" \
    -H "Authorization: Bearer olive_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "reason": "Lost card - customer reported",
      "pin": "1234"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true,
    "message": "Card blocked successfully",
    "card": {
      "serial": "OLIV0001",
      "status": "BLOCKED",
      "blocked_at": "2025-01-20T14:45:00Z",
      "blocked_by": "admin@olive.sl",
      "block_reason": "Lost card - customer reported"
    }
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Card not found",
    "code": "CARD_NOT_FOUND"
  }
  ```
</ResponseExample>

***

## Block Reasons

| Reason  | Description          | Reversible                |
| ------- | -------------------- | ------------------------- |
| Lost    | Customer lost card   | No (issue new card)       |
| Stolen  | Card reported stolen | No                        |
| Fraud   | Suspected fraud      | Yes (after investigation) |
| Request | Customer requested   | Yes                       |
| Damaged | Physical damage      | No (issue new card)       |

***

## Effects

<CardGroup cols={2}>
  <Card title="Transactions Blocked" icon="x">
    * POS payments rejected
    * NFC tap disabled
    * PIN verification fails
  </Card>

  <Card title="Child Cards" icon="id-card">
    * If parent blocked, child cards still work
    * Block child cards separately if needed
  </Card>
</CardGroup>

***

## Errors

| Status | Code              | Description             |
| ------ | ----------------- | ----------------------- |
| 400    | `MISSING_REASON`  | Reason is required      |
| 400    | `INVALID_PIN`     | PIN verification failed |
| 401    | `UNAUTHORIZED`    | Invalid API key         |
| 404    | `CARD_NOT_FOUND`  | Card serial not found   |
| 409    | `ALREADY_BLOCKED` | Card already blocked    |
| 500    | `INTERNAL_ERROR`  | Server error            |

***

## Related

<Card title="Unblock Card" icon="check-circle" href="/api-reference/cards/unblock">
  Restore a blocked card
</Card>


## OpenAPI

````yaml olive-openapi.json POST /cards/{serial}/block
openapi: 3.0.0
info:
  description: >-
    API Gateway for OLIVE NFC Card Payment System - Comprehensive payment, card
    management, agent operations, and admin authentication. All /api/v1 routes
    require authentication using either API Key or JWT token.
  title: OLIVE NFC Card Payment API
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    email: support@olive.sl
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://olive-gateway-a6ba.onrender.com/api/v1
security: []
paths:
  /cards/{serial}/block:
    post:
      tags:
        - Cards
      summary: Block a card
      description: Block an NFC card with a reason
      parameters:
        - description: Card Serial Number
          name: serial
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handler.BlockCardRequest'
        description: Block reason
        required: true
      responses:
        '200':
          description: Card blocked
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    handler.BlockCardRequest:
      type: object
      required:
        - reason
      properties:
        pin:
          type: string
          example: '1234'
        reason:
          type: string
          example: Lost card
  securitySchemes:
    ApiKeyAuth:
      description: >-
        API Key for third-party integrations (WhatsApp, Smart PAY, VULT).
        Format: 'Bearer olive_live_xxxxxxxxxxxxx'
      type: apiKey
      name: Authorization
      in: header
    BearerAuth:
      description: >-
        JWT token from admin login for administrative operations. Format:
        'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
      type: apiKey
      name: Authorization
      in: header

````