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

# Revoke Saved Payment

> **Revoke a customer's saved payment method in Payment Gateway**

Allow merchants to permanently remove a customer's previously saved (tokenized) payment details for a given channel. Once revoked, the saved payment method can no longer be used for future payments — the customer must save their payment method again (via the [Add Saved Payment Endpoint](/api-reference/add-saved-payment)) if they wish to pay this way again.

> - Merchants shall pass their customer's Unique Id to the **"username"** parameter — the same Unique Id originally supplied to `customer.username` when the payment method was saved.
> - Channel Id may refer to the [Get Channel List](/api-reference/get-tenant-channels-by-country).
> - Only channels/providers that support saved payments can be revoked through this endpoint. If the channel does not support it, or no saved payment is found for the given username on that channel, the request will fail.
> - This endpoint returns no response body on success (HTTP 200, empty). Treat the absence of an error as confirmation the saved payment method was revoked.



## OpenAPI

````yaml /openapi.json post /api/services/app/PaymentGateway/RevokeTokenize
openapi: 3.0.1
info:
  title: CommercePay API
  version: v1
  description: >
    ---

    **Credentials Accounts**


    Every account is provided with separate keys for testing and for running
    live transactions. Once the merchant application has been approved,
    developers can begin the process of integrating the CommercePay API. The
    following details will be provided to get started with the integration. 


    <a href="https://docs.commercepay.asia/docs/api/d19b0f3289ae0-get-started"
    target="_blank">Get Started</a>
  contact: {}
servers:
  - description: Staging
    url: https://staging-payments.commerce.asia
  - url: https://payments.commerce.asia
    description: Production
security: []
paths:
  /api/services/app/PaymentGateway/RevokeTokenize:
    post:
      tags:
        - PaymentGateway
      summary: Revoke Saved Payment
      description: >-
        **Revoke a customer's saved payment method in Payment Gateway**


        Allow merchants to permanently remove a customer's previously saved
        (tokenized) payment details for a given channel. Once revoked, the saved
        payment method can no longer be used for future payments — the customer
        must save their payment method again (via the [Add Saved Payment
        Endpoint](/api-reference/add-saved-payment)) if they wish to pay this
        way again.


        > - Merchants shall pass their customer's Unique Id to the
        **"username"** parameter — the same Unique Id originally supplied to
        `customer.username` when the payment method was saved.

        > - Channel Id may refer to the [Get Channel
        List](/api-reference/get-tenant-channels-by-country).

        > - Only channels/providers that support saved payments can be revoked
        through this endpoint. If the channel does not support it, or no saved
        payment is found for the given username on that channel, the request
        will fail.

        > - This endpoint returns no response body on success (HTTP 200, empty).
        Treat the absence of an error as confirmation the saved payment method
        was revoked.
      operationId: ApiServicesAppPaymentgatewayRevoketokenizePost
      parameters:
        - $ref: '#/components/parameters/AbpTenantId'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/CapSignature'
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/RevokeTokenizeInputDto'
          application/json:
            schema:
              $ref: '#/components/schemas/RevokeTokenizeInputDto'
          text/json:
            schema:
              $ref: '#/components/schemas/RevokeTokenizeInputDto'
          application/*+json:
            schema:
              $ref: '#/components/schemas/RevokeTokenizeInputDto'
        description: ''
      responses:
        '200':
          description: Success
components:
  parameters:
    AbpTenantId:
      schema:
        type: string
      in: header
      name: Abp-TenantId
      required: true
      description: Your unique Merchant ID assigned by CommercePay.
    Authorization:
      schema:
        type: string
      in: header
      name: Authorization
      required: true
      description: Your API credentials used for authentication (typically a Bearer token).
    CapSignature:
      schema:
        type: string
      in: header
      name: cap-signature
      required: true
      description: >-
        A unique security hash used to verify the integrity of the request body.
        See [Generate Signature](/docs/generate-signature) for how to generate
        this.
  schemas:
    RevokeTokenizeInputDto:
      type: object
      additionalProperties: false
      required:
        - username
        - channelId
        - timestamp
      properties:
        username:
          type: string
          description: >-
            Customer's unique ID whose saved payment method should be revoked.
            Same value originally passed to customer.username when the payment
            method was saved.
          example: username
        channelId:
          type: integer
          format: int32
          description: >-
            An identifier that represents a CommercePay payments channel. Refer
            id on response end points [Get Channel
            List](/api-reference/get-tenant-channels-by-country).
        tenantId:
          type: integer
          format: int32
          description: Fill in provided Tenant Id.
          nullable: true
        timestamp:
          type: integer
          format: int64
          description: new Date().getTime()
          example: 1621851652617

````