Get a Payment Method
Read one stored card
GET
/
api
/
v2
/
payment-methods
/
{payment_method_id}
Get a Payment Method
curl --request GET \
--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.get(url)
print(response.text)const options = {method: 'GET'};
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 => "GET",
]);
$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("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("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::Get.new(url)
response = http.request(request)
puts response.read_bodyGet a Payment Method
Returns one payment method.Endpoint
GET /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
{
"success": true,
"data": {
"id": "pm_fc61f9c445dd477287c47052087dc91c",
"type": "card",
"brand": "visa",
"last4": "1111",
"exp_month": "03",
"exp_year": "2030",
"usage": "off_session",
"status": "active",
"checkout_id": "cs_abc123",
"customer_email": "jane@example.com",
"last_used_at": null,
"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 (test or live) |
Related
⌘I
Get a Payment Method
curl --request GET \
--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.get(url)
print(response.text)const options = {method: 'GET'};
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 => "GET",
]);
$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("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("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::Get.new(url)
response = http.request(request)
puts response.read_body