Retrieve default payment method
curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default', 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.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default",
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-SALESBRICKS-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.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-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.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_method_id": "<string>",
"is_default": true,
"type": "card",
"us_bank_account": {
"bank_name": "<string>",
"bank_type": "<string>",
"last4": "<string>",
"routing_number": "<string>"
},
"card": {
"brand": "<string>",
"last4": "<string>",
"exp_month": 123,
"exp_year": 123
},
"link": {
"email": "<string>"
}
}Payment Methods
Retrieve default payment method
Retrieves the default payment method for the subscription’s customer.
GET
/
subscriptions
/
{subscription_id}
/
payment-methods
/
default
Retrieve default payment method
curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default', 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.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default",
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-SALESBRICKS-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.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-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.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/payment-methods/default")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_method_id": "<string>",
"is_default": true,
"type": "card",
"us_bank_account": {
"bank_name": "<string>",
"bank_type": "<string>",
"last4": "<string>",
"routing_number": "<string>"
},
"card": {
"brand": "<string>",
"last4": "<string>",
"exp_month": 123,
"exp_year": 123
},
"link": {
"email": "<string>"
}
}Authorizations
API key for authentication
Path Parameters
Pattern:
^([a-zA-Z\d\-]+)$Response
200 - application/json
Serializer for payment method data returned by the payment methods API. Handles card, bank account, SEPA direct debit, and Link payment methods.
Unique Stripe payment method identifier
Whether this is the default payment method for the customer
Type of payment method
card- Cardus_bank_account- US Bank Accountlink- Link
Available options:
card, us_bank_account, link Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes