List a customer's payment methods
curl --request GET \
--url https://api-dashboard.payra.com/v1/payment-methods \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dashboard.payra.com/v1/payment-methods"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dashboard.payra.com/v1/payment-methods', 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-dashboard.payra.com/v1/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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-dashboard.payra.com/v1/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-dashboard.payra.com/v1/payment-methods")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dashboard.payra.com/v1/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"object": "payment_method",
"id": "pm_test_9kQ2mL7Hs1pXv4cR8tWzAbCdEf",
"type": "card",
"usage": "saved",
"status": "active",
"customer": null,
"session": "pms_test_7Hs2kQ9mL1pXv4cR8tWzAbCd",
"card": {
"brand": "visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2030,
"funding": "credit"
},
"us_bank_account": null,
"billing_details": {
"name": "Ada Lovelace",
"postal_code": "94110"
},
"livemode": false,
"expires_at": null,
"created_at": "2026-09-18T14:00:00.000Z"
}
],
"has_more": true
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Payment methods
List a customer's payment methods
The payment methods saved on a customer through the API that can still be charged, newest first, in the key’s environment. Detached ones are left out. Cards and bank accounts saved from the Payra dashboard or the customer portal have no payment method id and are not listed.
GET
/
payment-methods
List a customer's payment methods
curl --request GET \
--url https://api-dashboard.payra.com/v1/payment-methods \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dashboard.payra.com/v1/payment-methods"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dashboard.payra.com/v1/payment-methods', 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-dashboard.payra.com/v1/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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-dashboard.payra.com/v1/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-dashboard.payra.com/v1/payment-methods")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dashboard.payra.com/v1/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"object": "payment_method",
"id": "pm_test_9kQ2mL7Hs1pXv4cR8tWzAbCdEf",
"type": "card",
"usage": "saved",
"status": "active",
"customer": null,
"session": "pms_test_7Hs2kQ9mL1pXv4cR8tWzAbCd",
"card": {
"brand": "visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2030,
"funding": "credit"
},
"us_bank_account": null,
"billing_details": {
"name": "Ada Lovelace",
"postal_code": "94110"
},
"livemode": false,
"expires_at": null,
"created_at": "2026-09-18T14:00:00.000Z"
}
],
"has_more": true
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Authorizations
A secret key, sk_test_... or sk_live_...; a publishable key (pk_...) on the browser routes only
Query Parameters
The customer whose saved payment methods to list.
Required string length:
1 - 64Example:
"019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c30"
How many to return, 1 to 100.
Required range:
1 <= x <= 100Example:
20
The id of the last payment method of the previous page; the page after it is returned.
Required string length:
1 - 64Example:
"pm_test_9kQ2mL7Hs1pXv4cR8tWzAbCdEf"