Remove a Payment Method
Remove a stored card so it can no longer be charged
DELETE
/
api
/
v2
/
payment-methods
/
{payment_method_id}
Remove a Payment Method
curl --request DELETE \
--url https://api.example.com/api/v2/payment-methods/{payment_method_id}import requests
url = "https://api.example.com/api/v2/payment-methods/{payment_method_id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/api/v2/payment-methods/{payment_method_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/payment-methods/{payment_method_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/payment-methods/{payment_method_id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/api/v2/payment-methods/{payment_method_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/payment-methods/{payment_method_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_bodyRemove a Payment Method
Removes the stored card. Call this when the shopper asks you to stop using their card. A removed payment method cannot be charged or restored. Calling it again for the same ID returns the same result.Endpoint
DELETE /api/v2/payment-methods/{payment_method_id}
Authentication
Authorization: Bearer glm_test_YOUR_API_KEY
Path Parameters
| Parameter | Type | Description |
|---|---|---|
payment_method_id | string | The payment method ID (pm_...) |
Response
The payment method, withstatus set to disabled.
{
"success": true,
"message": "Payment method removed",
"data": {
"id": "pm_fc61f9c445dd477287c47052087dc91c",
"type": "card",
"brand": "visa",
"last4": "1111",
"exp_month": "03",
"exp_year": "2030",
"usage": "off_session",
"status": "disabled",
"checkout_id": "cs_abc123",
"customer_email": "jane@example.com",
"last_used_at": "2026-12-10T09:15:02Z",
"created_at": "2026-11-10T21:04:11Z"
}
}
Errors
| Status Code | Error Code | Description |
|---|---|---|
| 401 | unauthorized | Invalid API key |
| 404 | PAYMENT_METHOD_001 | Unknown ID, or a payment method stored in the other mode |
| 503 | PAYMENT_METHOD_014 | The payment method could not be removed right now. Safe to retry |
Related
⌘I
Remove a Payment Method
curl --request DELETE \
--url https://api.example.com/api/v2/payment-methods/{payment_method_id}import requests
url = "https://api.example.com/api/v2/payment-methods/{payment_method_id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/api/v2/payment-methods/{payment_method_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/payment-methods/{payment_method_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/payment-methods/{payment_method_id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/api/v2/payment-methods/{payment_method_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/payment-methods/{payment_method_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body