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

# Detach a payment method

> Sets it inactive and revokes its stored credential.



## OpenAPI

````yaml /payments-api/openapi.json post /v1/payment-methods/{id}/detach
openapi: 3.1.0
info:
  title: TagadaPay Payments API
  version: '2026-11-01'
servers:
  - url: https://api.tagada.io
security: []
paths:
  /v1/payment-methods/{id}/detach:
    post:
      tags:
        - payment_methods
      summary: Detach a payment method
      description: Sets it inactive and revokes its stored credential.
      operationId: paymentMethods.detach
      parameters:
        - in: path
          name: id
          required: true
          schema:
            pattern: ^inst_[a-f0-9]{12}$
            type: string
        - in: header
          name: payments-account
          required: false
          schema:
            type: string
        - in: header
          name: payments-version
          required: false
          schema:
            enum:
              - '2026-11-01'
            type: string
        - in: header
          name: idempotency-key
          required: true
          schema:
            maxLength: 255
            minLength: 1
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethod'
          description: Payment method; never the card number.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodApiError'
          description: >-
            parameter_invalid, parameter_missing, amount_out_of_range,
            vault_token_invalid
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodApiError'
          description: authentication_required
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodApiError'
          description: permission_denied
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodApiError'
          description: resource_not_found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodApiError'
          description: idempotency_key_reused, idempotency_key_in_progress
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodApiError'
          description: rate_limited
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodApiError'
          description: internal_error
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodApiError'
          description: not_implemented
      security:
        - bearerAuth: []
components:
  schemas:
    PaymentMethod:
      additionalProperties: false
      properties:
        card:
          additionalProperties: false
          properties:
            brand:
              type:
                - string
                - 'null'
            country:
              type:
                - string
                - 'null'
            exp_month:
              type:
                - integer
                - 'null'
            exp_year:
              type:
                - integer
                - 'null'
            funding:
              type:
                - string
                - 'null'
            last4:
              type:
                - string
                - 'null'
          required:
            - brand
            - funding
            - country
            - last4
            - exp_month
            - exp_year
          type:
            - object
            - 'null'
        created_at:
          format: date-time
          type: string
        customer:
          pattern: ^cus_[a-f0-9]{12}$
          type:
            - string
            - 'null'
        id:
          pattern: ^inst_[a-f0-9]{12}$
          type: string
        is_default:
          type: boolean
        object:
          enum:
            - payment_method
          type: string
        status:
          enum:
            - active
            - inactive
          type: string
          x-extensible-enum:
            - active
            - inactive
        stored_credential:
          additionalProperties: false
          properties:
            processor:
              type:
                - string
                - 'null'
            source:
              enum:
                - ours
                - imported
              type: string
              x-extensible-enum:
                - ours
                - imported
            status:
              enum:
                - active
                - revoked
              type: string
              x-extensible-enum:
                - active
                - revoked
            usage:
              enum:
                - on_session
                - off_session
              type: string
              x-extensible-enum:
                - on_session
                - off_session
          required:
            - usage
            - source
            - processor
            - status
          type:
            - object
            - 'null'
        type:
          enum:
            - card
            - apple_pay
            - google_pay
          type: string
          x-extensible-enum:
            - card
            - apple_pay
            - google_pay
        wallet:
          additionalProperties: false
          properties:
            apple_pay_token_type:
              description: >-
                mpan: a merchant token, which outlives the device; dpan: a
                device token.
              enum:
                - mpan
                - dpan
              type:
                - string
                - 'null'
              x-extensible-enum:
                - mpan
                - dpan
            google_pay_auth_method:
              enum:
                - PAN_ONLY
                - CRYPTOGRAM_3DS
              type:
                - string
                - 'null'
              x-extensible-enum:
                - PAN_ONLY
                - CRYPTOGRAM_3DS
            type:
              enum:
                - apple_pay
                - google_pay
              type: string
              x-extensible-enum:
                - apple_pay
                - google_pay
          required:
            - type
            - google_pay_auth_method
            - apple_pay_token_type
          type:
            - object
            - 'null'
      required:
        - id
        - object
        - type
        - customer
        - status
        - is_default
        - card
        - wallet
        - stored_credential
        - created_at
      type: object
    PaymentMethodApiError:
      properties:
        error:
          properties:
            code:
              $ref: '#/components/schemas/PaymentMethodErrorCode'
            details:
              additionalProperties: {}
              type: object
            message:
              type: string
            param:
              type:
                - string
                - 'null'
            request_id:
              type: string
            type:
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - conflict_error
                - rate_limit_error
                - api_error
                - unavailable_error
              type: string
          required:
            - type
            - code
            - message
            - param
            - request_id
          type: object
      required:
        - error
      type: object
    PaymentMethodErrorCode:
      enum:
        - amount_out_of_range
        - authentication_required
        - idempotency_key_in_progress
        - idempotency_key_reused
        - internal_error
        - not_implemented
        - parameter_invalid
        - parameter_missing
        - permission_denied
        - rate_limited
        - resource_not_found
        - vault_token_invalid
      type: string
      x-extensible-enum:
        - amount_out_of_range
        - authentication_required
        - idempotency_key_in_progress
        - idempotency_key_reused
        - internal_error
        - not_implemented
        - parameter_invalid
        - parameter_missing
        - permission_denied
        - rate_limited
        - resource_not_found
        - vault_token_invalid
  securitySchemes:
    bearerAuth:
      description: >-
        Secret, platform or publishable API key. Platform keys require
        Payments-Account.
      scheme: bearer
      type: http

````

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