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

# Block Payment Method

> Block a saved payment method to prevent future use



## OpenAPI

````yaml /api-reference/openapi.en.json post /v1/customers/payment-methods/{id}/block
openapi: 3.1.0
info:
  title: ZAFA PAY API
  description: Payment API platform integrating multiple PSPs
  version: 1.0.0
servers:
  - url: https://api.sandbox.zafapay.com
    description: Sandbox environment
  - url: https://api.zafapay.com
    description: Production environment
security:
  - bearerAuth: []
paths:
  /v1/customers/payment-methods/{id}/block:
    post:
      tags:
        - Customers
      summary: Block Payment Method
      description: Block a saved payment method to prevent future use
      operationId: blockPaymentMethod
      parameters:
        - name: id
          in: path
          required: true
          description: Payment method ID
          schema:
            type: string
            example: pmi_abc123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlockPaymentMethodRequest'
      responses:
        '200':
          description: Payment method blocked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockPaymentMethodResponse'
        '400':
          description: Already blocked or invalid state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Payment method not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    BlockPaymentMethodRequest:
      type: object
      required:
        - reason
      properties:
        reason:
          type: string
          description: Reason for blocking the payment method
          example: Suspected fraud
    BlockPaymentMethodResponse:
      type: object
      properties:
        id:
          type: string
          description: Payment method ID
          example: pmi_abc123
        status:
          type: string
          description: New status
          example: blocked
        blocked_reason:
          type: string
          description: Reason for blocking
          example: Suspected fraud
        updated_at:
          type: string
          format: date-time
          description: Update timestamp
          example: '2024-01-15T10:35:00Z'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: Error type
              enum:
                - authentication_error
                - authorization_error
                - invalid_request_error
                - payment_error
                - rate_limit_error
                - api_error
              example: invalid_request_error
            code:
              type: string
              description: Error code
              example: validation_error
            message:
              type: string
              description: Error message
              example: Invalid request parameters
            param:
              type: string
              description: Parameter that caused the error
              example: amount
            details:
              type: array
              description: Validation error details
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type: string
                  message:
                    type: string
            request_id:
              type: string
              description: Request ID
              example: req_abc123xyz789
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication using access token

````