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

# 決済方法をブロック

> 保存済みの決済方法をブロックして将来の使用を禁止します



## OpenAPI

````yaml /api-reference/openapi.ja.json post /v1/customers/payment-methods/{id}/block
openapi: 3.1.0
info:
  title: ZAFA PAY API
  description: 複数のPSPを統合した決済APIプラットフォーム
  version: 1.0.0
servers:
  - url: https://api.sandbox.zafapay.com
    description: Sandbox環境
  - url: https://api.zafapay.com
    description: 本番環境
security:
  - bearerAuth: []
paths:
  /v1/customers/payment-methods/{id}/block:
    post:
      tags:
        - Customers
      summary: 決済方法をブロック
      description: 保存済みの決済方法をブロックして将来の使用を禁止します
      operationId: blockPaymentMethod
      parameters:
        - name: id
          in: path
          required: true
          description: 決済方法ID
          schema:
            type: string
            example: pmi_abc123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlockPaymentMethodRequest'
      responses:
        '200':
          description: ブロック成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockPaymentMethodResponse'
        '400':
          description: 既にブロック済みまたは無効な状態
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 決済方法が見つからない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    BlockPaymentMethodRequest:
      type: object
      required:
        - reason
      properties:
        reason:
          type: string
          description: ブロック理由
          example: 不正利用の疑い
    BlockPaymentMethodResponse:
      type: object
      properties:
        id:
          type: string
          description: 決済方法ID
          example: pmi_abc123
        status:
          type: string
          description: 新しいステータス
          example: blocked
        blocked_reason:
          type: string
          description: ブロック理由
          example: 不正利用の疑い
        updated_at:
          type: string
          format: date-time
          description: 更新日時
          example: '2024-01-15T10:35:00Z'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: エラーの種類
              enum:
                - authentication_error
                - authorization_error
                - invalid_request_error
                - payment_error
                - rate_limit_error
                - api_error
              example: invalid_request_error
            code:
              type: string
              description: エラーコード
              example: validation_error
            message:
              type: string
              description: エラーメッセージ
              example: Invalid request parameters
            param:
              type: string
              description: エラーの原因となったパラメータ名
              example: amount
            details:
              type: array
              description: バリデーションエラーの詳細
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type: string
                  message:
                    type: string
            request_id:
              type: string
              description: リクエストID
              example: req_abc123xyz789
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: アクセストークンを使用したBearer認証

````