curl --request GET \
--url https://api.recoupable.dev/api/accounts/{id}/payment-method \
--header 'x-api-key: <api-key>'import requests
url = "https://api.recoupable.dev/api/accounts/{id}/payment-method"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.recoupable.dev/api/accounts/{id}/payment-method', 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.recoupable.dev/api/accounts/{id}/payment-method",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.recoupable.dev/api/accounts/{id}/payment-method"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.recoupable.dev/api/accounts/{id}/payment-method")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/accounts/{id}/payment-method")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"card": {
"brand": "visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2026,
"funding": "credit"
}
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}Get Default Payment Method
Retrieve the default payment method on file for an account. An account may be tagged on more than one Stripe customer (for example an organization whose card was saved on one customer and whose invoiced plan lives on another); the card is read from the tagged customer that holds a default payment method. Returns card: null when no tagged customer has a payment method saved yet — the top-up dialog uses this to decide whether to show a pre-charge confirmation (card present) or route to a checkout session to collect one (card: null). Cards are returned even when expired; callers should compare exp_month / exp_year against the current date and warn the customer, since an off-session charge against an expired card will decline.
curl --request GET \
--url https://api.recoupable.dev/api/accounts/{id}/payment-method \
--header 'x-api-key: <api-key>'import requests
url = "https://api.recoupable.dev/api/accounts/{id}/payment-method"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.recoupable.dev/api/accounts/{id}/payment-method', 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.recoupable.dev/api/accounts/{id}/payment-method",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.recoupable.dev/api/accounts/{id}/payment-method"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.recoupable.dev/api/accounts/{id}/payment-method")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/accounts/{id}/payment-method")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"card": {
"brand": "visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2026,
"funding": "credit"
}
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}Authorizations
Your Recoup API key. Learn more.
Path Parameters
The unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.
Response
Default payment method retrieved successfully (may be null if none on file).
The unique identifier of the account this payment method belongs to.
"550e8400-e29b-41d4-a716-446655440000"
Default card on file. null when the account has never saved a payment method — the top-up flow will route through a checkout session in that case.
Show child attributes
Show child attributes
Was this page helpful?
