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

# Revoke a payment method

> Permanently deactivates a reusable payment method. A `reason` is
required for audit. The method must be active; once revoked it cannot
be used for new charges. Single-use methods cannot be revoked — they
are consumed or expire naturally. Send an `Idempotency-Key` header to
make concurrent retries safe.




## OpenAPI

````yaml /openapi/payment_methods.yaml post /payment_methods/{id}/revoke
openapi: 3.0.3
info:
  title: Ionic Payment Methods API
  version: '2026-05-01'
  description: >
    Payment instruments recorded by Ionic.


    A payment method (`pm_…`) represents a reusable or single-use card. Create

    one with the one-time payment token returned by the browser card fields.

    Responses include the card's last four digits, brand, expiration month and

    year, and fingerprint.


    A `reusable` payment method survives individual charges and can be attached

    to a customer, enabling off-session and subscription billing. A

    `single_use` method is consumed by its first charge.


    Terminal transactions can return a `type: card_present` payment method. It

    records one physical card presentation and cannot be created through this

    API, attached to a customer, reused, or used for off-session billing. Its

    `card_present` details include BIN/IIN, last4, brand, funding type, and
    entry

    method when available.


    Timestamps are Unix epoch seconds. Identifiers are opaque, prefixed strings

    (`pm_…`).


    Authentication uses a merchant secret key (`sk_…`) as a bearer token. Read

    endpoints require the `payment_methods:read` permission; write endpoints

    require `payment_methods:write`. The mode of the key (test or live) scopes

    which payment methods it can see and mutate, reflected by each resource's

    `livemode` field. Write endpoints accept an optional `Idempotency-Key`

    header.


    Errors are returned as `{ "error": { "code": "...", "message": "..." } }`.
servers:
  - url: '{baseUrl}/v1'
    variables:
      baseUrl:
        default: https://api.ionicfi.com
        description: API base URL for your environment.
security:
  - secretKey: []
tags:
  - name: Payment Methods
    description: Create, retrieve, attach, and revoke vaulted payment instruments.
paths:
  /payment_methods/{id}/revoke:
    parameters:
      - $ref: '#/components/parameters/PaymentMethodId'
    post:
      tags:
        - Payment Methods
      summary: Revoke a payment method
      description: |
        Permanently deactivates a reusable payment method. A `reason` is
        required for audit. The method must be active; once revoked it cannot
        be used for new charges. Single-use methods cannot be revoked — they
        are consumed or expire naturally. Send an `Idempotency-Key` header to
        make concurrent retries safe.
      operationId: payment_methods_revoke
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RevokePaymentMethodRequest'
      responses:
        '200':
          description: The revoked payment method.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethod'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/PaymentMethodNotFound'
        '422':
          $ref: '#/components/responses/InvalidPaymentMethodState'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - secretKey:
            - payment_methods:write
components:
  parameters:
    PaymentMethodId:
      name: id
      in: path
      required: true
      description: The payment method id (`pm_…`).
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        A unique key that makes retries safe: the same key with the same request
        body returns the original response instead of repeating the operation.
      schema:
        type: string
        maxLength: 255
  schemas:
    RevokePaymentMethodRequest:
      type: object
      required:
        - reason
      properties:
        reason:
          type: string
          description: The reason for revocation, recorded for audit.
    PaymentMethod:
      type: object
      required:
        - card
        - card_present
        - created_at
        - customer
        - fingerprint
        - id
        - livemode
        - metadata
        - object
        - reusable
        - status
        - type
      properties:
        id:
          type: string
          description: The payment method id (`pm_…`).
        object:
          type: string
          enum:
            - payment_method
          description: Always `payment_method`.
        type:
          type: string
          enum:
            - card
            - card_present
          description: >-
            `card` is an online/vaulted card. `card_present` is Ionic's
            read-only record of one physical Terminal presentation.
        livemode:
          type: boolean
          description: >-
            Whether this method belongs to the live (`true`) or test (`false`)
            environment.
        reusable:
          type: boolean
          description: >-
            `true` when the method can be charged multiple times; `false` for a
            single-use method that is consumed by its first charge. Only
            reusable methods can become `expired` or `revoked`; single-use
            methods cannot be revoked and never expire.
        status:
          type: string
          enum:
            - active
            - consumed
            - expired
            - revoked
          description: >-
            `active` — eligible for its type-specific application flow.
            `consumed` — used by a single-use charge. `expired` —
            network-expired reusable card. `revoked` — permanently deactivated
            by the merchant. A card_present method is staged active and consumed
            atomically by Terminal payment processing; clients cannot charge it
            directly.
        customer:
          type: string
          nullable: true
          description: The attached customer id (`cus_…`), or null if not attached.
        card:
          allOf:
            - $ref: '#/components/schemas/CardDetails'
          nullable: true
          description: 'Card details. Present for `type: card`; null otherwise.'
        card_present:
          allOf:
            - $ref: '#/components/schemas/CardPresentDetails'
          nullable: true
          description: >-
            Card details returned for `type: card_present`, or null when
            unavailable. Null for `type: card`.
        billing_details:
          allOf:
            - $ref: '#/components/schemas/BillingDetails'
          nullable: true
          description: Billing details captured for this method. Null when not supplied.
        fingerprint:
          type: string
          description: >-
            Stable card identifier for duplicate detection when available.
            Always empty for `type: card_present`.
        metadata:
          type: object
          additionalProperties:
            type: string
          description: A string key-value map for storing your own structured data.
        created_at:
          type: integer
          description: Unix epoch seconds.
    CardDetails:
      type: object
      required:
        - brand
        - country
        - exp_month
        - exp_year
        - funding_type
        - last4
      properties:
        last4:
          type: string
          description: The last four digits of the card number.
        brand:
          type: string
          enum:
            - visa
            - mastercard
            - amex
            - discover
            - unknown
          description: >-
            One of `visa`, `mastercard`, `amex`, `discover`, or `unknown` when
            the brand is unavailable.
        exp_month:
          type: integer
          description: >-
            Expiration month (1–12). Expiry is validated only at creation, not
            on read, so a method loaded from storage can show a past month.
        exp_year:
          type: integer
          description: >-
            Expiration year (four digits). Expiry is validated only at creation,
            not on read, so a method loaded from storage can show a past year.
        funding_type:
          type: string
          enum:
            - credit
            - debit
            - prepaid
            - unknown
          description: >-
            One of `credit`, `debit`, `prepaid`, or `unknown` when the funding
            type is unavailable.
        country:
          type: string
          description: Two-letter ISO country code of the issuing bank.
    CardPresentDetails:
      type: object
      required:
        - bin
        - brand
        - entry_method
        - funding_type
        - last4
      description: >-
        Card details captured during a terminal payment. Every key is present
        and its value is null when unavailable.
      properties:
        bin:
          type: string
          nullable: true
          pattern: ^[0-9]{6,8}$
          description: >-
            The 6–8 digit BIN/IIN for the presented card, or null when
            unavailable. A full PAN is never accepted or truncated into this
            field.
        last4:
          type: string
          nullable: true
          pattern: ^[0-9]{4}$
          description: The last four digits of the presented card number, or null.
        brand:
          type: string
          nullable: true
          enum:
            - visa
            - mastercard
            - amex
            - discover
            - unknown
          description: >-
            Card network; null when unavailable and `unknown` when the returned
            value is not supported.
        funding_type:
          type: string
          nullable: true
          enum:
            - credit
            - debit
            - prepaid
            - unknown
          description: >-
            Funding source; null when unavailable and `unknown` when the
            returned value is not supported.
        entry_method:
          type: string
          nullable: true
          enum:
            - chip
            - contactless
            - swipe
            - manual
            - fallback
            - unknown
          description: >-
            How the card was presented; null when unavailable and `unknown` for
            an unrecognized value.
    BillingDetails:
      type: object
      required:
        - email
        - name
        - phone
      properties:
        name:
          type: string
          description: Free-text cardholder name. Empty string when not set.
        email:
          type: string
          description: >-
            Email address; format-validated when supplied. Empty string when not
            set.
        phone:
          type: string
          description: Free-text phone number. Empty string when not set.
        address:
          allOf:
            - $ref: '#/components/schemas/Address'
          nullable: true
          description: Optional billing address. Null when not supplied.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    Address:
      type: object
      properties:
        line1:
          type: string
          description: >-
            The street address. Optional; a postal_code-and-country-only address
            is valid.
        line2:
          type: string
          nullable: true
          description: >-
            The secondary address line, for example an apartment or suite.
            Optional.
        city:
          type: string
          description: The city. Optional.
        state:
          type: string
          description: The state or province. Optional.
        postal_code:
          type: string
          description: >-
            The postal code. Required; format is not validated since it varies
            by country.
        country:
          type: string
          description: >-
            The two-letter ISO 3166-1 alpha-2 country code, uppercased.
            Required.
  responses:
    BadRequest:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_REQUEST
              message: reusable is required
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key lacks the required permission, or the merchant is not active.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentMethodNotFound:
      description: No payment method with that id is visible to this key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: PAYMENT_METHOD_NOT_FOUND
              message: payment method not found
    InvalidPaymentMethodState:
      description: The operation is not allowed in the payment method's current state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: PAYMENT_METHOD_CONSUMED
              message: payment method has already been consumed
    RateLimited:
      description: Too many requests. Honour the `Retry-After` header before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: |
        The API could not return a successful response. For a mutating request,
        retrieve the resource before retrying because the operation may have
        completed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: 'A merchant secret key (`sk_…`) sent as `Authorization: Bearer <key>`.'

````