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

# 删除支付方式

> Deletes one of the token's customer's payment methods. Requires `portal:write`.

删除成功返回 `200` 和 `deleted: true`。删除立即生效，响应不返回用户操作页面链接。支付方式不存在，或属于其他用户时，都返回相同的 `404`，因此响应不会泄露其他用户的卡是否存在。默认卡可以删除。删除成功后重复发起该请求会返回 `404`。


## OpenAPI

````yaml DELETE /agent/platform/payment-methods/{paymentInstrumentId}
openapi: 3.1.0
info:
  title: Clink Agent Portal API
  description: >-
    Agent Portal APIs let an Agent platform read and manage one user's Clink
    account with a portal user token: payment methods, orders, refunds, purchase
    instructions, payment credentials, payment results, and settings.
  version: 1.0.0
servers:
  - url: https://uat-api.clinkbill.com
    description: Sandbox
security:
  - PortalToken: []
paths:
  /agent/platform/payment-methods/{paymentInstrumentId}:
    delete:
      summary: Delete payment method
      description: >-
        Deletes one of the token's customer's payment methods. Requires
        `portal:write`.
      operationId: deletePaymentMethod
      parameters:
        - name: paymentInstrumentId
          in: path
          required: true
          description: ID of the payment method to delete.
          schema:
            type: string
            example: pi_...
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    format: int32
                    description: '`200` on success.'
                    example: 200
                  msg:
                    type: string
                    description: Result message.
                    example: Success
                  data:
                    $ref: '#/components/schemas/DeleteResult'
              example:
                code: 200
                msg: Success
                data:
                  deleted: true
        '401':
          description: Missing, expired, or invalid portal token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Wrong token audience, missing `portal:write` scope, or a platform
            client token used instead of a portal token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            The payment method does not exist or belongs to another customer, or
            it was already deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DeleteResult:
      type: object
      properties:
        deleted:
          type: boolean
          description: '`true` when the payment method was deleted.'
          example: true
    ErrorResponse:
      type: object
      description: Business errors use the standard envelope without `data`.
      properties:
        code:
          type: integer
          description: >-
            Numeric business error code. Judge an error by the HTTP status
            together with `code`, not by a string error code.
        msg:
          type: string
          description: Human-readable description.
  securitySchemes:
    PortalToken:
      type: http
      scheme: bearer
      description: >-
        Portal user token from `POST /agent/cwallet/platform/portal/tokens`.
        Reads require `portal:read`; writes require `portal:write`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.