> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://beta-docs.payabli.com/api-reference/tokenstorage/remove-a-payment-method/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://beta-docs.payabli.com/_mcp/server. # Delete tokenized payment method DELETE https://api-sandbox.payabli.com/api/TokenStorage/{methodId} Deletes a saved payment method. Reference: https://beta-docs.payabli.com/api-reference/tokenstorage/remove-a-payment-method ## Authentication - `requestToken` header (required) — API Key authentication via header ## Servers - `https://api-sandbox.payabli.com/api` (Sandbox, default) - `https://api.payabli.com/api` (Production) ## Request ### Path parameters - `methodId` (string, required) — The saved payment method ID. ## Response ### 200 Success - `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure. - `responseData` (PayabliApiResponsePaymethodDeleteResponseData, optional) - `responseText` (string, optional) — Response text for operation: 'Success' or 'Declined'. ## Errors ### 400 Bad Request Error Bad request/ invalid data - `any` ### 401 Unauthorized Error Unauthorized request. - `any` ### 500 Internal Server Error Internal API Error - `any` ### 503 Service Unavailable Error Database connection error - `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure. - `responseData` (map from string to any, optional) — The object containing the response data. - `responseText` (string, optional) — Response text for operation: 'Success' or 'Declined'. ## Types ### PayabliApiResponsePaymethodDeleteResponseData - `referenceId` (string, optional) — The method's reference ID. - `resultCode` (integer, optional) — Result code for the operation. Value 1 indicates a successful operation, values 2 and 3 indicate errors. A value of 10 indicates that an operation has been initiated and is pending. - `resultText` (string, optional) — Text describing the result. If `ResultCode` = 1, will return 'Approved' or a general success message. If `ResultCode`` = 2 or 3, will contain the cause of the error or decline. ## Examples **Response** ```json { "isSuccess": true, "responseData": { "referenceId": "32-8877drt65345632-678", "resultCode": 1, "resultText": "Removed" }, "responseText": "Success" } ``` **SDK Code** ```python Example1 import requests url = "https://api-sandbox.payabli.com/api/TokenStorage/32-8877drt00045632-678" headers = {"requestToken": ""} response = requests.delete(url, headers=headers) print(response.json()) ``` ```javascript Example1 const url = 'https://api-sandbox.payabli.com/api/TokenStorage/32-8877drt00045632-678'; const options = {method: 'DELETE', headers: {requestToken: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Example1 package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-sandbox.payabli.com/api/TokenStorage/32-8877drt00045632-678" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("requestToken", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```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 import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; 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(); ``` ```csharp Example1 using RestSharp; var client = new RestClient("https://api-sandbox.payabli.com/api/TokenStorage/32-8877drt00045632-678"); var request = new RestRequest(Method.DELETE); request.AddHeader("requestToken", ""); IRestResponse response = client.Execute(request); ``` ```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() ``` > If you're a software company, you're a payments company™