# Delete tokenized payment method DELETE https://api-sandbox.payabli.com/api/TokenStorage/{methodId} Deletes a saved payment method. Reference: https://docs.payabli.com/developers/api-reference/tokenstorage/remove-a-payment-method ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Remove a payment method version: endpoint_tokenStorage.RemoveMethod paths: /TokenStorage/{methodId}: delete: operationId: remove-method summary: Remove a payment method description: Deletes a saved payment method. tags: - - subpackage_tokenStorage parameters: - name: methodId in: path description: The saved payment method ID. required: true schema: type: string - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_:PayabliApiResponsePaymethodDelete' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type_:IsSuccess: type: boolean type_:MethodReferenceId: type: string type_:ResultCode: type: integer type_:Resulttext: type: string type_:PayabliApiResponsePaymethodDeleteResponseData: type: object properties: referenceId: $ref: '#/components/schemas/type_:MethodReferenceId' description: The method's reference ID. resultCode: $ref: '#/components/schemas/type_:ResultCode' resultText: $ref: '#/components/schemas/type_:Resulttext' type_:ResponseText: type: string type_:PayabliApiResponsePaymethodDelete: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseData: $ref: >- #/components/schemas/type_:PayabliApiResponsePaymethodDeleteResponseData responseText: $ref: '#/components/schemas/type_:ResponseText' required: - responseText ``` ## SDK Code Examples ```python Example1 from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.token_storage.remove_method( method_id="32-8877drt00045632-678", ) ``` ```typescript Example1 import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.tokenStorage.removeMethod("32-8877drt00045632-678"); ``` ```go Example1 import ( context "context" option "github.com/payabli/sdk-go/option" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.TokenStorage.RemoveMethod( context.TODO(), "32-8877drt00045632-678", ) ``` ```csharp Example1 using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.TokenStorage.RemoveMethodAsync("32-8877drt00045632-678"); ``` ```ruby Example1 require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/TokenStorage/32-8877drt00045632-678") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java Example1 HttpResponse response = Unirest.delete("https://api-sandbox.payabli.com/api/TokenStorage/32-8877drt00045632-678") .header("requestToken", "") .asString(); ``` ```php Example1 request('DELETE', 'https://api-sandbox.payabli.com/api/TokenStorage/32-8877drt00045632-678', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift Example1 import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/TokenStorage/32-8877drt00045632-678")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```